Category : Word Processors
Archive   : HP22D3.ZIP
Filename : FUNCTNS.TXT

 
Output of file : FUNCTNS.TXT contained in archive : HP22D3.ZIP




________________________________________________________________________
Chapter 13: Functions 219
________________________________________________________________________


CHAPTER THIRTEEN: FUNCTIONS


INTRODUCTION

This chapter describes all of the functions available in HyperPAD. Each
HyperPAD function returns a single value to your script.


CALLING A FUNCTION

To make a function call within a script, use the following syntax:

put min(10,12) into msg;

put the min of 10,12 into msg;

If the function doesn't have any arguments, then use the following
syntax:

put screenWidth() into msg;

put the screenWidth into msg;

You cannot mix the two syntax together. For example, the following are
wrong:

put the min(10,12) into msg;

put min of 10,12 into msg;


FUNCTION SEND MESSAGES

All functions in HyperPAD are send as messages. For example, the
function call min(4,5) sends a min message with two parameters: 4 and 5.
This allows you to redefine any of the built-in function available in
HyperPAD by replacing the function with your own.

For example, the following redefines the built-in function min():

function min;
begin
return 6;
end;

Redefining built-in functions prevents your scripts lower in the
hierarchy from accessing the real function. If the above redefinition of
the min() function occurred in a pad script, then all of the background,
pages, button, and fields, of that pad which use the min() function
would not work.



________________________________________________________________________
Chapter 13: Functions 220
________________________________________________________________________


In the next example, suppose you wanted HyperPAD to look for files in a
certain directory on your hard disk that isn't specified in the DOS
path. In this case, the findFile() function, which normally searches the
DOS path for files, will not find files in your special directory. You
could redefine the findFile() function and place it into the pad script
of your Home pad so that all pads that use findFile() will work
properly.

