The Built-in Routines



ABS( n )
Returns the absolute value of n.
ACOS( n )
Returns the arccos of n.


ARGV( n )
Returns the value of parameter n.


ASC( string )
Returns the ASCII value of the first character in string.


ASIN( n )
Returns the arcsin value of n.


ARCTAN( n )
Returns the arctangent value of n.


CHDIR( directoryName )
Not currently implemented


CHR( n )
Returns a string representation of the ASCII value n.


COMMAND( n )
Returns the value of parameter n passed from the command line.


CONCAT( string1, string2 )
Returns string1 joined to string2.


CONNECT( object, [id, ] eventType, routineName )
When event is triggered in object, causes routineName to be triggered.


COS( n )
Returns the cosine of n.


DATE()
Returns the current data in MM-DD-YYYY format.


DIR()
Not currently implemented.


DIREXISTS( name )
Not currently implemented.


DISCONNECT( object, [id, ] eventType )
Removes any callback for attached to object for eventType. See CONNECT().


EOF( fileHandle )
Returns nonzero if fileHandle is not at the end of the file.:


EXP( n )
Returns the exponent of n.


FCLOSE( fileHandle )
Closes fileHandle. Same as CLOSE #fileHandle.


FGETS( fileHandle )
Returns next line of text from fileHandle.


FOPEN( fileName, modeString )
Opens file fileName in "r" (read), "w" (write) or "a" (append) mode.


FPUTS( fileHandle, string )
Write string to fileHandle.


FILEEXISTS( fileName )
Returns nonzero if file exists.


FIX( n )
Truncates fractional number, rounding down towards zero.


FORMAT( formatString, ... )
Not yet implemented.


FRAC( n )
Returns fractional portion of n.


FREEFILE( n )
Returns next free handle number.


GETWXAPP( n )
Not yet implemented.


GETWXHANDLE( handle )
Not yet implemented.


HEX( n )
Returns hexidecimal representation of n.


INDEXES( arrayName )
Returns number of indexes in arrayName.


INSERT( targetString, subString, position )
Not yet implemented.


INSTR( [startPosition, ] searchString, searchForString )
Returns position of searchForStringin searchString, or 0 if not found.


INT( n )
Convert n to a 32 bit integer, truncating fractional portion.


KILL( fileName )
Delete fileName.


LCASE( string )
Returns string in lower case.


LEFT( string, length )
Returns the length leftmost characters in string.


LEN( string )
LENGTH( string )
Returns the length of string.


LOC( fileHandle )
Returns the position in fileHandle.


LOF( fileHandle )
Returns the length of fileHandle.


LOG( n )
Returns the natural log of n.


LBOUND( arrayName )
Returns the lower bound of arrayName.


LTRIM( string )
Returns string with leftmost whitespace removed.


MAINLOOP( n )
Not yet implemented.


MID( string, startPosition [, length] )
Returns substring from string starting at startPosition for length characters.


MKDIR( directoryName )
Not yet implemented.


NOTBITS( n )
Returns bitwise not of n.


ORBITS( n1, n2 )
Returns bitwise OR of n1and n2.


QUICKSORT( arrayName )
Not yet implemented.


RANDOMIZE( [seed] )
Reseeds random number generator with seed.


READBYTE( fileHandle )
Returns a single byte from fileHandle.


RENAME( oldFileName, newFileName )
Renames oldFileName to newFileName.


REPLACE( [startPosition, ] sourceString, searchForString, replaceWithString )
Returns string with searchForString replaced with replaceWithString.


REVERSE( string )
Returns reversed string.


RIGHT( string, length )
Returns length rightmost characters in string.


RINSTR( searchString, searchForString [, optionalStartPosition] )
Reverse version of Inst, searches from end to start position.


RMDIR( directoryName )
Not yet implemented.


ROUND( n )
Returns n rounded to the nearest integer.


RTRIM( string )
Returns string with whitespace characters removed from right side.


RUN( commandString )
Not yet implemented.


SEEK( handle [, filePosition] )
Returns current file position. If filePosition is specified, seeks to that position.


SIGN( n )
Returns -1 if n is negative, 1 if n is positive, and 0 if n is zero.


SHELL( commandString )
Executes commandString, waits until finished.


SIN( n )
Returns the sin of n.


SPACE( n )
Returns string built of n spaces.


SQR( n )
Returns square root of n.


STR( n )
Returns the string representation of n.


STRF( n )
Returns the string representation of n.


STRING( string, repetitions )
STRING( n, repetitions )
Returns a string with string repeated repetition times. If value is numeric, converts n to an ASCII value first.


SUBSTR( sourceString, startPosition, endPosition )
Returns substring from sourceString, starting at startPosition to endPosition.


TALLY( [startPosition, ] searchString, searchForString )
Returns number of times searchForString occurs in searchString.


TAN( n )
Returns tangent of given angle in radians.


TIMER()
Returns current timer value.


TIME( n )
Returns current time as string in HH:MM:SS format.


TYPEOF( object )
Returns string with name of object's datatype.


UBOUND( arrayName, index )
Returns the upper bound of index index in arrayName. Not yet implemented.


UCASE( string )
Returns string in upper case.


VAL( string )
Returns the numeric value of string.


WRITEBYTE( fileHandle, byte )
Writes a single byte to fileHandle.


XOR( n1, n2 )
Returns bitwise XOR of n1 and n2.