Back


The Linguist basic package

These are the keywords supplied for basic numeric, string and control purposes:

add after alias append buffer
cancel clear close collection constant
create data dispose divide enum
every exit file fork get
go gosub hashtable if import
index invert load module multiply
negate on open pop prompt
push put read register remove
replace reply reset return run
save send set socket stop
string switch system take variable
wait while write    

Numeric values
String values
Conditional expressions


Numeric Values

These values can be used in either a numeric or string expression:

<variable>
Returns the current contents of <variable>.

ascii <string>
Returns the ASCII value of the first character in <string>.

random <value>
Returns a random number between zero and <value>-1 inclusive.

the index of <variable>
Returns the current value of the index for this variable.

the length of <string>
Returns the number of characters in <string>.

the lines in <string>
Returns the number of lines in <string>.

the time
Returns an integer representing the current time. This is the number of seconds since January 1, 1970, 00:00:00 GMT.

the value of <string>
Returns the value of <string> if it can be converted to an integer. If not it returns zero.

the words in <string>
Returns the number of words in <string>.

item <key> of <hashtable>
Returns the requested element in the hashtable by looking up the key.

the free memory
Returns an estimate of the current amount of free memory.

the total memory
Returns the current total amount of free memory.

Return to top


String Values

These values can be used in a string expression:

"<text>"
Returns the quoted string.

<buffer>
Returns the current contents of the buffer.

<variable>
Returns the current contents of the variable converted to a string.

<socket>
Returns the most recent message received from the socket named. Only use this inside an on <socket> callback.

ascii <value>
Returns a single character having the given ASCII value.

char[acter] <start> [to <end>/end] of <string>
Returns character(s) from <string>, starting at <start>. If no end is specified only one character is returned, otherwise all characters up to and including <end> are returned. If the word end is given, everything from <start> to the end of <string> is returned.

left <value> of <string>
Returns the leftmost <value> characters from <string>.

line <value> of <string>
Returns the specified line from <string>.

quote
Returns a double-quote character.

return
Returns a return character.

right <value> of <string>
Returns the rightmost <value> characters from <string>.

tab
Returns a tab character.

the index of <variable>
Returns the current index for this variable, as a string.

the message
Returns the content of the most recent message sent to this script module. See send and on message.

the sender
Returns the name of the sender of the most recent message.

the parent
Returns the name of the parent of this module. If there is none, an empty string is returned..

the system name
Returns the name of the operating system, e.g. "Windows 95".

the time
Returns a formatted value representing the current time.

the directory
Returns a string holding the current path in the local file system.

the file path
Returns a string holding the path to the last file accessed using a file dialog. See open.

word <value> of <string>
Returns the specified word from <string>.

Return to top


Conditional Expressions

The basic package recognizes the following conditional expressions, which may be used in an if or while command:

<value>
Tests if <value> is non-zero and if so returns true.

<value1> is <value2>
Tests if <value1> is equal to <value2>; if so returns true.

<value1> is not <value2>
Tests if <value1> is not equal to <value2>; if so returns true.

<value1> is greater than <value2>
Tests if <value1> is greater than <value2>; if so returns true.

<value1> is not greater than <value2>
Tests if <value1> is less than or equal to <value2>; if so returns true.

<value1> is less than <value2>
Tests if <value1> is less than <value2>; if so returns true.

<value1> is not less than <value2>
Tests if <value1> is greater than or equal to <value2>; if so returns true.

<value> is negative
Tests if <value> is negative and if so returns true.

<value> is positive
Tests if <value> is positive or zero and if so returns true.

[not] at end of {file}
Tests if we have read to the end of the file.

file {name} exists
Tests if the named file exists; returns true if so.

file {name} does not exist
Tests if the named file exists; returns false if so.

file {name} is open
Tests if the named file is open; returns true if so.

file {name} is not open
Tests if the named file is open; returns false if so.

<string1> contains <string2>
Tests if the second string is contained in the first string.

<string1> starts with <string2>
Tests if the first string starts with the second string.

<string1> ends with <string2>
Tests if the first string ends with the second string.

<port> has data
Returns true if the named port has received data.

<socket> has data
Returns true if the named socket has received data.

Return to top


Back