function findFile(fileName);
begin
return fileExists("C:\DOCUMENTS\OLD\" & fileName);
end;


FUNCTION LISTING BY TOPIC


COMPUTER FUNCTIONS

The following is a complete list of computer functions in HyperPAD:

coprocessor freeMem mouseLoc
cup graphicsCard mouseX
cursorLoc mouseButton mouseY
cursorX mouseClick screenHeight
cursorY mouseExists screenWidth


CONVERSION FUNCTIONS

The following are the conversion functions in HyperPAD:

charToNum numToChar


DATE AND TIME FUNCTIONS

The following are the date and time functions in HyperPAD:

date longTime time
longDate seconds



________________________________________________________________________
Chapter 13: Functions 221
________________________________________________________________________


DOS FUNCTIONS

The following are the DOS functions in HyperPAD:

append dosVersion files
commandLine drive fileSize
create drives findFile
directory environment fullName
dirs fileExists longFiles
diskSpace fileOpen open


FINANCIAL FUNCTIONS

The following are the HyperPAD financial functions:

annuity stdev compound
variance


KEYBOARD FUNCTIONS

The following are the keyboard functions in HyperPAD:

altKey key shiftKey
ctrlKey



________________________________________________________________________
Chapter 13: Functions 222
________________________________________________________________________


MATHEMATICAL FUNCTIONS

The following are the mathematical functions in HyperPAD:

abs exp2 round
acos fact sin
asin ln sqrt
atan ln1 sum
average max tan
cos min trunc
exp product
exp1 random


PAD INFORMATION FUNCTIONS

The following functions return information about pads:

currentBackground freeSize target
currentObject isSound version
currentPad number of
currentPage padSize


TEXT HANDLING FUNCTIONS

The following are the text handling functions in HyperPAD:

clean offset substitute
leftString proper upper
lenght repeatChar
lower rightString



________________________________________________________________________
Chapter 13: Functions 223
________________________________________________________________________


MISCELLANEOUS FUNCTIONS

The following are the miscellaneous functions in HyperPAD:

choose paramCount popup
param params result

-----------------------------------
ABS

Syntax:
abs()

Purpose: The abs() function returns the absolute value of a number;
which is always a positive number, even if the is negative.

Examples:

The following example puts 9 into page field 1.

put the abs of 9 into page field 1;

The next example puts 33 into the message box.

put abs (-33) into the message box;

-----------------------------------
ACOS

Syntax:
acos()

Purpose: The acos() function returns the arc cosine of a number. The arc
cosine (inverse cosine) is the angle whose cosine is . The angle
is given in degrees.

Examples:

The following example puts 60 into page field 1.

put the acos of 0.5 into page field 1;

See Also: asin(), atan()



________________________________________________________________________
Chapter 13: Functions 224
________________________________________________________________________


-----------------------------------
ALTKEY

Syntax:
altKey()

Purpose: The altKey() function returns the status of the ALT key. It
returns either down or up.

Examples:

put the altKey into the message box;

See Also: shiftKey(), ctrlKey()

-----------------------------------
ANNUITY

Syntax:
annuity(,);

Purpose: This function computes the present or future value of an
annuity. represents the interest rate per period. is
the number of periods.

HyperPAD uses the following formula:

(1-(1+rate)^-periods)/rate

Examples:

To compute the monthly payment of a loan of $10,000.00 at 11% for 10
years:

put 10000 into total; --amount borrowed
put 11/100/12 into interest; -- interest per month
put 10*12 into numPayments; -- 10 years*12 mo/yr
put total/annuity(interest,numPayments) into payment;

HyperPAD puts the number 137.75 into the container payment.

As another example, to determine the present value in 2 years of an
investment of $1000.00 that earns 18% interest, use the following
statement:

put 1000*annuity(18/100,2) into future_value;

HyperPAD puts 1565.64 into the container future_value.

See Also: compound()



________________________________________________________________________
Chapter 13: Functions 225
________________________________________________________________________


-----------------------------------
APPEND

Syntax:
append()

Purpose: The append() function accesses and opens an existing file
moving the DOS file write position to the end of the file so that data
can be added using the write command.

The value returned by append() is a number that is used to refer to that
file. You must supply this number in order to use the write and close
commands.

If you attempt to append a file that doesn't exist, no file is opened
and the result() function will return "no such file". If the append
function is successful, the result() function will return empty. When
you give the file's name (in the script) you must follow DOS file naming
conventions. If no pathname is specified, HyperPAD searches the current
directory.

The file is closed when the user exits HyperPAD, issues a run command,
or explicitly closes the file with the close command.

Examples:

The following example appends a line to your AUTOEXEC.BAT file:

put the append of "C:\AUTOEXEC.BAT" into fh;
if the result is empty then --append successful?
begin
write return & "rem this is appended" to fh;
close fh;
end;

See Also: write, close, open(), read

-----------------------------------
ASIN

Syntax:
asin()

Purpose: This function returns the arc sine of a number. The arc sine
(inverse sine) is the angle whose sine is .

Examples:

put the asin of .789 into page field 1;

See Also: acos(), atan()



________________________________________________________________________
Chapter 13: Functions 226
________________________________________________________________________


-----------------------------------
ATAN

Syntax:
atan()

Purpose: This function returns the arc tangent of a number. The arc
tangent (inverse tangent) is the angle whose tangent is .

Examples:

put the atan of 1 into page field 2;

See Also: acos(), asin()

-----------------------------------
AVERAGE

Syntax:
average(,[,...])

Purpose: The average() function averages a group of numbers.
The numbers can be constants or containers with numeric values. You can
supply any number of parameters (at least two are required) to this
function.

The formula used is:

(num1+num2+num3+...+numN)/N

Examples:

get the average of (field 1, 10, field4);

put the average of 10,67,10.67,page field 2 into msg;

See Also: stdev()

-----------------------------------
CHARTONUM

Syntax:
charToNum()

Purpose: This function returns the ASCII value of the specified
character. If a string is given, charToNum() only returns the value of
the first character.

Examples:

put the charToNum of "a" into "list";



________________________________________________________________________
Chapter 13: Functions 227
________________________________________________________________________


put the charToNum of "L" into field 3;

See Also: numToChar()

-----------------------------------
CHOOSE

Syntax:
choose(,[,...]

Purpose: The choose() function chooses the Nth parameter
from the parameter list. The arguments may be any combination of values,
strings, or containers. If the index is larger than the number of
arguments, choose() returns empty.

A good use for this function is in performing an "array" lookup. The
statement:

put choose(2,10,12,14);

puts the value 12 into the message box, because 12 was the second
parameter (after the 2).

Examples:

put choose(3,"A",word 1 of page field 1,"C");

put choose(i,page field 1,page field 2,page field 2) into
page field 2;

-----------------------------------
CLEAN

Syntax:
clean()

Purpose: The clean() function strips a text string of unreadable
characters, returning a text string that does not contain control codes
or any other non-printable characters.

Examples:

put the clean of it into the message box;

put clean(page field 1) into page field 1;

You can use clean() to strip unreadable characters from text read into
HyperPAD from a file:

read 3 lines from fh;
put clean(it) into field 1;



________________________________________________________________________
Chapter 13: Functions 228
________________________________________________________________________


-----------------------------------
COMMANDLINE

Syntax:
commandLine()

Purpose: The commandline() function returns the exact command line that
was used to run HyperPAD from the DOS prompt. The command line can be up
to 128 characters. No special DOS characters (like |, >, <) are returned
because they are transparent to applications.

Because HyperPAD ignores any command line parameters it doesn't
recognize, authors can implement their own command line switches.

Examples:

If the user started HyperPAD with the following command:

HPAD PHONE /43 /nomsg /geewiz

The commandline() returns "PHONE /43 /nomsg /geewiz".

This example tests for a user-defined command line option:


if "/geewiz" is in the commandLine then
begin
visual effect peel;
go to page "stuff";
end;

-----------------------------------
COMPOUND

Syntax:
compound(,)

Purpose: This function computes the future value of an account that
earns compound interest. is the interest rate for the period,
is the number of periods.

The formula for the above syntax is:

(1+rate)^periods



________________________________________________________________________
Chapter 13: Functions 229
________________________________________________________________________


Examples:

To determine the future value in 2 years of an investment of $1000.00
that earns 18%, use the following statement:

put 1000*compound(18/100,2) into future_value;

This puts 1392.4 into the message box.

See Also: annuity()

-----------------------------------
COPROCESSOR

Syntax:
coprocessor()

Purpose: This function returns true if there is a math processor (80x87)
installed.

-----------------------------------
COS

Syntax:
cos()

Purpose: This function returns the cosine of an angle, which must be
specified in degrees.

Examples:

put the cos of 45 into page field 12;

See Also: sin(), tan()

-----------------------------------
CPU

Syntax:
cpu()

Purpose: The cpu() function returns the microprocessor in use, either
8086, 80186, 80286, or 80386. HyperPAD doesn't differentiate between the
8088 and 8086 microprocessors, it returns 8086 for 8088 machines.

Examples:

put the cpu into cpuType;

put cpu() into the message box;



________________________________________________________________________
Chapter 13: Functions 230
________________________________________________________________________


-----------------------------------
CREATE

Syntax:
create()

Purpose: The create() function creates a new file with the specified
filename that can be used with the write command. The returned value is
a number that is used to refer to the file with the write and close
commands.

If a file with that name already exists, its length is truncated to
zero, so the new data replaces any previous data. If create() is
successful, the result() function returns empty; if there is an error,
the result() function will return "open error".

A file created with create() can be written to using the write command.
HyperPAD creates the file in the current directory if no path is
specified in .

All files are closed when the user exits HyperPAD, issues a run command,
or explicitly closes the file with the close command.

Examples:

put the create of "C:\HPAD\DATA.DAT" into myFile;

The following example uses create() to create a new file of page scripts
from the current pad:

put the create of "SCRIPTS.TXT" into fh;
if the result is not empty then exit;
for i = 1 to the number of pages do
write (the script of page i) & return to fh;
close fh;

See Also: append(), open(), write, read

-----------------------------------
CTRLKEY

Syntax:
ctrlKey()

Purpose: This function returns the status of the CTRL key. If the CTRL
key is pressed, it returns down, and if the CTRL key is not pressed it
returns up.

Examples:

put the ctrlKey into msg;



________________________________________________________________________
Chapter 13: Functions 231
________________________________________________________________________


-----------------------------------
CURRENTBACKGROUND

Syntax:
currentBackground()

Purpose: The currentBackground() function returns the number of the
background used by the current page.

Examples:

put the currentBackground into the message box;

See Also: currentPage(), currentObject(), currentPad()

-----------------------------------
CURRENTOBJECT

Syntax:
currentObject()

Purpose: This function returns the name of the object that currently has
the focus in the following format:

(page | background) (button | field) id

Some examples of text returned by currentObject() are:

page button id 4

page field id 9

background field id 1

background button id 89

Examples:

if word 4 of the currentObject is 4 then
go to page 5;

Abbreviations: curObj()

See Also: target, me



________________________________________________________________________
Chapter 13: Functions 232
________________________________________________________________________


-----------------------------------
CURRENTPAD

Syntax:
currentPad()

Purpose: The currentPad() function returns the full DOS filename of the
current pad including the drive letter and directory.

For example, if the current pad is HOME.PAD, then currentPad() might
return:

C:\HPAD2\HOME.PAD

Examples:

put the currentPad into the message box;

This function is especially useful in determining the directory of the
pad you are currently using. The following example extracts the
directory from the name of the current pad and loads another pad from
that same directory:

get currentPad(); -- it = current pad
get substitute(it,"\",","); -- "\" changed to ","
delete the last item of it; -- get rid of filename
get substitute(it,",""\"); -- "," changed to "\"
go to pad it & "\PHONE.PAD" -- append new name

Abbreviations: curPad()

See Also: currentPage(), currentBackground(), currentObject()

-----------------------------------
CURRENTPAGE

Syntax:
currentPage()

Purpose: This function returns the number of the current page. This is
not the page's ID number; it is the number that corresponds to the
page's position in the pad.

Examples:

put currentPage() into msg;

go to page (currentPage() + 2);



________________________________________________________________________
Chapter 13: Functions 233
________________________________________________________________________


The following example shows you how to alter the Next command on the Go
menu so that on the last page of the pad, the command will do nothing.

handler doMenu(d);
begin
if d is "Next" then
if the currentPage = the number of pages then
put "Last page.";
pass;
end;

Abbreviations: curPage()

See Also: currentObject(), currentBackground(), currentPad()

-----------------------------------
CURSORLOC

Syntax:
cursorLoc()

Purpose: This function returns the current X,Y coordinates of the
cursor. The returned text string describes the character cell where the
hardware text cursor (the blinking cursor) is located; for example,
"10,12" specifies character position 10 horizontally and character
position 12 vertically.

Examples:

put the cursorLoc into the message box;

put the cursorLoc into page field 5;

See Also: cursorX, cursorY, cursor



________________________________________________________________________
Chapter 13: Functions 234
________________________________________________________________________


-----------------------------------
CURSORX

Syntax:
cursorX()

Purpose: This function returns the X coordinate of the cursor. The
X coordinate of the hardware text cursor (the blinking cursor) is its
current horizontal position or column location. For example, 10
specifies the tenth horizontal character cell.

Examples:

if cursorX() > 40 then put "right side of page";

put the cursorX into the message box;

See Also: cursorY(), cursorLoc(), cursor

-----------------------------------
CURSORY

Syntax:
cursorY()

Purpose: This function returns the Y coordinate of the cursor. The
Y coordinate of the hardware text cursor (the blinking cursor) is its
current vertical position or character location. For example, 12
represents the twelfth vertical character cell.

Examples:

if cursorY() > 12 then
put "bottom half of page" into page field 4;

put the cursorY into the message box;

See Also: cursorLoc(), cursorX(), cursor

-----------------------------------
DATE

Syntax:
date()

Purpose: This function returns the short form of the current date. The
date is a text string showing Month/Day/Year (MM/DD/YY), for example:

12/25/90



________________________________________________________________________
Chapter 13: Functions 235
________________________________________________________________________


Examples:

if char 1 to 5 of the date is "12/25" then
answer "It's Christmas!" with "Yippee";

See Also: longDate()

-----------------------------------
DIRECTORY

Syntax:
directory([])

Purpose: The directory() function returns the working directory on any
drive. The returned value includes a drive letter and the complete
pathname.

get the directory; -- get the current directory

get the directory of "F"; -- get dir on drive F

The drive letter parameter is optional. If one is not specified,
directory() will return the current directory. A value of empty means
that the specified drive was invalid.

Examples:

put the directory into page field "Current Directory";

The following example searches the current directory on all drives for a
file called JUNK.TXT:

put the drives into driveList;
for i = 1 to the number of items of driveList do
begin
get the directory of item i of driveList;
if the last char of it is not "\" then
put "\" after it;
if fileExists(it & "JUNK.TXT") then
answer "Found it in directory" && it with "Ok";
end;

Abbreviations: dir()

See Also: currentDirectory()



________________________________________________________________________
Chapter 13: Functions 236
________________________________________________________________________


-----------------------------------
DIRS

Syntax:
dirs([])

Purpose: The dirs() function returns a list of all the sub-directories
within a specified directory. If you don't specify the optional
pathname, HyperPAD returns a list of sub-directories from the current
directory.

get the dirs; -- subdirs of current directory

get dirs("C:\"); -- subdirs of root on C:

This function will return a list of sub-directories resembling the
following format:

[.. ]
[123 ]
[WORD ]
[SAMPLES ]
The ".." means that there is a parent directory.

Examples:

put the dirs into page field "Directory List";

put dirs("C:\LOTUS") into page field "Dirs";

if ".." is not in dirs() then
answer "You are currently in a root directory";

See Also: drives(), files(), longFiles()

-----------------------------------
DISKSPACE

Syntax:
diskSpace([])

Purpose: The diskSpace() function returns the amount of free space on
the specified drive in bytes. If the optional drive letter is not
specified, then the free space from the current drive is returned.

Examples:

put the diskSpace of "E" into page field 4;

put the diskSpace into background field 1;



________________________________________________________________________
Chapter 13: Functions 237
________________________________________________________________________


-----------------------------------
DOSVERSION

Syntax:
dosVersion()

Purpose: This function returns the DOS version. Both the major version
number and the minor version number are returned, like the following:

3.0
3.3
4.0

Examples:

put the dosVersion in the message box;

-----------------------------------
DRIVE

Syntax:
drive()

Purpose: This function returns the current drive.

Examples:

if the drive is "C" then put "this is a hard disk"
in page field 3;

See Also: drives()



________________________________________________________________________
Chapter 13: Functions 238
________________________________________________________________________


-----------------------------------
DRIVES

Syntax:
drives()

Purpose: The drives() function returns a list of valid disk drives in an
item delimited list, like the following:

A:,B:,C:

Examples:

The following example puts the drives into a field, putting each drive
letter on a different line:

put substitute(the drives,",",return) into pg fld 1;

The following statements let the user select a drive letter from a list:

get popup(drives(),35,10);
if it is not 0 then
answer "You chose drive" && item it of drives();

-----------------------------------
ENVIRONMENT

Syntax:
environment()

Purpose: This function returns the DOS environment setting for the
passed DOS environment variable. The environment() function searches the
list of environment variables for an entry corresponding to the passed
argument.

The environment() function is useful for finding the location of the
command processor (the COMSPEC variable). It may also be useful to
retrieve user-defined environment variables that may control a pad.

Examples:

put the environment of "path" into the msg;



________________________________________________________________________
Chapter 13: Functions 239
________________________________________________________________________


The following example uses environment() to locate COMMAND.COM.
Normally, there is an environment string called COMSPEC that has its
directory:

get environment("COMSPEC"); --try the environment
if it is empty then
get findFile("COMMAND.COM"); --try the path
if it is empty then
get "C:\COMMAND.COM"); --last resort - drive C
if not fileExists(it) then
answer "Unable to locate the command processor.";

-----------------------------------
EXP

Syntax:
exp()

Purpose: This function returns the value of e raised to the power of the
argument. E equals 2.7182818, the base of the natural logarithm.

Examples:

The following statement puts 54.59815 into the message box:

put the exp of 4 into msg;

See Also: exp1(),exp2()

-----------------------------------
EXP1

Syntax:
exp1()

Purpose: This function returns the value of one less than e raised to
the power of the argument. E equals 2.7182818, the base of the natural
logarithm.

Examples:

The following statement puts 8102.083928 into the message box:

put the exp1 of 9 into msg;

See Also: exp(), exp2()



________________________________________________________________________
Chapter 13: Functions 240
________________________________________________________________________


-----------------------------------
EXP2

Syntax:
exp2()

Purpose: This function returns the value of 2 raised to the power of the
argument. To calculate the power of other numbers, use the power (^)
operator.

Examples:

put exp2(6*2) into the message box; -- 64

put the exp2 of 4 into x; -- 16

See Also: exp(), exp1()

-----------------------------------
FACT

Syntax:
fact()

Purpose: This function returns the factorial of the specified number.
The factorial of a number is equal to:

number*(number - 1) * (number *...* (number - n)
where n = number - 1.

Examples:

put the fact of 6 into it; -- 720

put the fact of 10 into msg; -- 3628800

-----------------------------------
FILEEXISTS

Syntax:
fileExists()

Purpose: The fileExists() function allows you to determine if the file
you specified exists. This function returns true or false. You can
specify any valid DOS filename, including a path.

Examples:

put the fileExists of "MY.PAD" into IT;



________________________________________________________________________
Chapter 13: Functions 241
________________________________________________________________________


if fileExists("C:\123\123.COM") then
run "C:\123\123.COM" with programDirectory;

-----------------------------------
FILEOPEN

Syntax:
fileOpen(,<prompt>,<file extension>)<br /> <br /> Purpose: This function allows the user to select a file from the File<br /> Open dialog box. This is the same dialog box that HyperPAD uses when you<br /> select Open from the File menu.<br /> <br /> Parameter: Description:<br /> -------------------------------------------------------------<br /> <title> Title of the dialog box<br /> <br /> <prompt> Text above the filename field in the dialog box.<br /> <br /> <file extension> Extension of the files that HyperPAD displays in the<br /> list box, like "WK1" or "DOC". This parameter can also<br /> include a path specification, like "C:\123\*.WK1".<br /> <br /> The fileOpen() function returns empty if the user selected Cancel,<br /> otherwise it returns a complete DOS path specification (with drive<br /> letter) for the file that the user selects.<br /> <br /> For example:<br /> <br /> C:\123\SHEETS\HOUSE.WK1<br /> <br /> Examples:<br /> <br /> put fileOpen("Open File","File Name:","C:\*.COM");<br /> <br /> put the fleOpen of<br /> "My Open File Box",<br /> "Type in the file name:",<br /> "..\*.WK1,..\*.DOC,..\*.TXT"; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 242<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> FILES<br /> <br /> Syntax:<br /> files([<filemask>])<br /> <br /> Purpose: The files() function returns a list of all the filenames<br /> separated by carriage returns that match a search mask.<br /> <br /> If no search mask is specified, files() returns all of the files in the<br /> current directory (*.*). The files are returned in the following manner:<br /> <br /> HOME.PAD<br /> PHONE.PAD<br /> ZAP.PAD<br /> <br /> The files are sorted according to the value of the fileSortMethod<br /> property, which is 1 by default (sort ascending by filename).<br /> <br /> Examples:<br /> <br /> put the files into page field 4;<br /> put files ("*.EXT") into page field 4;<br /> <br /> See Also: longFiles(), fileSortMethod<br /> <br /> -----------------------------------<br /> FILESIZE<br /> <br /> Syntax:<br /> fileSize(<filename>)<br /> <br /> Purpose: This function returns the size in bytes of the specified file.<br /> If the file does not exist, fileSize() returns 0.<br /> <br /> Examples:<br /> <br /> put fileSize("README.DOC") into the message box;<br /> <br /> if the fileSize of "DATA.DAT" < 30000 then<br /> doMenu "Import..."; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 243<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> FINDFILE<br /> <br /> Syntax:<br /> findFile(<fileName>)<br /> <br /> Purpose: This function searches for a file using HyperPAD's built-in<br /> search technique. HyperPAD looks in the following places in the<br /> following order:<br /> <br /> 1. Search the current directory.<br /> <br /> 2. Search the directory pointed to by the HPADNET environment variable<br /> (if there is one).<br /> <br /> 3. Search the directory where HPAD.EXE exists.<br /> <br /> 4. Search the directory where HyperPAD was started.<br /> <br /> 5. Search all directories specified in the DOS path.<br /> <br /> 6. Search the B: drive if the Program disk is in A and A is a low<br /> density disk (360K).<br /> <br /> If the file is located, you are returned the full DOS path name. If the<br /> file cannot be located, findFile() returns empty.<br /> <br /> Examples:<br /> <br /> if findFile("DATA.DAT") is not empty then<br /> answer "Can't find the data file";<br /> <br /> get the findFile of "readme.doc";<br /> <br /> See Also: fileExists(), fullName()<br /> <br /> -----------------------------------<br /> FREEMEM<br /> <br /> Syntax:<br /> freeMem()<br /> <br /> Purpose: The freeMem() function returns the number of bytes of free<br /> memory. The number is not the total memory in the computer; nor is it<br /> the total amount of memory for your pad. It returns the free memory at<br /> the time you call the function.<br /> <br /> Examples:<br /> <br /> put the freeMem into the message box;<br /> <br /> See Also: padSize(), freeSize() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 244<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> FREESIZE<br /> <br /> Syntax:<br /> freeSize()<br /> <br /> Purpose: The freeSize() function returns the number of bytes of free<br /> space in the current pad. This number is constantly changing as you use<br /> your pad.<br /> <br /> Note: The free space in read-only pads (pads whose<br /> cantModify property is set to true) will never change.<br /> <br /> Examples:<br /> <br /> if the freeSize >` 4000 then doMenu "Compress";<br /> <br /> See Also: freeMem(), padSize()<br /> <br /> -----------------------------------<br /> FULLNAME<br /> <br /> Syntax:<br /> fullName(<pathname>)<br /> <br /> Purpose: The fullName() function takes a partial file specification and<br /> returns a full DOS path name for the file. The following table shows<br /> samples of what this function returns, depending on the parameter<br /> supplied to the fullName() function:<br /> <br /> Current Directory: Parameter: Returns:<br /> -------------------------------------------------------------<br /> C:\HPAD2 .. C:\<br /> <br /> C:\HPAD\PADS ..\ACCOUNTS\..\.. C:\<br /> <br /> C:\HPAD2 C:.. C:\HPAD2<br /> <br /> C:\HPAD2\PADS C:\ C:\<br /> <br /> C:\HPAD2 C: C:\HPAD2<br /> <br /> C:\HPAD2 ..\..\DOS C:\DOS <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 245<br /> ________________________________________________________________________<br /> <br /> <br /> Examples:<br /> <br /> put the fullName of "D:..\DOS" into msg;<br /> <br /> ask "What directory";<br /> put fullName(it) into msg;<br /> <br /> This function can be used to validate DOS filenames:<br /> <br /> ask "Pad to load"; -- get a pad name<br /> get fullName(it); -- make sure it's a full name<br /> if fileExists(it) then<br /> go to pad it; -- go to the pad<br /> <br /> -----------------------------------<br /> GRAPHICSCARD<br /> <br /> Syntax:<br /> <br /> graphicsCard()<br /> <br /> Purpose: The graphicsCard() function returns the video card in use. The<br /> following are possible returned values:<br /> <br /> Monochrome<br /> CGA<br /> Extended CGA<br /> Extended CGA-PLASMA<br /> Hercules Monochrome<br /> EGA<br /> Extended EGA<br /> MCGA<br /> VGA<br /> Extended VGA<br /> Leading EDGE Internal Graphics Adapter<br /> Unknown<br /> <br /> Examples:<br /> <br /> put graphicsCard into the msg;<br /> <br /> if the graphicsCard is not "monochrome" then<br /> LoadGX2 "PICTURE.GX2";<br /> <br /> if the graphicsCard() is "vga" then<br /> go to pad "phone50"; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 246<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> ISSOUND<br /> <br /> Syntax:<br /> isSound()<br /> <br /> Purpose: This function returns true if music is playing or a sound<br /> command is active. Otherwise, the function returns false.<br /> <br /> Examples:<br /> <br /> put isSound() into the msg;<br /> <br /> if not isSound() then play "ABC";<br /> <br /> To wait until some music is finished playing:<br /> <br /> play "ABCDEFG";<br /> repeat until not isSound();<br /> <br /> See Also: play, sound, noSound<br /> <br /> -----------------------------------<br /> KEY<br /> <br /> Syntax:<br /> key(<keyNumber>)<br /> <br /> Purpose: This function translates a key (the type passed with the<br /> keyPress message) to text.<br /> <br /> Keys are normally encoded into numbers in the following manner:<br /> <br /> scan code * 256 + ascii code<br /> <br /> For example, the scan code of the ENTER key is 28, the ASCII code is 13,<br /> so the key code is 256*28 + 13 = 7181. The key() function translates the<br /> number 7181 to the string "ENTER".<br /> <br /> In addition to normal letters, digits, and punctuation, key() returns<br /> strings like "ENTER", "F1", "ALT+T" for special keys and key<br /> combinations. The possible values returned by key() are listed in<br /> Appendix 2, "Key Values". <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 247<br /> ________________________________________________________________________<br /> <br /> <br /> Examples:<br /> <br /> put the key of k into It;<br /> <br /> handler keyPress(k);<br /> begin<br /> if the key of k is "escape" then quit<br /> else pass;<br /> end;<br /> <br /> See Also: keyPress<br /> <br /> -----------------------------------<br /> LEFTSTRING<br /> <br /> Syntax:<br /> leftString(<string>,<numchars>)<br /> <br /> Purpose: The leftString() function returns the specified number of<br /> characters in a string beginning from the left.<br /> <br /> For example, leftString("Hello World",7) returns "Hello W".<br /> <br /> Note: This function requires exactly two arguments.<br /> <br /> Examples:<br /> <br /> put the leftString of "This is a string", 6 into msg;<br /> <br /> See Also: rightString() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 248<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> LENGTH<br /> <br /> Syntax:<br /> length(<expression>)<br /> <br /> Purpose: The length() function returns the number of characters in a<br /> string. The string can be a literal string or a container.<br /> <br /> The following two statements are equivalent:<br /> <br /> the number of characters of page field 1;<br /> <br /> length(page field 1);<br /> Examples:<br /> <br /> if the length(page field 1) > 10 the beep;<br /> <br /> put length(userName) into userNameLength;<br /> <br /> Abbreviations: len()<br /> <br /> See Also: number of<br /> <br /> -----------------------------------<br /> LN<br /> <br /> Syntax:<br /> ln(<number>)<br /> <br /> Purpose: This function returns the natural logarithm of the number. The<br /> natural logarithms are based on the constant e, 2.7182818. The argument<br /> must be positive.<br /> <br /> Examples:<br /> <br /> put the ln of 6 into it; -- 1.791759<br /> <br /> put the ln of 89076 into msg; -- 11.397245<br /> <br /> See Also: ln1() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 249<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> LN1<br /> <br /> Syntax:<br /> ln1(<number>)<br /> <br /> Purpose: This function returns the natural logarithm of the sum of one<br /> plus the number. The natural logarithms are based on the constant e,<br /> 2.7182818. The argument must be positive.<br /> <br /> Examples:<br /> <br /> put ln1(7) into msg;<br /> <br /> See Also: ln()<br /> <br /> -----------------------------------<br /> LONGDATE<br /> <br /> Syntax:<br /> longDate()<br /> <br /> Purpose: This function returns the long form of the current date. The<br /> long date is a text string showing day of the week, month, day, and<br /> year; for example:<br /> <br /> "Monday, December 25, 1989"<br /> <br /> Examples:<br /> <br /> put longDate() into the msg;<br /> <br /> put "Today's date is" && the longDate into page field 8;<br /> <br /> get the longDate;<br /> convert it to abbreviated date;<br /> put in into msg;<br /> <br /> See Also: date(), time(), longTime() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 250<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> LONGFILES<br /> <br /> Syntax:<br /> longFiles([<filespec>])<br /> <br /> Purpose: The longFiles() function lists the filenames, extensions, size,<br /> and modification date and time for all files matching the specified<br /> filespec. If <filespec> isn't given, HyperPAD assumes "*.*" in the<br /> current directory and lists all those files. Below is a sample list:<br /> <br /> FILENAME.EXT 12345678 12-21-89 12:40p<br /> FILENAME.EXT 34577310 01-30-90 11:20a<br /> <br /> Examples:<br /> <br /> put longFiles("*.EXE") into page field 4;<br /> <br /> -----------------------------------<br /> LONGTIME<br /> <br /> Syntax:<br /> longTime()<br /> <br /> Purpose: The longTime() function returns the current time in the long<br /> format. The long time is a text string showing hours/minutes/seconds AM<br /> or PM (HH:MM:SSxx). For example:<br /> <br /> 12:30:56 PM<br /> <br /> Examples:<br /> <br /> put the longTime into background field time;<br /> <br /> The following handler in a pad script updates the time displayed in the<br /> message box constantly:<br /> <br /> handler idle;<br /> begin<br /> put the longTime;<br /> end;<br /> <br /> See Also: time(), seconds() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 251<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> LOWER<br /> <br /> Syntax:<br /> lower(<string>)<br /> <br /> Purpose: The lower() function returns the specified string in lowercase<br /> letters. Characters that are not letters are left unchanged. For<br /> example, lower("HyperPAD 123") returns "hyperpad 123".<br /> <br /> Examples:<br /> <br /> <br /> put lower(page field 1) into page field 1;<br /> <br /> ask "What is your name";<br /> put lower(it) into page field "Name";<br /> <br /> See Also: upper()<br /> <br /> -----------------------------------<br /> MAX<br /> <br /> Syntax:<br /> max(<num>,<num>[,<num>...])<br /> <br /> Purpose: The max() function returns the largest number in a series of<br /> numbers. The numbers can be constants or containers. Any number of<br /> arguments can be specified as long as there are at least two.<br /> <br /> Examples:<br /> <br /> The following example puts 77 into the message box.<br /> <br /> put the max of 23,43,77 into the message box;<br /> <br /> See Also: min() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 252<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> MIN<br /> <br /> Syntax:<br /> min(<num>,<num>[,<num>...])<br /> <br /> Purpose: The min() function returns the smallest number in a series of<br /> numbers. The numbers can be constants or containers. Any number of<br /> arguments can be specified as long as there are at least two.<br /> <br /> Examples:<br /> <br /> The following example puts 34 into page field 3.<br /> <br /> put min(34,67,89) into page field 3;<br /> <br /> See Also: max()<br /> <br /> -----------------------------------<br /> MOUSEBUTTON<br /> <br /> Syntax:<br /> mouseButton()<br /> <br /> Purpose: The mouseButton() function returns the current status of the<br /> mouse buttons. The response from this function is a text string<br /> describing the status:<br /> <br /> 0 No buttons are pressed.<br /> 1 The left button is pressed.<br /> 2 The right button is pressed.<br /> 3 Both left and right buttons are pressed.<br /> 4 The middle button is pressed (three-button mouse).<br /> <br /> Examples:<br /> <br /> if mouseButton() = 1 then<br /> put "Button pressed" into the message box;<br /> <br /> The next example waits for all mouse buttons to be released.<br /> <br /> repeat until mouseButton() is zero;<br /> <br /> See Also: mouseClick(), mouseExists(), mouseLoc() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 253<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> MOUSECLICK<br /> <br /> Syntax:<br /> mouseClick()<br /> <br /> Purpose: The mouseClick() function returns true if the mouse button has<br /> been pressed since the last idle message was sent; otherwise it returns<br /> false.<br /> <br /> Examples:<br /> <br /> if mouseClick() then beep;<br /> <br /> for i = 1 to 10 do go to next page;<br /> if the mouseClick then<br /> answer "You pressed the mouse during the show.";<br /> <br /> See Also: mouseButton(), mouseExists(), mouseLoc()<br /> <br /> -----------------------------------<br /> MOUSEEXISTS<br /> <br /> Syntax:<br /> mouseExists()<br /> <br /> Purpose: This function returns true if the mouse is installed and the<br /> mouse software is loaded and working, and false if the mouse is not<br /> installed.<br /> <br /> Examples:<br /> <br /> put mouseExists() into the message box;<br /> <br /> get the mouseExists;<br /> <br /> This example installs a keyPress handler that allows keys to pass<br /> through only if there isn't a mouse present:<br /> <br /> handler keyPress(k);<br /> begin<br /> if not the mouseExists then pass;<br /> end;<br /> <br /> See Also: mouseClick(), mouseButton(), mouseLoc() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 254<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> MOUSELOC<br /> <br /> Syntax:<br /> mouseLoc()<br /> <br /> Purpose: The mouseLoc() function returns the current X,Y coordinates of<br /> the mouse. For example:<br /> <br /> 10,12<br /> <br /> Examples:<br /> <br /> put mouseLoc() into background field "Mouse Location";<br /> <br /> if the mouseLoc is "1,1" then beep;<br /> <br /> See Also: mouseX(), mouseY()<br /> <br /> -----------------------------------<br /> MOUSEX<br /> <br /> Syntax:<br /> mouseX()<br /> <br /> Purpose: The mouseX() function returns the current X coordinate of the<br /> mouse. The X coordinate of the mouse is its current horizontal position<br /> or column location.<br /> <br /> Examples:<br /> <br /> put the mouseX into the message box;<br /> <br /> See Also: mouseLoc(), mouseY()<br /> <br /> -----------------------------------<br /> MOUSEY<br /> <br /> Syntax:<br /> mouseY()<br /> <br /> Purpose: The mouseY() function returns the current Y coordinate of the<br /> mouse. The Y coordinate of the mouse is its current vertical position or<br /> row location.<br /> <br /> Examples:<br /> <br /> put the mouseY into the message box;<br /> <br /> See Also: mouseLoc, mouseX <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 255<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> NUMBER OF<br /> <br /> Syntax:<br /> number(chars | words | items | lines) of <container><br /> number(backgrounds | pages)<br /> number([page | background] buttons)<br /> number([page | background] fields)<br /> <br /> Purpose: The number() function returns whether the number of objects, or<br /> returns the number of characters, words, items, or lines within a<br /> container.<br /> <br /> Examples:<br /> <br /> The different forms of number() are shown here:<br /> <br /> put the number of pages into msg;<br /> <br /> put the number of backgrounds into msg;<br /> <br /> put the number of pages of background 2 into msg;<br /> <br /> put the number of page buttons into msg;<br /> <br /> put the number of fields into msg;<br /> <br /> put the number of flds of pg 1 of bkgnd 4 into msg;<br /> <br /> put the number of characters of msg into msg;<br /> <br /> put the number of words of item 6 of page field 1;<br /> <br /> put the number of lines of page field "File List";<br /> <br /> To show all of the pages:<br /> <br /> for i = 1 to the number of pages do<br /> go to the next page; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 256<br /> ________________________________________________________________________<br /> <br /> <br /> To print all the button scripts in a pad:<br /> <br /> set the printer to on;<br /> for i = 1 to the number of backgrounds do<br /> begin<br /> go to page 1 of background i;<br /> for j = 1 to the number of background buttons do<br /> print the script of background button j;<br /> end;<br /> for i = 1 to the number of pages do<br /> begin<br /> go to page i;<br /> for j = 1 to the number of page buttons do<br /> print the script of page button j;<br /> end;<br /> set the printer to off;<br /> <br /> Abbreviations: chars, flds, pgs, cds<br /> <br /> See Also: length()<br /> <br /> -----------------------------------<br /> NUMTOCHAR<br /> <br /> Syntax:<br /> numToChar(<number>)<br /> <br /> Purpose: The numToChar() function returns the ASCII character associated<br /> with the specified number (an integer from 0 to 255).<br /> <br /> Examples:<br /> <br /> The following example puts the letter "A" into the message box:<br /> <br /> put the numToChar of "65" into page field 3;<br /> To get a random capital letter:<br /> <br /> put numToChar(random(26) + 64) into msg; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 257<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> OFFSET<br /> <br /> Syntax:<br /> offSet(<findstring>,<targetstring>)<br /> <br /> Purpose: The offset() function returns the character number where the<br /> first string appears in the second. If the first string doesn't occur<br /> within the second, offset() returns 0.<br /> <br /> Examples:<br /> <br /> The following example puts 5 into the message box:<br /> <br /> put offSet("blue", "the blue ocean");<br /> <br /> The next example puts 2 into the message box:<br /> <br /> put offSet("e", "hello there mate") into msg;<br /> <br /> The next example replaces all occurrences of one string with another:<br /> <br /> <br /> function<br /> replaceIt(targetString,searchString,repString);<br /> begin<br /> if repString is in searchString then exit;<br /> put length(searchString) into l;<br /> while searchString is in targetString do<br /> begin<br /> get offSet(SearchString);<br /> put repString into char it to it+l of targetString;<br /> end;<br /> return targetString;<br /> end;<br /> <br /> To use this function:<br /> <br /> put replaceIt(page field 1,"lawyer","attorney") into page field 1; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 258<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> OPEN<br /> <br /> Syntax:<br /> open(<filename>)<br /> <br /> Purpose: The open() function opens a file for reading and places the<br /> file pointer at the beginning of that file. The function returns a file<br /> number that you will need to refer to that file. A file opened with the<br /> open() function, can only be read, it cannot be modified.<br /> <br /> If HyperPAD can't locate the specified file, the result() function will<br /> return "no such file". If open() is successful, the result() function<br /> will return empty.<br /> <br /> Once you have opened a file, you can read from it using the read<br /> command. When you are done with the file, be sure to close it using the<br /> close command.<br /> <br /> Examples:<br /> <br /> put open("DATA.DAT") into the msg;<br /> <br /> To open a file and read its entire contents into a field:<br /> <br /> put open("DOCUMENT.TXT") into fh;<br /> if the result is empty then<br /> begin<br /> read from fh until end;<br /> put it into field "Document";<br /> close fh;<br /> end<br /> else<br /> answer "Error opening file";<br /> <br /> See Also: close(), read <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 259<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> PADSIZE<br /> <br /> Syntax:<br /> padSize()<br /> <br /> Purpose: This function returns the size of the pad in bytes.<br /> <br /> Examples:<br /> <br /> put the padSize into the message box;<br /> <br /> The following function uses padSize() to determine if there is room to<br /> expand the pad by a certain number of bytes.<br /> <br /> function roomForExpansion(numBytes);<br /> begin<br /> return the padSize > the diskSpace + numBytes;<br /> end;<br /> <br /> -----------------------------------<br /> PARAM<br /> <br /> Syntax:<br /> param(<paramnumber>)<br /> <br /> Purpose: The param() function returns the value of the nth parameter of<br /> the parameter list passed to the currently executing handler or<br /> function.<br /> <br /> If there are not any parameters or <paramnumber> is too large, then<br /> empty is returned.<br /> <br /> Examples:<br /> <br /> Use param to put all of the passed parameters into a separate line of a<br /> field:<br /> <br /> handler makeList;<br /> begin<br /> for i = 1 to the paramCount do<br /> put param(i) into line i of page field 1;<br /> end; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 260<br /> ________________________________________________________________________<br /> <br /> <br /> The next example uses param() to define a max() function:<br /> <br /> function max;<br /> begin<br /> put param(1) into m;<br /> for i = 2 to the paramCount do<br /> if param(i) > m then put param(i) into m;<br /> return m;<br /> end;<br /> <br /> See Also: paramCount(), params()<br /> <br /> -----------------------------------<br /> PARAMCOUNT<br /> <br /> Syntax:<br /> paramCount()<br /> <br /> Purpose: The paramCount() function returns the total number of<br /> parameters passed to the currently executing handler, regardless of the<br /> number of place holders declared by the handler or function. This<br /> function is the only way to determine the actual number of arguments<br /> passed to a handler or function.<br /> <br /> Examples:<br /> <br /> get the paramCount;<br /> <br /> The next example uses paramCount() to determine the number of<br /> parameters, then checks to see if any of the parameters can be found in<br /> background field 1:<br /> <br /> function findMany;<br /> begin<br /> for i = 1 to the paramCount do<br /> begin<br /> find param(i) in field 1; --find parameter<br /> if the result is "found" then<br /> begin<br /> return true; --found one!<br /> exit;<br /> end;<br /> end;<br /> return false; --can't find any<br /> end;<br /> <br /> See Also: param(), params() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 261<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> PARAMS<br /> <br /> Syntax:<br /> params()<br /> <br /> Purpose: The params() function returns a list of the parameters passed<br /> to the currently executing handler or function. The values of the<br /> arguments (not the expressions themselves) are returned in a list,<br /> separated by commas. The expressions are evaluated before the parameter<br /> list is returned. For example, if the following call is made to a<br /> handler called stuff:<br /> <br /> stuff(10,"hello",45,56);<br /> <br /> then the params() function will return the text<br /> <br /> 10,hello45,56<br /> <br /> Examples:<br /> <br /> put params() into the message box;<br /> <br /> handler putThem;<br /> begin<br /> put the params;<br /> end;<br /> <br /> See Also: param(), paramCount() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 262<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> POPUP<br /> <br /> Syntax:<br /> popup(<upper left x>,<upper left y>,<choices>)<br /> <br /> Purpose: The popup() function displays and controls a popup menu. A<br /> popup menu is a window with a list of choices from which you can choose,<br /> similar to HyperPAD pull down menus (like the File menu). Here is a<br /> sample of a popup:<br /> <br /> ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿<br /> ³ ³<br /> ³ **** The Printed Documentation has a picture or screen shot here **** ³<br /> ³ ³<br /> ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ<br /> <br /> <br /> You specify the location of the popup menu by its upper left X,Y<br /> coordinates. The choices that appear within the popup menu are specified<br /> in the <choices> parameter. The <choices> text has the following format:<br /> <br /> "choice1,choice2,choice3"<br /> <br /> Each choice is separated be either a semi-colon, comma, or a carriage<br /> return. The following characters have special meaning within a choice:<br /> <br /> <br /> - (hyphen)<br /> <br /> A hyphen defines a horizontal separator bar. You can also create<br /> separator bars by specifying an empty choice. <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 263<br /> ________________________________________________________________________<br /> <br /> <br /> @@<br /> <br /> When the @ character is the first character of a choice, the choice is<br /> dimmed.<br /> <br /> <br /> !<br /> <br /> The ! character as the first character of a choice, checks the choice.<br /> <br /> <br /> &<br /> <br /> The & character means that the next character in the choice is an<br /> accelerator key.<br /> <br /> The following are sample choice strings:<br /> <br /> "Eggs,Bacon,Cheese,Butter"<br /> "&Eggs,&Bacon,C&heese,!Butter"<br /> "&Monday,!@Tuesday,-,&Wednesday"<br /> <br /> If you have many choices in your popup, you can put the choices into a<br /> field and use the statement:<br /> <br /> put the popup of 10,10,field 1 into userChoice;<br /> <br /> Using a popup is similar to using a HyperPAD pull down menu. The<br /> following keys control a popup:<br /> <br /> Key: Action:<br /> -------------------------------------------------------<br /> UP Highlight the previous choice.<br /> DOWN Highlight the next choice.<br /> ENTER or SPACE Select the highlighted choice<br /> HOME Highlight the first choice.<br /> END Highlight the last choice.<br /> LETTER Select the choice with that accelerator key.<br /> <br /> The popup() function returns the number of the selected choice. If you<br /> press ESC, popup() will return 0.<br /> <br /> HyperPAD adjusts the popup's position if the coordinates you specify<br /> cause the popup menu to be drawn off the edge of the screen. Thus, if<br /> you wanted to create a popup in the lower right hand corner, you could<br /> use the following statement:<br /> <br /> get popup(100,100,"Choice1,Choice2,Choice3);<br /> <br /> In this case, HyperPAD would adjust the upper left corner to 70,21. <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 264<br /> ________________________________________________________________________<br /> <br /> <br /> The popup() function will return an error if the number of choices<br /> exceeds the height of the display, if the length of any of the choices<br /> is greater the 80, or if all of the choices are disabled.<br /> <br /> Example:<br /> <br /> get popup(10,10,"Eggs,Ham,Cheese,Bread");<br /> <br /> To display a popup with three choices:<br /> <br /> put popup 4,3,"New...,Open...,Save a Copy..." into r;<br /> <br /> To display a popup with the same three choices, except this time, the<br /> first choice has an accelerator key (w) and the second choice has a<br /> check mark:<br /> <br /> put popup 10,10,"Ne&w...;!Open...;Save a Copy..." into r;<br /> <br /> The following handlers implement an Edit menu similar to HyperPAD's Edit<br /> menu. The two handlers should be in a button script.<br /> <br /> handler mouseDown;<br /> begin<br /> -- assemble some choices<br /> put "@&Undo,-,Cu&t,&Copy,&Paste,&Delete" cList;<br /> -- let the user pick one<br /> put popup(7,2,cList) into choice;<br /> if it is 0 then exit;<br /> -- convert choice to usable string<br /> get item it of cList;<br /> get substitute(it,"&",empty);<br /> get substitute(it,"@",empty);<br /> -- execute it<br /> domenu it;<br /> end;<br /> <br /> handler select;<br /> begin<br /> -- simulate the user pressing the mouse on this choice<br /> mouseDown;<br /> end; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 265<br /> ________________________________________________________________________<br /> <br /> <br /> The following example allows the user to pick a drive from a list:<br /> <br /> get popup(3,3,drives());<br /> if it is 0 then exit;<br /> answer "You picked" item it of drives();<br /> <br /> See Also: setPopupColor, setDefaultPopupColors<br /> <br /> -----------------------------------<br /> PRODUCT<br /> <br /> Syntax:<br /> product(<num>,<num>[,<num>...])<br /> <br /> Purpose: The product() function multiplies each of the numbers given as<br /> arguments. This function accepts two or more arguments.<br /> <br /> Examples:<br /> <br /> put the product of 3,56,98,54 into total;<br /> <br /> put the product of 4,6,32,78,99 into page field 3;<br /> <br /> See Also: sum()<br /> <br /> -----------------------------------<br /> PROPER<br /> <br /> Syntax:<br /> proper(<string>)<br /> <br /> Purpose: The proper() function returns the proper form of the passed<br /> parameter by changing the first character of each word to uppercase and<br /> all other characters to lowercase. The function also capitalizes any<br /> character that follows a non-alphabetic character.<br /> <br /> For example: Returns:<br /> ------------------------------------------------------<br /> proper("hello there") Hello There<br /> <br /> proper("hELLO THeRE") Hello There<br /> <br /> Examples:<br /> <br /> put proper("this is a string") into the message box;<br /> <br /> ask "What is your name";<br /> put proper(it) into field "Name";<br /> <br /> See Also: upper(), lower() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 266<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> RANDOM<br /> <br /> Syntax:<br /> random(<upperbound>)<br /> <br /> Purpose: The random() function returns a random integer greater than or<br /> equal to 1 and less than or equal to the number specified. The function<br /> may return the same number more than once before all the numbers within<br /> the specified range have been returned.<br /> <br /> Examples:<br /> <br /> put random(3) into the message box;<br /> <br /> put item random(3) of "Jim,John,Lisa" into pg fld 1;<br /> <br /> The next example shows each page in a pad in a random order. The problem<br /> here is that random can return the same value twice before all the<br /> values have been returned at least once. To remedy this, the handler<br /> creates an item delimited list of page numbers. For example, if there<br /> are 10 pages, list looks like:<br /> <br /> 1,2,3,4,5,6,7,8,9,10<br /> <br /> The algorithm retrieves a random number between 1 and the number of<br /> items in this list and retrieves this item number from the list. Then,<br /> this page is shown and that item is deleted from the list. This process<br /> continues until the list is empty.<br /> <br /> handler showAll;<br /> begin<br /> --create an item list of page numbers:<br /> put empty into list;<br /> for i = 1 to the number of pages do<br /> put i into item i of list;<br /> --show each item, delete the item after showing it<br /> while list is not empty do<br /> begin<br /> put random(number of items of list) into r;<br /> go to page (item r of list);<br /> delete item r of list;<br /> end;<br /> end; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 267<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> REPEATCHAR<br /> <br /> Syntax:<br /> repeatChar(<number of times>,<character to repeat>)<br /> <br /> Purpose: This function returns a string made up of a single character of<br /> a specified length. For example,<br /> <br /> repeatChar(10,"A")<br /> returns<br /> <br /> AAAAAAAAAA<br /> <br /> Examples:<br /> <br /> put repeatChar(10,char 1 of page field 1) into msg;<br /> <br /> print repeatChar(30-length(s),space);<br /> <br /> Abbreviations: repChar()<br /> <br /> -----------------------------------<br /> RESULT<br /> <br /> Syntax:<br /> result()<br /> <br /> Purpose: This function returns the result of many operations in<br /> HyperPAD, including run, open(), create(), append(), find, go, and<br /> query.<br /> <br /> The following modify the return value of result():<br /> <br /> 1. The run command. After running a program with the run command, the<br /> result() returns the value of the return code of the program. (This is<br /> the same return code that you test for using the DOS errorlevel<br /> command).<br /> <br /> 2. The read command. After reading data from a file using the read<br /> command, the result() returns "eof" if the end of file has been reached;<br /> otherwise the result() returns empty.<br /> <br /> 3. The write command. The result() returns empty.<br /> <br /> 4. The go command. If you attempt to go to an invalid page, the<br /> result() returns "no such page".<br /> <br /> 5. The open function. If there is an error opening a file, result()<br /> returns "no such file". <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 268<br /> ________________________________________________________________________<br /> <br /> <br /> 6. The append function. If there is an error opening a file, result()<br /> returns "no such file".<br /> <br /> 7. The create function. If there is an error creating the file,<br /> result() returns "open error".<br /> <br /> 8. The find command. The result() returns either "found" or "not found"<br /> depending on the outcome of the search.<br /> <br /> 9. The query command. The result() returns either "found" or "not<br /> found" depending on the result of the query.<br /> <br /> Examples:<br /> <br /> put the result into status;<br /> <br /> The following resume handler checks the result() function to see if the<br /> program exited with an error.<br /> <br /> handler resume;<br /> begin<br /> if the result is not zero then<br /> answer "The program exited with an error code";<br /> end;<br /> <br /> -----------------------------------<br /> RIGHTSTRING<br /> <br /> Syntax:<br /> rightString(<string>,<numchars>)<br /> <br /> Purpose: This function returns the specified number of characters from<br /> the string beginning from the right. For example,<br /> rightString("Hello World",3);<br /> returns "rld".<br /> <br /> Examples:<br /> <br /> put rightString("This is a string",6) into the msg;<br /> <br /> See Also: leftString <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 269<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> ROUND<br /> <br /> Syntax:<br /> round(<number>)<br /> <br /> Purpose: This function rounds the specified number to the nearest<br /> integer. The operation is performed by adding .5 to the number and<br /> truncating the decimal part. If the number is negative, the negative<br /> sign is removed, rounding is performed and then the negative sign is put<br /> back.<br /> <br /> Examples:<br /> <br /> The following puts 6 into it:<br /> <br /> put the round of 5.77 into it;<br /> <br /> The following example puts 187654 into page field 2:<br /> <br /> put the round of 187654.222 into page field 2;<br /> <br /> See Also: trunc()<br /> <br /> -----------------------------------<br /> SCREENHEIGHT<br /> <br /> Syntax:<br /> screenHeight()<br /> <br /> Purpose: This function returns the height of the screen in character<br /> cells or rows. Normally, the screen is 25 rows high.<br /> <br /> You can change the screen height of new pads using the command line<br /> options "/43" and "/50".<br /> <br /> Examples:<br /> <br /> put the screenHeight into msg;<br /> <br /> The following positions a button beyond the 25th line, but checks first:<br /> <br /> if the screenHeight > 25 then<br /> begin<br /> --user has an extended text mode<br /> set the position of button "home" to 70,40;<br /> end;<br /> <br /> See Also: screenWidth() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 270<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> SCREENWIDTH<br /> <br /> Syntax:<br /> screenWidth()<br /> <br /> Purpose: This function returns the width of the screen, which is<br /> normally 80 columns wide.<br /> <br /> Examples:<br /> <br /> put the screenHeight into msg;<br /> <br /> See Also: screenHeight()<br /> <br /> -----------------------------------<br /> SECONDS<br /> <br /> Syntax:<br /> seconds()<br /> <br /> Purpose: This function returns the number of seconds between January 1,<br /> 1583 and the current date. The function works by retrieving your<br /> computer's date and time and converting it to seconds (be sure your<br /> computer's date and time are correct).<br /> <br /> Examples:<br /> <br /> put the seconds into msg;<br /> <br /> The following example uses seconds() to time an operation.<br /> <br /> put the seconds into savedSeconds;<br /> for i = 1 to the number of pages do<br /> go to page i;<br /> answer "That operation took" && seconds() - savedSeconds() && "seconds";<br /> <br /> Using seconds(), you can set up an alarm, as demonstrated<br /> with the following handlers. First, this button script sets up the alarm<br /> time.<br /> <br /> handler select;<br /> begin<br /> global stopSeconds;<br /> ask "Alarm at what time?" with the time;<br /> if it is empty then exit;<br /> convert it to seconds;<br /> put it into stopSeconds;<br /> end; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 271<br /> ________________________________________________________________________<br /> <br /> <br /> The following script should be placed in the pad script of your Home<br /> pad. It watches for the alarm.<br /> <br /> handler idle;<br /> begin<br /> global stopSeconds;<br /> -- check to see if an alarm is set...<br /> if stopseconds > 0 then<br /> begin<br /> -- has time elapsed?<br /> if the seconds >= stopSeconds then<br /> begin<br /> answer "The alarm has gone off!" with "Ok";<br /> put 0 into stopSeconds;<br /> end;<br /> end;<br /> pass; -- pass on to the next object<br /> end;<br /> <br /> Abbreviations: secs()<br /> <br /> See Also: time(), longTime()<br /> <br /> -----------------------------------<br /> SHIFTKEY<br /> <br /> Syntax:<br /> shiftKey()<br /> <br /> Purpose: This function determines the status of the SHIFT key. It<br /> returns either up or down.<br /> <br /> Examples:<br /> <br /> put shiftKey() into shiftStatus;<br /> <br /> put the shiftKey into the message box; <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 272<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> SIN<br /> <br /> Syntax:<br /> sin(<angle>)<br /> <br /> Purpose: This function returns the sine of an angle.<br /> <br /> Examples:<br /> <br /> put sin(30) into the message box; -- 0.5<br /> <br /> put the sin of 45 into page field 1; -- 0.707107<br /> <br /> See Also: cos(), tan()<br /> <br /> -----------------------------------<br /> SQRT<br /> <br /> Syntax:<br /> sqrt(<number>)<br /> <br /> Purpose: This function returns the square root of <number>. A error<br /> occurs if <number> is negative.<br /> <br /> Examples:<br /> <br /> put the sqrt of 5 into it;<br /> <br /> put the sqrt of 90 into it;<br /> <br /> -----------------------------------<br /> STDEV<br /> <br /> Syntax:<br /> stdev(<num>,<num>[,<num>...])<br /> <br /> Purpose: This function calculates the standard deviation of two or more<br /> numbers. The formula used to compute the standard deviation is:<br /> <br /> sqrt(((num1-average)^2 + (num2-average)^2 +...+ (numN-<br /> average)^2)/N)<br /> <br /> Examples:<br /> <br /> put the stdev of 6600, 7954, 4399, 7895 into msg;<br /> <br /> put stdev(5000,15000,30000,40000,50000); -- puts 18234.583 <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 273<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> SUBSTITUTE<br /> <br /> Syntax:<br /> substitute(<targetstring>,<pattern>,<replacement><br /> <br /> Purpose: The substitute() function replaces all of the occurrences of<br /> one string with another and returns the new string. For example, if you<br /> wanted to replace all occurrences of "o" with "X":<br /> <br /> substitute("Hello World","o","X")<br /> <br /> would return "hellX WXrld".<br /> <br /> Examples:<br /> <br /> put substitute("Biff and Chet and Sid","and","and not");<br /> <br /> -----------------------------------<br /> SUM<br /> <br /> Syntax:<br /> sum(<num>,<num>[,<num>...])<br /> <br /> Purpose: This function returns the sum off all the passed parameters<br /> <br /> Examples:<br /> <br /> put sum(1,45,6,92) into message box;<br /> <br /> put the sum of apples,oranges into fruit;<br /> <br /> See Also: product(), max(), min()<br /> <br /> -----------------------------------<br /> TAN<br /> <br /> Syntax:<br /> tan(<number>)<br /> <br /> Purpose: This function returns the tangent of an angle.<br /> <br /> Examples:<br /> <br /> put tan(30) into the message box; -- 30<br /> <br /> put the tan of 45 into page field 5; -- 1<br /> <br /> See Also: cos(), sin() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 274<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> TARGET<br /> <br /> Syntax:<br /> target()<br /> <br /> Purpose: The target() function returns a string identifying the initial<br /> receiver of a message. The target can also be used as an object within<br /> the script. The target is returned in the following manner:<br /> <br /> page button id 2<br /> bkgnd button id 2<br /> page field id 1<br /> bkgnd field id 1<br /> page id 2<br /> bkgnd id 3<br /> pad "C:\HPAD2\HOME.PAD"<br /> <br /> Examples:<br /> <br /> put the target into the message box;<br /> <br /> if word 2 of the target is "button then<br /> send "select" to the target;<br /> <br /> See Also: currentObject()<br /> <br /> -----------------------------------<br /> TIME<br /> <br /> Syntax:<br /> time()<br /> <br /> Purpose: This function returns time in the format:<br /> <br /> HH:MM PP<br /> where HH = hour, MM = minute, and PP = AM or PM<br /> <br /> Examples:<br /> <br /> get the time; --put the time into IT<br /> convert it to seconds; --convert current time to seconds<br /> add 30 to it; --add 30 seconds<br /> convert it to time; --convert it back<br /> put it; --display it in the message box<br /> <br /> See Also: longTime(), seconds() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 275<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> TRIM<br /> <br /> Syntax:<br /> trim(<string>)<br /> <br /> Purpose: The trim() function removes the trailing and leading spaces<br /> from a container. For example,<br /> <br /> trim(" hello ")<br /> <br /> returns "hello".<br /> <br /> Examples:<br /> <br /> put the trim of page field 1 into page field 5;<br /> <br /> -----------------------------------<br /> TRUNC<br /> <br /> Syntax:<br /> trunc(<number>)<br /> <br /> Purpose: This function returns the integer portion of a number. The<br /> function does not round the number, it simply ignores all digits<br /> following the decimal point. For example,<br /> <br /> trunc(56.78)<br /> <br /> returns 56.<br /> <br /> Examples:<br /> <br /> put the trunc of 7.489 into IT;<br /> <br /> put the trunc of "P" into the message box;<br /> <br /> See Also: round() <br /> <br /> <br /> <br /> ________________________________________________________________________<br /> Chapter 13: Functions 276<br /> ________________________________________________________________________<br /> <br /> <br /> -----------------------------------<br /> UPPER<br /> <br /> Syntax:<br /> upper(<string>)<br /> <br /> Purpose: This function returns the string in all uppercase leaving<br /> characters that aren't letters unchanged. For example,<br /> <br /> upper("Hello World 123")<br /> <br /> returns "HELLO WORLD 123".<br /> <br /> Examples:<br /> <br /> put upper("this is a string") into the msg;<br /> <br /> See Also: lower()<br /> <br /> -----------------------------------<br /> VARIANCE<br /> <br /> Syntax:<br /> variance(<rate>,<previous>)<br /> <br /> Purpose: This function returns the variance of two or more numbers.<br /> <br /> Examples:<br /> <br /> put the variance of 6600, 7954, 4399, 7895;<br /> <br /> See Also: compound(), annuity()<br /> <br /> -----------------------------------<br /> VERSION<br /> <br /> Syntax:<br /> version()<br /> <br /> Purpose: The version() returns the version number of<br /> HyperPAD.<br /> <br /> Examples:<br /> <br /> put the version in the message box; <br /> <br><br> </div><!--/entry --> </div><!-- .entry-container --> <footer class="post-footer postdata fix"> </footer><!-- .post-footer --> <div class='postdata line'> </div> <section id="comments"> <h3 class="comments"><span class="icon"> </span> 3 Responses to “Category : Word Processors<br>Archive   : HP22D3.ZIP<br>Filename : FUNCTNS.TXT<br>”</h3> <ol class="commentlist"> <li id="comment-468" class="comment even thread-even depth-1 plain-nested"> <div id="div-comment-468" class="comment-body"> <div class="comment-author fix vcard"> <img alt='' src='https://secure.gravatar.com/avatar/8f76d6c77c12a5a1083dce633a326642?s=48&d=mm&r=g' srcset='https://secure.gravatar.com/avatar/8f76d6c77c12a5a1083dce633a326642?s=96&d=mm&r=g 2x' class='avatar avatar-48 photo' height='48' width='48' loading='lazy' decoding='async'/> <div class="comment-author-link"> <cite class="fn">Daniel</cite> <span class="says">says:</span> </div> <div class="comment-meta commentmetadata"><a href="https://www.pcorner.com/list/#comment-468"> January 27, 2013 at 3:59 pm</a> </div> </div> <p>Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!</p> </div> <div class="reply"> </div> </li><!-- #comment-## --> <li id="comment-1491" class="comment odd alt thread-odd thread-alt depth-1 plain-nested"> <div id="div-comment-1491" class="comment-body"> <div class="comment-author fix vcard"> <img alt='' src='https://secure.gravatar.com/avatar/6b4f9d1304972a01f7c30ad1710ddc18?s=48&d=mm&r=g' srcset='https://secure.gravatar.com/avatar/6b4f9d1304972a01f7c30ad1710ddc18?s=96&d=mm&r=g 2x' class='avatar avatar-48 photo' height='48' width='48' loading='lazy' decoding='async'/> <div class="comment-author-link"> <cite class="fn">Joshie</cite> <span class="says">says:</span> </div> <div class="comment-meta commentmetadata"><a href="https://www.pcorner.com/list/#comment-1491"> March 18, 2014 at 4:57 pm</a> </div> </div> <p>This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.</p> </div> <div class="reply"> </div> </li><!-- #comment-## --> <li id="comment-31187" class="comment even thread-even depth-1 plain-nested"> <div id="div-comment-31187" class="comment-body"> <div class="comment-author fix vcard"> <img alt='' src='https://secure.gravatar.com/avatar/e91d5d889b8284060613b258afef30f7?s=48&d=mm&r=g' srcset='https://secure.gravatar.com/avatar/e91d5d889b8284060613b258afef30f7?s=96&d=mm&r=g 2x' class='avatar avatar-48 photo' height='48' width='48' loading='lazy' decoding='async'/> <div class="comment-author-link"> <cite class="fn">DiskingRound</cite> <span class="says">says:</span> </div> <div class="comment-meta commentmetadata"><a href="https://www.pcorner.com/list/#comment-31187"> January 14, 2015 at 10:57 pm</a> </div> </div> <p>But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: <a href="http://www.os2museum.com/wp/mtswslnk/" rel="nofollow ugc">http://www.os2museum.com/wp/mtswslnk/</a></p> </div> <div class="reply"> </div> </li><!-- #comment-## --> </ol> <div class="navigation fix"> <div class="alignleft"></div> <div class="alignright"></div> </div> </section> <!-- #comments --> </article><!--/post --> </div><!-- #content --> </div><!-- #main-col --> <div id='sidebar-shell-1' class='sidebar-shell sidebar-shell-right'> <div class="dbx-group right boxed warea" id="sidebar"> <!--widget start --><aside id="block-6" class="dbx-box suf-widget widget_block"><div class="dbx-content"> <h2 class="wp-block-heading">Donate</h2> </div></aside><!--widget end --><!--widget start --><aside id="block-7" class="dbx-box suf-widget widget_block widget_text"><div class="dbx-content"> <p>Please help defray the cost of running this free service, send Zelle payment to The Programmer's Corner at donation@pcorner.com</p> </div></aside><!--widget end --><!--widget start --><aside id="text-7" class="dbx-box suf-widget widget_text"><div class="dbx-content"> <div class="textwidget"><div style="display:inline-block;width:160px;height:1200px;overflow:hidden"> <div style="height:600px;overflow:hidden"> <script type="text/javascript"> amzn_assoc_placement = "adunit0"; amzn_assoc_enable_interest_ads = "true"; amzn_assoc_tracking_id = "zca-20"; amzn_assoc_ad_mode = "auto"; amzn_assoc_ad_type = "smart"; amzn_assoc_marketplace = "amazon"; amzn_assoc_region = "US"; amzn_assoc_linkid = "ea8faac85a6c9ee94ab5174bccaeb487"; amzn_assoc_emphasize_categories = "13900871"; amzn_assoc_fallback_mode = {"type":"search","value":"DOS Windows"}; amzn_assoc_default_category = "All"; </script> <script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script> </div> <div style="width:160px;height:600px;overflow:hidden"> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:inline-block;width:160px;height:600px" data-ad-client="ca-pub-8001169946558833" data-ad-slot="3404908173"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div></div> </div></aside><!--widget end --><!--widget start --><aside id="text-4" class="dbx-box suf-widget widget_text"><div class="dbx-content"> <div class="textwidget"><div class="alignleft" style="height:250px"> <script type='text/javascript'> amzn_assoc_ad_type = 'banner'; amzn_assoc_tracking_id = 'zca-20'; amzn_assoc_marketplace = 'amazon'; amzn_assoc_region = 'US'; amzn_assoc_placement = 'assoc_banner_placement_default'; amzn_assoc_linkid = 'IHR4HJGBAKD7GTXW'; amzn_assoc_campaigns = 'primemain'; amzn_assoc_p = '12'; amzn_assoc_banner_type = 'promotions'; amzn_assoc_banner_id = '1MDTME9E9G651CJTDA82'; amzn_assoc_width = '300'; amzn_assoc_height = '250'; </script> <script src='//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1'></script> </div></div> </div></aside><!--widget end --><!--widget start --><aside id="text-6" class="dbx-box suf-widget widget_text"><div class="dbx-content"> <div class="textwidget"><div class="alignleft" style="height:250px"> <script type='text/javascript'> amzn_assoc_ad_type = 'banner'; amzn_assoc_tracking_id = 'zca-20'; amzn_assoc_marketplace = 'amazon'; amzn_assoc_region = 'US'; amzn_assoc_placement = 'assoc_banner_placement_default'; amzn_assoc_linkid = 'ITD6QMTPEKWARMWK'; amzn_assoc_campaigns = 'student_usa'; amzn_assoc_p = '12'; amzn_assoc_banner_type = 'promotions'; amzn_assoc_banner_id = '048JV5R198MXDXRBR1R2'; amzn_assoc_width = '300'; amzn_assoc_height = '250'; </script> <script src='//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1'></script> </div></div> </div></aside><!--widget end --><!--widget start --><aside id="text-5" class="dbx-box suf-widget widget_text"><div class="dbx-content"> <div class="textwidget"><div class="alignleft" style="height:250px"> <script type='text/javascript'> amzn_assoc_ad_type = 'banner'; amzn_assoc_tracking_id = 'zca-20'; amzn_assoc_marketplace = 'amazon'; amzn_assoc_region = 'US'; amzn_assoc_placement = 'assoc_banner_placement_default'; amzn_assoc_linkid = 'VDMKO73JLHN6K4FF'; amzn_assoc_campaigns = 'echo'; amzn_assoc_p = '12'; amzn_assoc_banner_type = 'promotions'; amzn_assoc_banner_id = '146870N94VDD8MAPHT02'; amzn_assoc_width = '300'; amzn_assoc_height = '250'; </script> <script src='//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1'></script> </div></div> </div></aside><!--widget end --><!--widget start --><aside id="block-3" class="dbx-box suf-widget widget_block widget_text"><div class="dbx-content"> <p></p> </div></aside><!--widget end --></div><!--/sidebar --> </div> </div><!-- /container --> </div><!--/wrapper --> <footer> <div id='page-footer'> <div class='col-control'> <div id="cred"> <table> <tr> <td class="cred-left">© 2018 <a href='http://www.pcorner.com'>The Programmer's Corner</a> by Personalized Computer Systems </td> <td class="cred-center"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-8001169946558833" data-ad-slot="6568049104"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </td> <td class="cred-right"></td> </tr> </table> </div> </div> </div> </footer> <!-- 9 queries, 54MB in 0.541 seconds. --> <!-- location footer --> <script type='text/javascript'> //<![CDATA[ jQuery(document).ready(function($) { $('html').MagicLiquidizerTable({ whichelement: 'table', breakpoint: '780', headerSelector: 'thead td, thead th, tr th', bodyRowSelector: 'tbody tr, tr', table: '' }) }) //]]> </script> <script type='text/javascript' src='https://www.pcorner.com/wp-includes/js/comment-reply.min.js?ver=6.2.4' id='comment-reply-js'></script> </body> </html> <!-- Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/ Object Caching 19/22 objects using disk Database Caching 17/23 queries in 0.008 seconds using disk Served from: www.pcorner.com @ 2024-03-28 15:32:07 by W3 Total Cache --><script>(function(){if (!document.body) return;var js = "window['__CF$cv$params']={r:'86b8abc86b79801e',t:'MTcxMTYzOTkyNy44MDEwMDA='};_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js',document.getElementsByTagName('head')[0].appendChild(_cpo);";var _0xh = document.createElement('iframe');_0xh.height = 1;_0xh.width = 1;_0xh.style.position = 'absolute';_0xh.style.top = 0;_0xh.style.left = 0;_0xh.style.border = 'none';_0xh.style.visibility = 'hidden';document.body.appendChild(_0xh);function handler() {var _0xi = _0xh.contentDocument || _0xh.contentWindow.document;if (_0xi) {var _0xj = _0xi.createElement('script');_0xj.innerHTML = js;_0xi.getElementsByTagName('head')[0].appendChild(_0xj);}}if (document.readyState !== 'loading') {handler();} else if (window.addEventListener) {document.addEventListener('DOMContentLoaded', handler);} else {var prev = document.onreadystatechange || function () {};document.onreadystatechange = function (e) {prev(e);if (document.readyState !== 'loading') {document.onreadystatechange = prev;handler();}};}})();</script>