CloudWriter Functions

absany abs(any v);

Returns absolute value of a number

Source file: FUN.L
accessbool access(string path);

Returns true if a file or directory exists

Source file: FUN.L
accessbool access(string path, string mode);

Returns true if a file or directory can be accessed as requested

Source file: FUN.L
access_dirbool access_dir(string path);

Returns true if a directory can be accessed

Source file: FUN.L

. Include a specific file name or "*.*".
access_drivebool access_drive(string drive);

Returns true if a drive can be accessed

Source file: FUN.L
acosreal acos(real x);

Returns the arccosine in radians

Source file: FUN.L
any_to_rgblong any_to_rgb(any color);

Convert a color code, pen, or brush to an RGB value

Source file: COLOR.L
appMessageHandlervoid appMessageHandler(long h, char * _text, char * _caption);



Source file: EPP.L
appMessageHandlervoid appMessageHandler(long i, char * j, char * k);

Helper function to display a message box

Source file: MSGBOX.L

. Flag values are the Windows API falg bits.
arg_liststring arg_list(array args);

Returns a formatted argument list (using space as separator)

Source file: FUN.L

. See Also: arg_string, parse_arguments
arg_liststring arg_list(array args, string separator);

Returns a formatted argument list

Source file: FUN.L

. See Also: arg_string, parse_arguments
arg_stringstring arg_string(string s);

Formats a string for use as a command line argument

Source file: FUN.L

. See Also: arg_list, parse_arguments
asinreal asin(real x);

Returns the arcsine in radians

Source file: FUN.L
askany ask();

Prompt the user for a text value

Source file: PROMPT.L

. The prompt will be "Enter Data".
. The field will be blank.
. The field will be twenty characters wide.
askany ask(string prompt);

Prompt the user for a text value

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Data" is used.
. The field will be blank.
. The field will be twenty characters wide.
askany ask(string prompt, any default_value);

Prompt the user for a text value

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Data" is used.
. A default value will be displayed in field.
. The field will be twenty characters wide.
askany ask(string prompt, any default_value, int columns);

Prompt the user for a text value

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Data" is used.
. A default value will be displayed in field.
. The field will be the specified number of columns wide.
ask_intany ask_int();

Prompt the user for an integer

Source file: PROMPT.L

. The prompt will be "Enter Data".
. The field will be blank.
. The field will be six digits wide.
ask_intany ask_int(string prompt);

Prompt the user for an integer

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Data" is used.
. The field will be blank.
. The field will be six digits wide.
ask_intany ask_int(string prompt, any default_value);

Prompt the user for an integer

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Data" is used.
. A default value will be displayed in field.
. The field will be six digits wide.
ask_intany ask_int(string prompt, any default_value, int columns);

Prompt the user for an integer

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Data" is used.
. A default value will be displayed in field.
. The field will be the specified number of columns wide.
ask_numberany ask_number();

Prompt the user for a number (integer or real)

Source file: PROMPT.L

. The prompt will be "Enter Data".
. The field will be blank.
. The field will be six digits wide.
ask_numberany ask_number(string prompt);

Prompt the user for a number (integer or real)

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Data" is used.
. The field will be blank.
. The field will be six digits wide.
ask_numberany ask_number(string prompt, num default_value);

Prompt the user for a number (integer or real)

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Data" is used.
. A default value will be displayed in field.
. The field will be six digits wide.
ask_numberany ask_number(string prompt, num default_value, int columns);

Prompt the user for a number (integer or real)

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Data" is used.
. A default value will be displayed in field.
. The field will be the specified number of columns wide.
ask_passwordany ask_password();

Prompt the user for a password

Source file: PROMPT.L

. The prompt will be "Enter Password".
. The field will be blank.
. The field will be eight characters wide.
ask_passwordany ask_password(string prompt);

Prompt the user for a password

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Password" is used.
. The field will be blank.
. The field will be eight characters wide.
ask_passwordany ask_password(string prompt, int columns);

Prompt the user for a password

Source file: PROMPT.L

. Prompt string to be displayed for user. If null, a prompt of
. "Enter Password" is used.
. A default value will be displayed in field.
. The field will be the specified number of columns wide.
aspect_xint aspect_x();

Returns the X component of the screen aspect ratio

Source file: FUN.L
aspect_x_yint aspect_x_y();

Returns the diagonal component of the screen aspect ratio

Source file: FUN.L
aspect_yint aspect_y();

Returns the Y component of the screen aspect ratio

Source file: FUN.L
atvoid at();

Displays current function and line # in a message box

Source file: FUN.L

. Also prompts the user whether to continue or to exit.
atvoid at(string text);

Displays text, current function, and line # in a message box

Source file: FUN.L

. Also prompts the user whether to continue or to exit.
atanreal atan(real x);

Returns the arctangent in radians

Source file: FUN.L
atan2real atan2(real y, real x);

Returns the arctangent in radians

Source file: FUN.L
atofdouble atof(any v);

Converts any value to a real

Source file: FUN.L
atoiint atoi(any v);

Converts any value to an integer

Source file: FUN.L
atollong atol(any v);

Converts any value to an integer

Source file: FUN.L
beepvoid beep();

Emits a beep on the system speaker

Source file: FUN.L
beepvoid beep(int n);

Emits a number of beeps on the system speaker

Source file: FUN.L
bits_per_pixelint bits_per_pixel();

Returns the number of bits per pixel for the display

Source file: FUN.L

. Note: Since the display may have more than one "plane" (see
. "num_planes"), the the effective number of bits per pixel is
. gotten by multiplying: bits_per_pixel () * num_planes ().
. See Also: num_colors, num_planes
browsevoid browse(any obj);

Browse an object

Source file: BROWSER.L

. This is intended for debugging applications.
.
. See also: the object_browser class
browse_as_arrayvoid browse_as_array(any obj);

Browse an object as if an array

Source file: BROWSER.L

. This is intended for debugging applications.
.
. See also: browse, browse_members, the object_browser class
browse_as_memoryvoid browse_as_memory(any obj);

Browse an object as if memory

Source file: BROWSER.L

. This is intended for debugging applications.
.
. See also: browse, browse_members, the object_browser class
browse_as_objectvoid browse_as_object(any obj);

Browse an object's members (even for an array)

Source file: BROWSER.L

. This is intended for debugging applications.
.
. See also: browse, browse_as_array, the object_browser class
browse_as_stringvoid browse_as_string(any obj);

Browse an object as if a string

Source file: BROWSER.L

. This is intended for debugging applications.
.
. See also: browse, browse_members, the object_browser class
browse_as_text_arrayvoid browse_as_text_array(any obj);

Browse an object as if an array of text lines

Source file: BROWSER.L

. This is intended for debugging applications.
.
. See also: browse, browse_members, the object_browser class
browse_globalsvoid browse_globals();

Bring up the Global Variable Browser

Source file: BROWSER.L
browse_opcode_frequencyvoid browse_opcode_frequency();

Show opcode frequency table in a window

Source file: INTERP.L
callany call(string fname);

Calls a named non-member function

Source file: FUN.L
callany call(string fname, any v);

Calls a named non-member function with one argument

Source file: FUN.L
callany call(string fname, any v1, any v2);

Calls a named non-member function with two arguments

Source file: FUN.L
callany call(string fname, any v1, any v2, any v3);

Calls a named non-member function with three arguments

Source file: FUN.L
callany call(string fname, any v1, any v2, any v3, any v4);

Calls a named non-member function with four arguments

Source file: FUN.L
call_countlong call_count();

Returns the number of function calls performed by the application

Source file: FUN.L
caller_classstring caller_class();

The name of the class of the object that invoked this function

Source file: FUN.L
caller_functionstring caller_function();

The name of the function that invoked this function

Source file: FUN.L
caller_lineint caller_line();

The source line number of the call to this function

Source file: FUN.L
caller_objectany caller_object();

"this" for the class which called this function

Source file: FUN.L
caller_pathstring caller_path();

The source file for the call to this function

Source file: FUN.L
call_nestinglong call_nesting();

Returns the current nesting level of function calls

Source file: FUN.L
call_nesting_limitlong call_nesting_limit();

Returns the limit of function call nesting

Source file: FUN.L

. A fatal error message will be displayed when this nesting level
. is reached. The user will have the option of continuing (in
. which case further checking is disabled.)
call_nesting_limitlong call_nesting_limit(long n);

Sets the limit for function call nesting

Source file: FUN.L

. The default is 300 levels
ceilreal ceil(real x);

Returns the smallest whole number greater than the argument

Source file: FUN.L

. See Also: floor, round, trunc
chdirbool chdir(string dir);

Change the current working directory

Source file: FUN.L

. See also: getcwd
choose_colorlong choose_color();

Prompt user for a color (defaults to white)

Source file: COLOR.L

. Uses the Windows Color common dialog box.
choose_colorlong choose_color(any rgb);

Prompt user for a color with a default color

Source file: COLOR.L

. Uses the Windows Color common dialog box.
choose_filestring choose_file();

Prompt user to select an input file (from all files)

Source file: FILE.L
choose_filestring choose_file(string path);

Prompt user to select an input file with a default path

Source file: FILE.L
choose_filestring choose_file(string path, string type_text);

Prompt user to select an input file with default path and named type

Source file: FILE.L

. path may be a single file with type or a sequence of types
. separated by semicolons. Each type is preceded by an asterisk
. and a dot.
. If a sequence of types, type_text must be a sequence of type
. names separated by semicolons.
choose_filestring choose_file(string path, string type_text, string access);

Prompt user to select a file with default path and named type

Source file: FILE.L

. path may be a single file with type or a sequence of types
. separated by semicolons. Each type is preceded by an asterisk
. and a dot. At item in the sequence can itself be a semicolon
. separated list of types if enclosed within parentheses.
. If a sequence of types, type_text must be a sequence of type
. names separated by semicolons.
. Access may be "r" for input files and "w" for output files.
choose_fontfont choose_font();

Prompt user for font selection (current window font as default)

Source file: FONT.L

. Uses the Windows Font common dialog box.
choose_fontfont choose_font(font font);

Prompt user for font selection with a default font

Source file: FONT.L

. Uses the Windows Font common dialog box.
chsizeint chsize(int handle, long size);

Change the size of an open file

Source file: FUN.L
cleanup_pathstring cleanup_path(string path);

Clean up a path

Source file: FUN.L

. Make sure it is upper case.
codeshort code(string ch);

Returns the integer character code for the first character of a string

Source file: FUN.L
conscons cons(any car, any cdr);

Create a "cons" object to hold two objects

Source file: LISP.L
control_fontfont control_font();

Returns the default control font

Source file: FONT.L
copy_filebool copy_file(string dest_path, string source_path);

Copy a file

Source file: FILE.L

. Leaves error code from the "file_copier" class in the
. "copy_file_error" global variable.
copy_filebool copy_file(string dest_path, string source_path, long block_size);

Copy a file using specified buffer size (in bytes)

Source file: FILE.L

. Leaves error code from the "file_copier" class in the
. "copy_file_error" global variable.
copy_filesbool copy_files(string dest_dir, string source_path);

First path is for name of target directory.

Source file: FILE.L

. Second path has wildcard file name.
. Returns false if a file could not be copied.
. Creates the target directory if it does not exist.
cosreal cos(real x);

Returns the cosine of the argument in radians

Source file: FUN.L
ctimestring ctime();

Returns the current date and time as a string

Source file: FUN.L

. Format is the same as in C but without the newline.
ctimestring ctime(long time);

Returns the specified date and time as a string

Source file: FUN.L

. Format is the same as in C but without the newline.
daylightbool daylight();

Returns true if daylight savings time is in effect

Source file: FUN.L
day_month_yearstring day_month_year();

Returns current date in format "DD Month YYYY"

Source file: FUN.L
day_month_yearstring day_month_year(long time);

Returns a date/time in format "DD Month YYYY"

Source file: FUN.L
dde_initvoid dde_init();



Source file: SERVICE.L
declbool decl(string text);

Dynamically load Liana declarations from a string

Source file: LCL.L
declbool decl(string text, string path);

Dynamically load Liana declarations from a string that came from a file

Source file: LCL.L

. This function is used instead of the single-argument version so that
. any error messages include the source path.
default_dialog_backgroundlong default_dialog_background();

Returns the default RGB color for dialog box background

Source file: WINDOW.L

. This retrieves the system value for dialog box background which is
. typically white for Windows 3.11 and earlier and Windows NT 3.52
. and earlier. For newer versions, the color is typically gray.
default_fontfont default_font();

Returns the default font

Source file: FONT.L
default_libraryvoid default_library();

Clear the library list and resort to the default library.

Source file: LCL.L
default_pathstring default_path(string path, string def_path);

Apply defaults to a path

Source file: FUN.L

. If directory, file name, or extension are missing from the first
. path, they are supplied from second path.
default_text_colorlong default_text_color();

Returns the default RGB color for window text

Source file: WINDOW.L

. This retrieves the system value for window text color which is
. typically black.
default_window_backgroundlong default_window_background();

Returns the default RGB color for window background

Source file: WINDOW.L

. This retrieves the system value for window background which is
. typically white.
degreesreal degrees(real x);

Converts an angle from radians to degrees

Source file: FUN.L
descriptorany descriptor(long v);

Convert a value to its 32-bit integer value descriptor

Source file: FUN.L
dialog_fontfont dialog_font();

Returns the default dialog font

Source file: FONT.L
dirstring dir(string path);

Returns the drive and directory of a path

Source file: FUN.L

. The directory (if any) includes a terminating slash
dir_no_slashstring dir_no_slash(string dir);

Strips the trailing slash (if) any from a directory

Source file: FUN.L
dir_slashstring dir_slash(string dir);

Assures that a directory has a trailing slash

Source file: FUN.L

. Also expands a partial directory
dos_versionstring dos_version();

Returns the underlying operating system version number (nn.mm)

Source file: FUN.L

. This is the DOS version number for DOS-based systems.
. See Also: os_version
drivestring drive(string path);

Returns the drive from a path

Source file: FUN.L
dump_globalsbool dump_globals(string path);

Output the values of all global variables to a file

Source file: INTERP.L
errorvoid error(string caption, string text);

Display an error message in a message box with a caption

Source file: MSGBOX.L

. The message box will use the "Stop" icon.
. It will have an "OK" button.
errorvoid error(string text);

Display an error message in a message box

Source file: MSGBOX.L

. The message box will use the "STOP" icon.
. It will have an "OK" button.
. The application name ("apname" global variable) will be used as
. the message box caption.
error_yes_no_cancelany error_yes_no_cancel(string caption, string text);

Display an error message in a message box with Yes/No/Cancel buttons and caption

Source file: MSGBOX.L

. The message box will use the "STOP" icon.
. It will have the "Yes", "No", and "Cancel" buttons which will
. return true, false, and "cancel".
error_yes_no_cancelany error_yes_no_cancel(string text);

Display an error message in a message box with Yes/No/Cancel buttons

Source file: MSGBOX.L

. The message box will use the "STOP" icon.
. It will have the "Yes", "No", and "Cancel" buttons which will
. return true, false, and "cancel".
. The application name ("apname" global variable) will be used as
. the message box caption.
evalany eval(string expr);

Dynamically evaluate an expression string

Source file: LCL.L

. Returns the expression value or a special value if there is
. an error. This special error value can be checked for by
. calling the "is_error" member function for the return value.
exitvoid exit();

Exit from the application with a return code of 0

Source file: FUN.L
exitvoid exit(int value);

Exit from the application with a return code

Source file: FUN.L
exit_windowsbool exit_windows();

Exit from Windows (or logoff on Windows NT)

Source file: WINDOW.L
expreal exp(real x);

Raises "e" to an exponent

Source file: FUN.L
extstring ext(string path);

Returns the file extension (if any) of a path

Source file: FUN.L

. Includes the leading ".", but not is there was no extension in
. the path.
fabsreal fabs(real x);

Returns the absolute value of a real number

Source file: FUN.L

. This is different from "abs" in that the result will be a real
. regardless of the operand type.
fatal_errorbool fatal_error(string msg, int line, string class_name, string function, string path);

Called be interpreter on a fatal error

Source file: INTERP.L

. Application will be terminated if it returns false
. It calls "show_fatal_error" to display the error message and prompt
. the user whether to continue.
fclosevoid fclose(file f);

Close a file

Source file: FUN.L

. File must be opened by "fopen" or "file::open" or "new file".
filelengthlong filelength(string path);

Returns the size, in bytes, of a file

Source file: FUN.L

. Returns -1 if file cannot be accessed.
find_filestring find_file(string path);

Find a file given a starting directory and file name

Source file: FINDFILE.L
find_popup_parentwindow find_popup_parent();

Finds the window to use as parent for a popup window

Source file: MSGBOX.L

. This function is called by the message box and dialog box
. functions to automatically determine which window to use as
. the parent for a message/dialog box.
. This is either the window with the input focus, the window in
. the global variable "w", the window in the global variable "fw",
. or null, in that order.
find_textbool find_text(window ed);

Prompt user for a search string

Source file: FINDTEXT.L

. Argument is the line editor control.
. Assumes forward search.
. Uses the Windows Find common dialog box.
find_textbool find_text(window ed, bool search_forward);

Prompt user for a search string with default search direction

Source file: FINDTEXT.L

. Argument is the line editor control.
. Uses the Windows Find common dialog box.
fixed_fontfont fixed_font();

Returns the fixed-pitch system font

Source file: FONT.L
floorreal floor(real v);

Returns the largest whole number less than the argument

Source file: FUN.L

. See Also: ceil, round, trunc
fmodreal fmod(real x, real y);

Returns the floating point remainder

Source file: FUN.L
fnamestring fname(string path);

Returns the file name portion of a path

Source file: FUN.L
fname_extstring fname_ext(string path);

Returns the file name and extension portions of a path

Source file: FUN.L

. They will be separated by a "." unless there was no "." present
. in the path.
font_familiesarray font_families();

Returns an array of all the font family typeface names

Source file: FONT.L

. For fonts available for drawing on the screen.
fopenfile fopen(string path);

Open a file for input

Source file: FUN.L

. This is equivalent to: fopen (path, "r").
fopenfile fopen(string path, string access);

Open a file for input or output

Source file: FUN.L

. The access is "r" for reading, "w" for writing, "rw" for reading
. and writing, or "a" for appending to the end of file.
. In addition, an "x" may be appended to the access to open for
. exclusive (non-shared) access. The default is shared access.
. In addition, a "c" may be added as the first character of the
. access to force the file to be created if it does not exist
. already (this is commonly used with append access: "ca".)
.
. The return value is a "file" object. See the "file" class for
. detailed functions.
.
. See Also: fprintf and fclose
format_moneystring format_money(num n);

Format a number as money with two decimal digits

Source file: FUN.L

. Commas between the thousands, 2 decimal digits
. Uses ::ch_comma to override "," for the comma character.
. Uses ::ch_decimal_point to override "." for the decimal point.
format_moneystring format_money(num n, int num_digits);

Format a number as money with specified precision

Source file: FUN.L

. Commas between the thousands, specified decimal digits
. Uses ::ch_comma to override "," for the comma character.
. Uses ::ch_decimal_point to override "." for the decimal point.
format_msstring format_ms(long time_ms);

Convert a time (in millisec.) to text: HH:MM:SS.MMM

Source file: FUN.L
format_rgbstring format_rgb(any v);

Format a color code as an R,G,B string

Source file: COLOR.L

. For example, format_rgb ("r") would return "255,0,0".
format_rgbstring format_rgb(int red, int green, int blue);

Format R, G, and B component values as an R,G,B string

Source file: COLOR.L

. For example, format_rgb (255, 192, 0) would return "255,192,0".
format_thousandsstring format_thousands(num n);

Format a number as thousands

Source file: FUN.L

. Commas between the thousands, no decimal digits
. Uses ::ch_comma to override "," for the comma character.
fprintfvoid fprintf(file f, string format, any args...);

Output a formatted string to a file

Source file: FUN.L

. See "printf" for format codes.
freevoid free(any object);

Primarily used for "malloc" memory blocks.

Source file: FUN.L
free_list_sizelong free_list_size();

Returns the number of bytes available in the internal "free list"

Source file: FUN.L
free_vectorvoid free_vector(memory v);

Free a string vector

Source file: FUN.L

. See Also: string_vector
full_pathstring full_path(string path);

Expands a path to include the complete directory

Source file: FUN.L
get_ap_namesarray get_ap_names();

Returns a list of the sections (applications) in WIN.INI

Source file: FUN.L
get_byteunsigned char get_byte(memory buf, long offset);

Fetches the byte (as an integer) at an offset in a buffer.

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_bytesmemory get_bytes(memory buf, long offset, long n);

Fetch n bytes from an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_charchar get_char(memory buf, long offset);

Returns the character code at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
getcwdstring getcwd();

Returns the current working directory

Source file: FUN.L

. No trailing slash except for root directory.
getdcwdstring getdcwd(string drive);

Returns the current working directory for a drive

Source file: FUN.L

. No trailing slash except for root directory.
get_disk_free_spacelong get_disk_free_space(string path);

Returns the amount of free space on a drive in bytes

Source file: FUN.L
get_doubledouble get_double(memory buf, long offset);

Returns the double precision float at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_drive_mappingstring get_drive_mapping(string drive);

Get the network path for a mapped drive

Source file: FUN.L

. See Also: map_drive, unmap_drive
getenvstring getenv(string apname, string key);

Returns the value of a keyword from WIN.INI

Source file: FUN.L
getenvstring getenv(string apname, string key, string default1);

Returns the value of a keyword from WIN.INI with a default value

Source file: FUN.L
getenvstring getenv(string name);

Returns the value of a DOS environment variable

Source file: FUN.L
getenv_namesarray getenv_names(string apname);

Returns a list of keywords from WIN.INI for an application

Source file: FUN.L
get_free_gdi_resourcesint get_free_gdi_resources();



Source file: WIN.L
get_free_system_resourcesint get_free_system_resources();



Source file: WIN.L
get_free_user_resourcesint get_free_user_resources();



Source file: WIN.L
get_intint get_int(memory buf, long offset);

Returns the integer at an offset in a buffer

Source file: FUN.L

. This is a 16-bit integer for Windows and a 32-bit integer for Win32.
. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_longlong get_long(memory buf, long offset);

Returns the 32-bit integer at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_op_frequencyvoid get_op_frequency(char * buf);

Copy the opcode execution frequency table into a buffer

Source file: FUN.L
get_shortshort get_short(memory buf, long offset);

Returns the 16-bit integer at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_stringany get_string(memory buf);

Returns the NUL-terminated string from a buffer

Source file: FUN.L

. This is equivalent to get_string (buf, 0).
. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_stringany get_string(memory buf, long offset);

Returns the NUL-terminated string at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_symbol_indexint get_symbol_index(string path);



Source file: FIGURE.L
get_timertimer get_timer();



Source file: TIMER.L
get_unsignedunsigned get_unsigned(memory buf, long offset);

Returns the unsigned integer at an offset in a buffer

Source file: FUN.L

. This is a 16-bit integer for Windows and a 32-bit integer for Win32.
. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_unsigned_charunsigned char get_unsigned_char(memory buf, long offset);

Returns the byte at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_unsigned_longunsigned long get_unsigned_long(memory buf, long offset);

Returns the 32-bit unsigned integer at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_unsigned_shortunsigned short get_unsigned_short(memory buf, long offset);

Returns the 16-bit unsigned integer at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
get_win_dirstring get_win_dir();

Get the Windows directory

Source file: FUN.L

. No trailing slash.
get_win_sys_dirstring get_win_sys_dir();

Returns the Windows system directory

Source file: FUN.L

. No trailing slash.
grayed_menu_itemmenu_item grayed_menu_item(string text);



Source file: MENU.L
hexstring hex(unsigned long value);

Converts an unsigned integer to a hexadecimal string

Source file: FUN.L
hexstring hex(unsigned long value, int n);

Converts an unsigned integer to a hexadecimal string of n digits

Source file: FUN.L
hh_mmstring hh_mm();

Returns current time in format "10:45"

Source file: FUN.L
hh_mmstring hh_mm(long time);

Returns a time in format "10:45"

Source file: FUN.L
hh_mm_mmstring hh_mm_mm();

Returns current time in format "10:45 PM"

Source file: FUN.L

. No leading zero for hour.
hh_mm_mmstring hh_mm_mm(long time);

Returns a time in format "10:45 PM"

Source file: FUN.L

. No leading zero for hour.
hiwordunsigned hiword(unsigned long x);

Returns the "high" 16-bit unsigned word of a 32-bit integer

Source file: FUN.L
hypotreal hypot(real x, real y);

Returns the diagonal given two sides of a rectangle

Source file: FUN.L
icon_heightint icon_height();

Returns the height of an icon

Source file: FUN.L
icon_widthint icon_width();

Returns the width of an icon

Source file: FUN.L
informvoid inform(string caption, string text);

Display an information message in a message box with caption

Source file: MSGBOX.L

. The message box will use the "i" icon.
. It will have an "OK" button.
informvoid inform(string text);

Display an information message in a message box

Source file: MSGBOX.L

. The message box will use the "i" icon.
. It will have an "OK" button.
. The application name ("apname" global variable) will be used as
. the message box caption.
init_lclliana_compile_link init_lcl();

Make sure that the Liana compiler/linker is initialized

Source file: LCL.L
isalnumbool isalnum(string s);

Returns true if all characters of a string are alphanumeric

Source file: FUN.L

. Returns false for empty string or null.
isalphabool isalpha(string s);

Returns true if all characters of a string are alphabetic

Source file: FUN.L

. Returns false for empty string or null.
isdigitbool isdigit(string s);

Returns true if all characters of a string are digits

Source file: FUN.L

. Returns false for empty string or null.
is_dirbool is_dir(string s);

Returns true if a path is a directory

Source file: FUN.L
islowerbool islower(string s);

Returns true if a string does not contain any upper case letters

Source file: FUN.L
isspacebool isspace(string s);

Returns true if all characters of a string are white space

Source file: FUN.L

. White space is blank, tab, new line, carriage return, form feed,
. and vertical tab.
. Returns false for empty string or null.
isupperbool isupper(string s);

Returns true if a string does not contain any lower case letters

Source file: FUN.L
is_wildbool is_wild(string s);

Returns true if string contains any wild characters

Source file: FUN.L

. The wild characters are "*" and "?".
keyhole_debuggervoid keyhole_debugger();

Prompt user for Liana expression to evaluate

Source file: DBSTUB.L

. This function merely calls the _keyhole_debugger function.
. The application may provide its own definition of this function
. to intercept control before _keyhole_debugger is called.
libraryvoid library(string path);

Add a library to front of library list.

Source file: LCL.L

. Libraries are searched in the reverse of the order they were added
. to the list (so that you can easily override a previous library.)
lines_to_stringmemory lines_to_string(array a);

Converts an array of strings to text file format

Source file: FUN.L

. CRLFs are inserted after each line.
load_declbool load_decl(string path);

Dynamically load Liana declarations from a source text file

Source file: LCL.L
load_filememory load_file(string path);

Loads an entire text file as a memory buffer

Source file: FILE.L

. Returns the buffer or null if unsuccessful.
. The "file_error_code" global variable will be set to indicate
. any failure: null for success, "open", "read", or "close".
load_filememory load_file(string path, long buf_size);

Loads an entire text file as a memory buffer with minimum size

Source file: FILE.L

. Returns the buffer or null if unsuccessful.
. The minimum size is used to avoid memory fragmentation when a
. large number of files will be loaded and released (i.e., load
. a file, release it, load another file, release it, and so on.)
. A minimum size of 0 allocates exactly the amount needed (plus
. one byte to NUL terminate the buffer in case it is used as a
. string. If the file is larger than the minimum size, a multiple
. of the size is used.
. The "file_error_code" global variable will be set to indicate
. any failure: null for success, "open", "read", or "close".
load_librarybool load_library();

Force the Liana runtime library to be loaded

Source file: LCL.L
load_linesarray load_lines(array a, string path);

Load a text file as lines into an existing array

Source file: FILE.L
load_linesarray load_lines(array a, string path, long i);

Insert the lines of a text file into an existing array

Source file: FILE.L
load_linesarray load_lines(string path);

Load a text file as an array of lines

Source file: FILE.L

. Line terminaters are removed.
localtimeint localtime(long t, int i);

Returns a member of the "TM" structure for a date/time

Source file: FUN.L
logreal log(real x);

Returns the natural logarithm of a number

Source file: FUN.L
log10real log10(real x);

Returns the base 10 logarithm of a number

Source file: FUN.L
log_mci_callsbool log_mci_calls(bool log_calls);



Source file: VIDEO.L
lowordunsigned loword(unsigned long x);

Returns the "low" 16-bit word of a 32-bit integer

Source file: FUN.L
lstub_icon_handleunsigned lstub_icon_handle();



Source file: ICON.L
lzexpandbool lzexpand(string source, string dest);

Expand a LZ compressed file

Source file: FILE.L
make_callbackstring make_callback(string label);

Make a default callback function name

Source file: FUN.L

. Default the callback to a simplification of label text:
. - Ignore leading embedded controls (e.g., !x!-).
. - Convert all text to lower case.
. - Ignore all special characters.
. - Replace blanks with underscores.
. - Ignore text after (and including) tab character. */
make_longunsigned long make_long(unsigned short lo, unsigned short hi);

Returns 32-bit integer formed from two 16-bit unsigned words

Source file: FUN.L
make_pathstring make_path(string dir, string fname, string ext);

Form a path from directory, file name, and extension

Source file: FUN.L

. Directory includes drive.
make_pathstring make_path(string dir, string fname_ext);

Form a path from directory and file name (with extension)

Source file: FUN.L
mallocany malloc(long size);

Allocate a block of memory

Source file: FUN.L

. If less then 8192 bytes it will be within the Liana workspace.
. Larger blocks are allocated from the Windows Global heap.
. Be sure to call the "free" function for those large blocks
. that are in the Windows Global heap since Liana cannot keep
. track of their usage.
map_drivebool map_drive(string drive, string password, string network_path);

Map a drive letter to a network path

Source file: FUN.L

. See Also: unmap_drive, get_drive_mapping
matherrany matherr(string type, string name, real arg1, real arg2, real retval, int line, string class_name, string function, string path);

Handle runtime math errors

Source file: INTERP.L

. The default action is to display a message box by calling the
. "show_matherr" function.
maxany max(any v1, any v2);

Returns the maximum of two values

Source file: FUN.L
maxany max(any v1, any v2, any v3);

Returns the maximum of three values

Source file: FUN.L
maxany max(any v1, any v2, any v3, any v4);

Returns the maximum of four values

Source file: FUN.L
mciGetErrorStringbool mciGetErrorString(unsigned long wError, char * lpstrBuffer, unsigned uLength);



Source file: WIN.L
mci_pause_waitvoid mci_pause_wait(int milliseconds);



Source file: TIMER.L
mciSendStringunsigned long mciSendString(char * lpstrCommand, char * lpstrReturnString, unsigned wReturnLength, unsigned hCallback);



Source file: WIN.L
mdystring mdy();

Returns the current date in the form MM/DD/YY

Source file: FUN.L
mdystring mdy(long time);

Returns a date/time in the form MM/DD/YY

Source file: FUN.L
mdy_hh_mmstring mdy_hh_mm();

Returns current time in the form MM/DD/YY HH:MM

Source file: FUN.L
mdy_hh_mmstring mdy_hh_mm(long time);

Returns a time in the form MM/DD/YY HH:MM

Source file: FUN.L
mdyyyystring mdyyyy();

Returns the current date in the form MM/DD/YYYY

Source file: FUN.L
mdyyyystring mdyyyy(long time);

Returns a date/time in the form MM/DD/YYYY

Source file: FUN.L
mdyyyy_hh_mmstring mdyyyy_hh_mm();

Returns current time in the form MM/DD/YYYY HH:MM

Source file: FUN.L
mdyyyy_hh_mmstring mdyyyy_hh_mm(long time);

Returns a time in the form MM/DD/YYYY HH:MM

Source file: FUN.L
mem_availlong mem_avail();

Returns the amount of memory available in bytes

Source file: FUN.L
memrstrint memrstr(memory buf, string s);

Find a string in a memory buffer searchng backwards

Source file: FUN.L

. Returns the index of the string or -1 if not found.
memrstrlong memrstr(memory buf, string s, long i);

Find a string in a memory buffer starting at an offset and searchng backwards

Source file: FUN.L

. Returns the index of the string or -1 if not found.
memsetany memset(any dest, int ch, long count);

Initialize a block of memory to a specified byte

Source file: FUN.L

. WARNING! This "low-level", C-style function is not intended for
. general use and is not as protected as typical Liana functions.
. A limited amount of checking is performed, but it is still
. possible for some bogus pointers to get processed and for data
. to be accessed beyond the end of the memory block if the count
. is too large.
memsetany memset(any dest, long offset, int ch, long count);

Initialize a portion of a memory block to a specified byte

Source file: FUN.L

. WARNING! This "low-level", C-style function is not intended for
. general use and is not as protected as typical Liana functions.
. A limited amount of checking is performed, but it is still
. possible for some bogus pointers to get processed and for data
. to be accessed beyond the end of the memory block if the count
. or offset are too large.
memstrint memstr(memory buf, string s);

Find a string in a memory buffer

Source file: FUN.L

. Returns the index of the string or -1 if not found.
memstrlong memstr(memory buf, string s, long i);

Find a string in a memory buffer starting at an offset

Source file: FUN.L

. Returns the index of the string or -1 if not found.
menu_separatormenu_separator menu_separator();

Returns a common "menu separator"

Source file: MENU.L

. There is no need to instantiate more than one menu_separator
. since it has no attributes worth setting.
messagevoid message(string caption, string text);

Display a message in a message box with caption

Source file: MSGBOX.L

. There will not be an icon.
. It will have an "OK" button.
messagevoid message(string text);

Display a message in a message box

Source file: MSGBOX.L

. There will not be an icon.
. It will have an "OK" button.
. The application name ("apname" global variable) will be used as
. the message box caption.
minany min(any v1, any v2);

Return the minimum of two values.

Source file: FUN.L
minany min(any v1, any v2, any v3);

Return the minimum of three values.

Source file: FUN.L
minany min(any v1, any v2, any v3, any v4);

Return the minimum of four values.

Source file: FUN.L
min_maxany min_max(any v1, any min, any max);

Limit a value to a range

Source file: FUN.L
mkdirbool mkdir(string dir);

Create a directory

Source file: FUN.L

. Unlike its C equivalent, this function creates all parent directories
. if they do not exist.
. Returns true if directory already exists.
monthstring month();

Returns the name of the current month

Source file: FUN.L

. In English, capitalized.
monthstring month(long time);

Returns the name of the month for a time

Source file: FUN.L

. In English, capitalized.
month_day_yearstring month_day_year();

Returns current date in format "Month DD, YYYY"

Source file: FUN.L
month_day_yearstring month_day_year(long time);

Returns a date/time in format "Month DD, YYYY"

Source file: FUN.L
no_default_libraryvoid no_default_library();

Clear the library list (not even default library)

Source file: LCL.L
no_yesbool no_yes(string caption, string text);

Display a No/Yes question in a message box with caption

Source file: MSGBOX.L

. It will use the question mark icon.
. It will have "Yes" and "No" buttons which return true and false.
. Unlike the "yes_no" function, the "No" button is the default
. button which is selected if the user presses the Enter key.
no_yesbool no_yes(string text);

Display a No/Yes question in a message box

Source file: MSGBOX.L

. It will use the question mark icon.
. It will have "Yes" and "No" buttons which return true and false.
. Unlike the "yes_no" function, the "No" button is the default
. button which is selected if the user presses the Enter key.
. The application name ("apname" global variable) will be used as
. the message box caption.
no_yes_cancelany no_yes_cancel(string caption, string text);

Display a No/Yes/Cancel question in a message box with caption

Source file: MSGBOX.L

. It will use the question mark icon.
. It will have "Yes", "No", and "Cancel" buttons which return true,
. false, and "cancel".
. Unlike the "yes_no_cancel" function, the "No" button is the default
. button which is selected if the user presses the Enter key.
no_yes_cancelany no_yes_cancel(string text);

Display a No/Yes/Cancel question in a message box

Source file: MSGBOX.L

. It will use the question mark icon.
. It will have "Yes", "No", and "Cancel" buttons which return true,
. false, and "cancel".
. Unlike the "yes_no_cancel" function, the "No" button is the default
. button which is selected if the user presses the Enter key.
. The application name ("apname" global variable) will be used as
. the message box caption.
num_colorsint num_colors();

Returns number of colors supported by screen

Source file: FUN.L

. Note: If the screen supports more than 30-bits per pixel, the
. result is a real number, otherwise it's an integer.
. See Also: bits_per_pixel, num_planes
num_digitsint num_digits(int n);

Returns the number of digits in an integer

Source file: FUN.L

. Uses absolute value for negative number.
num_planesint num_planes();

Returns the number of "planes" for the display

Source file: FUN.L

. See Also: bits_per_pixel, num_colors
nyivoid nyi();

Displays an error message box for an unimplemented function

Source file: MSGBOX.L

. The caller's function name and class will be displayed.
. The application name ("apname" global variable) will be used as
. the message box caption.
nyivoid nyi(string caption, string text);

Displays an error message box with caption for an unimplemented feature

Source file: MSGBOX.L
nyivoid nyi(string text);

Displays an error message box for an unimplemented feature

Source file: MSGBOX.L

. The application name ("apname" global variable) will be used as
. the message box caption.
objectany object(string class_name, any v);

Build an object reference from a class name and value

Source file: FUN.L
okayvoid okay(string caption, string text);

Display a confirmation message in a message box with a caption

Source file: MSGBOX.L

. The message box will use the question mark icon.
. It will have an "OK" button.
okayvoid okay(string text);

Display a confirmation message in a message box

Source file: MSGBOX.L

. The message box will use the question mark icon.
. It will have an "OK" button.
. The application name ("apname" global variable) will be used as
. the message box caption.
okay_cancelbool okay_cancel(string caption, string text);

Display a confirmation message in a message box with caption that use can cancel

Source file: MSGBOX.L

. The message box will use the question mark icon.
. It will have "OK" and "Cancel" button.
. Returns false if user selects the "Cancel" button.
okay_cancelbool okay_cancel(string text);

Display a confirmation message in a message box that use can cancel

Source file: MSGBOX.L

. The message box will use the question mark icon.
. It will have "OK" and "Cancel" button.
. Returns false if user selects the "Cancel" button.
. The application name ("apname" global variable) will be used as
. the message box caption.
operand_stack_depthint operand_stack_depth();

Returns the number of intermediate values on the interpreter stack

Source file: FUN.L
osstring os();

Returns the operating system name

Source file: FUN.L

. This is "Windows", "Windows 95", or "Windows NT".
. See Also: os_version, dos_version
os_versionstring os_version();

Returns the operating system version number (nn.mm)

Source file: FUN.L

. This is the Windows version number for DOS-based systems
. Stores the return value in the os_version global variable.
. Stores the numeric value in the os_version_num global variable.
. See Also: dos_version, os_version_build
os_version_buildstring os_version_build();

Returns the operating system version number with build (nn.mm.bbb)

Source file: FUN.L

. This is the Windows version number for DOS-based systems
. Stores the return value in the os_version_build global variable.
. Returns "0.0.0" if there is an error.
. See Also: os_version, dos_version
output_opcode_frequencyvoid output_opcode_frequency(any target);

Output opcode frequency summary

Source file: INTERP.L

. Argument is typically a window or file or any object that has a "put_to"
. function and can handle return and newline characters.
palette_changedvoid palette_changed();

Callback function called when the system palette is changed

Source file: WINDOW.L
parse_argumentsarray parse_arguments(array argv, string args);

Parse a command-line argument list into an existing array

Source file: FUN.L

. New arguments are appended to the existing array.
. See Also: arg_list, arg_string
parse_argumentsarray parse_arguments(string arg_list);

Parse a command-line argument list

Source file: FUN.L

. Returns null if no arguments.
. See Also: arg_list, arg_string
parse_colorany parse_color(string color);

Parse a text color value

Source file: COLOR.L

. Empty or "-" means no color.
. Use three comma separated integers for RGB.
. Otherwise treated as a single character color code.
. Strips off optional enclosing quotes.
play_mediabool play_media(string path);

Begin playing a media file

Source file: MEDIA.L

. Returns after starting to play the media but does
. not wait till it finishes. Call "wait_media" to
. wait till it finishes playing. Alternatively,
. call "play_media_wait" to both begin playing the
. media file and wait till it finishes.
play_media_waitbool play_media_wait(string path);

Play a media file and wait till it finishes

Source file: MEDIA.L
point_xint point_x(unsigned long p);

Returns the X coordinate for a Windows point

Source file: FUN.L
point_yint point_y(unsigned long p);

Returns the Y coordinate for a Windows point

Source file: FUN.L
powreal pow(real x, real y);

Raise a number to a power

Source file: FUN.L
printfvoid printf(string format, any args...);

Format a string with embedded format codes and output to stdout

Source file: FUN.L

. The text of the format string is output unchanged except for
. embedded format codes which are replaced by the extra arguments
. which will be formatted as specified by the format codes. There
. is a one-to-one, left to right association of arguments with
. format codes.
.
. Each format code begins with a percent character (%) followed by
. a letter code. If you Want to embed a percent character, then
. just immediately follow it with a second percent (%%).
.
. A subset of the C format codes are supported:
.
. %d - Format as a decimal integer.
. %g - Format as a real number
. %s - Any string
. %c - The first character of a string
. %u - Format as an unsigned decimal integer.
. %x - Format as a hex indeger
. %X - Format as a hex indeger with upper case letters
.
. In addition to format codes, you may also embed the escape
. sequences permitted in any string literal, such as new line (\n),
. tab (\t), and carriage return (\r).
.
. Unlike C, this printf is type-safe and will automatically convert
. types as needed (e.g., you can specify an integer for %d or a
. real for a %g.)
.
. You may create your own "stdout" object. All it needs is a
. "put_to" member function to process the string to be output.
. Store the object in the "stdout" global variable.
.
. You may also substitute your own formatting function since printf
. calls "xprintf" to do the formatting.
.
. See also: sprintf, fprintf, and xprintf
put_bytevoid put_byte(memory buf, long offset, unsigned char value);

Stores a byte at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_bytesvoid put_bytes(memory buf, long offset, long count, memory bytes);

Store n bytes at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_charvoid put_char(memory buf, long offset, unsigned value);

Stores a byte at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_doublevoid put_double(memory buf, long offset, double value);

Stores a double precision float at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
putenvany putenv(string apname, string key, any value);

Replaces the value of a keyword in WIN.INI for an application

Source file: FUN.L
put_intvoid put_int(memory buf, long offset, int value);

Stores an integer at an offset in a buffer

Source file: FUN.L

. This is a 16-bit integer for Windows and a 32-bit integer for Win32.
. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_longvoid put_long(memory buf, long offset, long value);

Stores a 32-bit integer at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_pointervoid put_pointer(memory buf, long offset, char * pointer);

Stores a 32-bit pointer at an offset in a buffer

Source file: FUN.L

. The pointer value is typically a string value returned by the
. malloc function.
. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_shortvoid put_short(memory buf, long offset, short value);

Stores a 16-bit integer at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_stringvoid put_string(memory buf, long offset, string value);

Stores a NUL-terminated string at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_unsignedvoid put_unsigned(memory buf, long offset, unsigned value);

Stores an unsigned integer at an offset in a buffer

Source file: FUN.L

. This is a 16-bit integer for Windows and a 32-bit integer for Win32.
. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_unsigned_charvoid put_unsigned_char(memory buf, long offset, unsigned char value);

Stores a byte at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_unsigned_longvoid put_unsigned_long(memory buf, long offset, unsigned long value);

Stores a 32-bit unsigned integer at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
put_unsigned_shortvoid put_unsigned_short(memory buf, long offset, unsigned short value);

Stores a 16-bit unsigned integer at an offset in a buffer

Source file: FUN.L

. The buffer was allocated either with "malloc" or is a raw 32-bit
. integer pointer such as returned by "c_pointer".
radiansreal radians(real x);

Convert an angle in degrees to radians

Source file: FUN.L
randint rand();

Generate a random number

Source file: FUN.L

. It will be in the range 0 to "int_max".
randany rand(any min, any max);

Generate a random number within a range

Source file: FUN.L
reallocany realloc(any obj, long size);

Reallocate a block of memory

Source file: FUN.L

. Block must have been allocated by "malloc".
reboot_systembool reboot_system();

Reboot the system

Source file: WINDOW.L
regen_app_win_listbool regen_app_win_list(any obj);



Source file: APPWIN.L
removebool remove(string path);

Delete one or more files

Source file: FUN.L

. Unlike its C equivalent, it supports wildcards.
removestring remove(string s, int i);

Delete the end of a string starting with ith character

Source file: FUN.L
removestring remove(string s, int i, int n);

Delete n characters of string starting with ith character

Source file: FUN.L
renamebool rename(string old_path, string new_path);



Source file: FUN.L
replace_textbool replace_text(window ed);



Source file: REPLACET.L
restart_windowsbool restart_windows();

Exit from Windows and restart Windows

Source file: WINDOW.L
restart_windowsbool restart_windows(string program);

Exit and restart windows and run a program

Source file: WINDOW.L
restart_windowsbool restart_windows(string program, string params);

Exit and restart windows and run a program with arguments

Source file: WINDOW.L
rgblong rgb(int red, int green, int blue);

Combine R, G, and B color components into an RGB value

Source file: COLOR.L
rgblong rgb(string s);

Parse a color string and convert to an RGB value.

Source file: COLOR.L

. The string can be either a single integer RGB value or a sequence
. of three integer values representing the R, G, and B values.
. For example:
.
. 8439015
. 128,192,255
rgb_blueint rgb_blue(long rgb);

Returns the blue component of an RGB value

Source file: COLOR.L
rgb_greenint rgb_green(long rgb);

Returns the green component of an RGB value

Source file: COLOR.L
rgb_redint rgb_red(long rgb);

Returns the red component of an RGB value

Source file: COLOR.L
rmdirbool rmdir(string path);

Delete a directory

Source file: FUN.L
roundreal round(real x);

Round a real number

Source file: FUN.L
roundreal round(real x, int precision);

Round a real number to a precision

Source file: FUN.L

. The precision is the number of decimal digits in the result.
. For example, to round away fractional pennies: round (x, 2).
run_macroany run_macro(string macro);

Execute a macro

Source file: LCL.L

. A macro is a sequence of Liana statements.
. Returns the return value of the macro (or null if there is no
. return statement) or a special value if there is an error. This
. special error value can be checked for by calling the "is_error"
. member function for the return value. Returns null if an error
. or macro does not execute a "return" statement.
run_macroany run_macro(string macro, string path);

Execute a macro that was read from a file

Source file: LCL.L

. Same as "run_macro", but includes file name in error messages.
. Note: This function does not actually read the file (use "run_macro_file".)
run_macro_fileany run_macro_file(string path);

Execute a macro from a file

Source file: LCL.L

. A macro is a sequence of Liana statements.
. Returns null if an error or macro does not execute a "return"
. statement.
screen_heightint screen_height();

Returns the height of the screen in pixels

Source file: FUN.L
screen_widthint screen_width();

Returns the width of the screen in pixels

Source file: FUN.L
set_window_objectvoid set_window_object(unsigned hWnd, window w);

Associates a window object with a Windows handle

Source file: WINDOW.L
show_fatal_errorbool show_fatal_error(string msg, int line, string class_name, string function, string path);

Display the message concerning a fatal error

Source file: INTERP.L

. Prompts the user whether to continue.
. Returns true if the user wants to continue
show_matherrvoid show_matherr(string type, string name, real arg1, real arg2, real retval, int line, string class_name, string function, string path);



Source file: INTERP.L
show_mci_errorvoid show_mci_error(video video, string command, string msg);



Source file: VIDEO.L
show_object_browservoid show_object_browser(any obj, string mode);

Bring up the Object Browser for an object

Source file: BROWSER.L
sinreal sin(real x);

Returns the sine of an angle in radians

Source file: FUN.L
small_fontfont small_font();

Returns the "small" font (e.g., for dialogs)

Source file: FONT.L
spawnunsigned spawn(string path);

Spawn an application

Source file: FUN.L

. Returns either the Windows task handle or an error code < 32.
spawnunsigned spawn(string path, array args);

Spawn an application with arguments

Source file: FUN.L

. The first argument must be the path of the application
. Returns either the Windows task handle or an error code < 32.
spawn_hiddenunsigned spawn_hidden(string path);

Spawn an application so it runs hidden

Source file: FUN.L

. Returns either the Windows task handle or an error code < 32.
spawn_hiddenunsigned spawn_hidden(string path, array args);

Spawn an application with arguments so it runs hidden

Source file: FUN.L

. The first argument must be the path of the application
. Returns either the Windows task handle or an error code < 32.
spawn_iconunsigned spawn_icon(string path);

Spawn an application as an icon

Source file: FUN.L

. Returns either the Windows task handle or an error code < 32.
spawn_iconunsigned spawn_icon(string path, array args);

Spawn an application as an icon with arguments

Source file: FUN.L

. The first argument must be the path of the application
. Returns either the Windows task handle or an error code < 32.
split_pathvoid split_path(string path, string drive_buf, string dir_buf, string fname_buf, string ext_buf);



Source file: DIR.L
sprintfstring sprintf(string format, any args...);

Format a string using embedded format codes

Source file: FUN.L

. See also: rand
. See "printf" for formatting details
sqrtreal sqrt(real x);

Returns the square root of a number

Source file: FUN.L
srandvoid srand(unsigned seed);



Source file: FUN.L
start_auto_save_timervoid start_auto_save_timer();

Start the Auto Save timer for the text editor

Source file: LINEEDIT.L

. See also: auto_save::
statstat stat(string path);



Source file: FUN.L
step_countlong step_count();

Returns the number of P-codes executed by the interpreter

Source file: FUN.L

. Each function call counts as 100 steps since this number is used
. as a measure of performance and OOP function calls are expensive.
stop_mediavoid stop_media();

Stop playing the current media file

Source file: MEDIA.L

. Also closes the device.
. See also: play_media
strafterstring strafter(string s, string delimiter);

Returns the portion of a string after a delimiter string

Source file: FUN.L
strbeforestring strbefore(string s, string delimiter);

Returns the portion of a string before a delimiter string

Source file: FUN.L
strbeginsbool strbegins(string s, string pat);

Returns true if a string begins with a pattern string

Source file: FUN.L
strcapstring strcap(string s);

Capitalizes a string

Source file: FUN.L

. First letter of each word is converted to upper case and other
. letters are converted to lower case.
.
. See also: strcase
strcapstring strcap(string s, string use_case);

Capitalizes a string based on a "case"

Source file: FUN.L

. If requested case is "none", string is unchanged.
. If requested case is "lower", string as converted to lower case.
. If requested case is "upper", string as converted to upper case.
. If requested case is "mixed", first letter of each word is
. converted to upper case and other letters are converted to
. lower case.
.
. You may "cycle" though the cases by adding 1 to the value
. returned by strcase. If strcase returns "lower", adding 1
. gives "lower1" which converts the case to mixed. Adding
. 1 to "mixed" gives "mixed1" which converts to upper case.
. And adding 1 to "upper" gives "upper1" which converts to
. lower case.
.
. See also: strcase
strcasestring strcase(string s);

Returns the "case" of a string

Source file: FUN.L

. Return values are "none" if no letters, "lower" if no upper case
. letters, "upper" if no lower case letters, and "mixed" if some
. upper and some lower case.
.
. See also: strcap
strchcountlong strchcount(string s, string ch);

Counts occurrences of a character in a string

Source file: FUN.L
strchcountlong strchcount(string s, string ch, long i);

Counts occurrences of a character in remainder of a string

Source file: FUN.L

. Counting starts with the ith character
strchcountlong strchcount(string s, string ch, long i, long n);

Counts occurrences of a character in a portion of a string

Source file: FUN.L

. Counting starts with the ith character and proceeds for n
. characters.
strchrlong strchr(string s, string ch);

Finds the first occurrence of a character

Source file: FUN.L

. Returns the character index (0-based) or -1 if no match.
strchrlong strchr(string s, string ch, long i);

Finds the next occurrence of a character

Source file: FUN.L

. Starts search with the ith character.
. Returns the character index (0-based) or -1 if no match.
strchrlong strchr(string s, string ch, long i, bool search_forward);

Finds the next or previous occurrence of a character

Source file: FUN.L

. Starts search with the ith character.
. If "search_forward" is false, search proceeds back towards the
. beginning of the string.
. Returns the character index (0-based) or -1 if no match.
strcolint strcol(string s, int i);

Converts a character index to a column using a tad width of 8

Source file: FUN.L

. An index of -1 converts to the width of the string if its tabs
. were expanded.
strcolint strcol(string s, int i, int tab_width);

Converts a character index to a column given tab width

Source file: FUN.L

. An index of -1 converts to the width of the string if its tabs
. were expanded.
strcolindexint strcolindex(string s, int i);

Convert a column index to character index for tab width of 8

Source file: FUN.L
strcolindexint strcolindex(string s, int i, int tab_width);

Convert a column index to character index given a tab width

Source file: FUN.L
strdetabany strdetab(any s);

Expand tabs to spaces (assumes tab width is 8)

Source file: FUN.L
strdetabany strdetab(any s, int tab_width);

Expand tabs to spaces given a tab width

Source file: FUN.L
strdupstring strdup(string s);

Make a copy of a string

Source file: FUN.L
strelidestring strelide(string s, int n);

Truncate (elide) a string to a given length

Source file: FUN.L

. Trailing characters are replaced with "...".
string_vectormemory string_vector(any obj);

Build a vector of strings from an array-like object

Source file: FUN.L

. This consists of a vector of far pointers to strings stored
. just past the pointers.
. Each string will by terminated by a NUL with an extra NUL at the end.
. Be sure to call "free_vector" when the string vector is no longer needed.
strinsertstring strinsert(string s, int i, string s1);

Inserts a string into another string

Source file: FUN.L

. The second string is inserted before the ith character of the
. first string.
strlenlong strlen(string s);

Returns the length of a string

Source file: FUN.L
strlinestring strline(string s, int i);

Returns the line which contains the ith character of a string

Source file: FUN.L
strlwrany strlwr(string s);

Returns a copy of a string with upper case changed to lower case

Source file: FUN.L
strpadstring strpad(string s, int width);

Pad a string to a width with blanks

Source file: FUN.L

. A positive width pads on the right.
. A negative width pads on the left.
strpadstring strpad(string s, int width, string ch);

Pad a string to a width with a character

Source file: FUN.L

. A positive width pads on the right.
. A negative width pads on the left.
strpbrklong strpbrk(string s1, string s2);

Find the first occurrence of any character of the second string

Source file: FUN.L

. Returns the index of the character in the first string or -1 if
. not found.
strpbrklong strpbrk(string s1, string s2, long offset);

Find the next occurrence of any character of the second string

Source file: FUN.L

. Search begins with the ith character of the first string.
. Returns the index of the character in the first string or -1 if
. not found.
strrchrlong strrchr(string s, string ch);

Search for the last occurrence of a character

Source file: FUN.L

. Returns the index of the character or -1 if not found.
strrchrlong strrchr(string s, string ch, long i);

Search for the previous occurrence of a character

Source file: FUN.L

. Search begins with the ith character and proceeds back towards
. the beginning of the string.
. Returns the index of the character or -1 if not found.
strrepstring strrep(string s, string pattern);

Delete all occurrences of a set of characters

Source file: FUN.L

. The input string is not modified, a copy is made.
strrepany strrep(string s, string pattern, string rep);

Replace all occurrences of a set of characters with another set

Source file: FUN.L

. There is a one-to-one correspondence between the characters in
. the pattern string and the replacement string.
. If the replacement string is shorter than the pattern,
. matching characters beyond the length of the replacement string
. will be deleted.
. Extra characters in the replacement string will be ignored.
. The input string is not modified, a copy is made.
strrstrlong strrstr(string s, string pat);

Finds the last occurrence of a string

Source file: FUN.L

. Returns the character index of the first character of the
. matching substring or -1 if no match.
strrstrlong strrstr(string s, string pat, long i);

Finds the previous occurrence of a string

Source file: FUN.L

. Returns the character index of the first character of the
. matching substring or -1 if no match.
. The search starts trying to match the first character of the
. pattern string with the ith character of the string.
strrstrlong strrstr(string s, string pat, long i, bool match_case);

Finds the previous occurrence of a string with case

Source file: FUN.L

. Returns the character index of the first character of the
. matching substring or -1 if no match.
. The search starts trying to match the first character of the
. pattern string with the ith character of the string.
. A value of false for "match_case" causes a case-insensitive search.
strrstrlong strrstr(string s, string pat, long i, bool match_case, bool match_word);

Finds the previous occurrence of a string with case, word match

Source file: FUN.L

. Returns the character index of the first character of the
. matching substring or -1 if no match.
. The search starts trying to match the first character of the
. pattern string with the ith character of the string.
. A value of false for "match_case" causes a case-insensitive search.
. A value of true for "match_word" requires that the match not be
. immediately preceded or followed by a letter.
strsplitarray strsplit(string s, string delimiter);

Split a string into array elements using a delimiter

Source file: FUN.L
strstrlong strstr(string s, string pat);

Finds the first occurrence of a string

Source file: FUN.L

. Returns the character index of the first character of the
. matching substring or -1 if no match.
strstrlong strstr(string s, string pat, long i);

Find the next occurrence of an embedded string

Source file: FUN.L

. Returns the character index of the first character of the
. matching substring or -1 if no match.
. The search begins at the ith character of the first argument.
strstrlong strstr(string s, string pat, long i, bool match_case);

Find an embedded string with optional case sensitivity

Source file: FUN.L

. Searches for the next occurrence of the pattern string.
. Returns the character index of the first character of the
. matching substring or -1 if no match.
. The search begins at the ith character of the first argument.
. A value of false for "match_case" causes a case-insensitive search.
strstrlong strstr(string s, string pat, long i, bool match_case, bool match_word);

Find an embedded string with optional case, word match

Source file: FUN.L

. Searches for the next occurrence of the pattern string.
. Returns the character index of the first character of the
. matching substring or -1 if no match.
. The search begins at the ith character of the first argument.
. A value of false for "match_case" causes a case-insensitive search.
. A value of true for "match_word" requires that the match not be
. immediately preceded or followed by a letter.
strstrlong strstr(string s, string pat, long i, bool match_case, bool match_word, bool search_forward);

Find an embedded string with optional case, word match, and direction

Source file: FUN.L

. Searches for the next or previous occurrence of the pattern string.
. Returns the character index of the first character of the
. matching substring or -1 if no match.
. The search begins at the ith character of the first argument.
. A value of false for "match_case" causes a case-insensitive search.
. A value of true for "match_word" requires that the match not be
. immediately preceded or followed by a letter.
. A value of true for "search_forward" causes searching to go forward,
. a value of false causes a search back towards the beginning of the
. string (trying to match the first character of the pattern string
. with the ith character of the string.
strtrimstring strtrim(string s);

Trims a string of trailing white space

Source file: FUN.L
struprany strupr(string s);

Converts lower case letters to upper case

Source file: FUN.L
substrstring substr(string s, long i);

Returns the remainder of a string starting at ith character

Source file: FUN.L
substrany substr(string s, long i, long n);

Returns n characters starting with the ith character

Source file: FUN.L
suspend_mci_loggingbool suspend_mci_logging(bool suspend_logging);



Source file: VIDEO.L
tanreal tan(real x);

Returns the tangent of an angle in radians

Source file: FUN.L
terminate_lianavoid terminate_liana();

Give application one last shot before termination.

Source file: INTERP.L
timelong time();

Returns the current date/time in seconds

Source file: FUN.L
time_mslong time_ms();

Returns the time since application startup in milliseconds

Source file: FUN.L
timezonelong timezone();

Returns the current time zone in seconds relative to GMT

Source file: FUN.L
titlestring title(string path);

Returns a standard window title using a file name.

Source file: FUN.L
title_filestring title_file(string path);

Returns the file name portion of a standard window title for a file

Source file: FUN.L

. Automatically increments "fw.next_untitled" to derive the "Untitled"
. serial number.
title_filestring title_file(string path, int k);

Returns the file name portion of a standard window title for a file

Source file: FUN.L

. "k" is the "Untitled" serial number.
tm_hourint tm_hour(long time);

Returns the hour (0..23) for a date/time

Source file: FUN.L
tm_isdstint tm_isdst(long time);

Returns true if daylight savings time is in effect for a date/time

Source file: FUN.L
tm_mdayint tm_mday(long time);

Returns the day in month (0..30) for a date/time

Source file: FUN.L
tm_minint tm_min(long time);

Returns the minute (0..59) for a date/time

Source file: FUN.L
tm_monint tm_mon(long time);

Returns the month (0..11) for a date/time

Source file: FUN.L
tm_secint tm_sec(long time);

Returns the seconds (0..59) for a date/time

Source file: FUN.L
tm_wdayint tm_wday(long time);

Returns the day in week (0..6) for a date/time

Source file: FUN.L
tm_ydayint tm_yday(long time);

Returns the day in year (0..365) for a date/time

Source file: FUN.L
tm_yearint tm_year(long time);

Returns the year (1900...) for a date/time

Source file: FUN.L
truncreal trunc(real x);

Returns the integer portion of a real number.

Source file: FUN.L

. Converts its argument to real first.
. See Also: ceil, floor, round
truncreal trunc(real x, int precision);

Truncates a real number to a precision

Source file: FUN.L

. For example, trunc (1.237, 2) returns 1.23.
. See Also: ceil, floor, round
tznamestring tzname(int i);

Returns the time zone names

Source file: FUN.L

. Argument is 0 or 1, 0 means the standard time name and 1 means the
. daylight savings time name.
ultoastring ultoa(unsigned long value);

Convert an unsigned long 32-bit integer to ASCII text

Source file: FUN.L
ultoastring ultoa(unsigned long value, int radix);

Convert an unsigned long 32-bit integer to ASCII text in some base

Source file: FUN.L
unmap_drivebool unmap_drive(string drive);

Unmap a drive letter from its network path

Source file: FUN.L

. See Also: map_drive, get_drive_mapping
utimebool utime(string path, long mtime);

Set the modification time for a file

Source file: FUN.L
vector_stringsarray vector_strings(memory buf);

Build an array from a vector of strings

Source file: FUN.L

. Each string is NUL terminated with an extra NUL at the end.
view_helpbool view_help(string help_path);

View a Windows Help file

Source file: MENU.L
volume_labelstring volume_label(string path);

Returns the label for a volume (drive)

Source file: FUN.L
waitvoid wait(int milliseconds);



Source file: TIMER.L
wait_mediavoid wait_media();

Wait for the current media file to finish playing

Source file: MEDIA.L

. Called only after calling "play_media".
. Also closes the device.
. Note: No application input will be processed. Specifically,
. keyboard and mouse input will be deferred until after the
. media wait completes.
. See also: play_media_wait
wait_silentlyvoid wait_silently(int milliseconds);



Source file: TIMER.L
wait_until_task_terminatesvoid wait_until_task_terminates(unsigned handle);

Wait until a task terminates

Source file: FUN.L

. Checks task status every 500 milliseconds.
wait_until_task_terminatesvoid wait_until_task_terminates(unsigned handle, int interval);

Wait until a task terminates

Source file: FUN.L

. Checks task status at specified interval (milliseconds.)
warnvoid warn(string caption, string text);

Display a warning message in a message box with caption

Source file: MSGBOX.L

. The message box will use the exclamation point icon.
. It will have an "OK".
warnvoid warn(string text);

Display a warning message in a message box

Source file: MSGBOX.L

. The message box will use the exclamation point icon.
. It will have an "OK".
. The application name ("apname" global variable) will be used as
. the message box caption.
win_api_initvoid win_api_init();

Initialize globals needed for using the Windows API

Source file: WINDOW.L

. This is called automatically when the first window is created.
windowwindow window();

Create and show a window

Source file: WINDOW.L

. Returns the window
. Window will be an instance of class "app_window".
windowwindow window(string title);

Create and show a window with a title

Source file: WINDOW.L

. Returns the window
. Window will be an instance of class "app_window".
window_fontfont window_font();

Returns the default window font

Source file: FONT.L
window_objectwindow window_object(unsigned hWnd);

Returns the window object associated with a Windows handle

Source file: WINDOW.L
window_waitvoid window_wait();

Wait till user closes last window for this application

Source file: WINDOW.L

. Assumes either the "fw" or "w" global variables are set to refer
. to a window.
workspace_usedlong workspace_used();

Returns the current application workspace size in bytes

Source file: FUN.L
write_filebool write_file(string path, memory buf);

Writes a memory buffer to a text file

Source file: FILE.L

. Returns true if successful and false if unsuccessful.
. The "file_error_code" global variable will be set to indicate
. any failure: null for success, "create", "write", or "close".
write_file_with_backupbool write_file_with_backup(string path, memory buf);

Write a buffer to a text file and backup the old file.

Source file: FILE.L

. If the file already exists, it will be renamed to the same name
. but with the extension ".BAK".
. The actual operation sequence is: output to file.TMP, delete
. any existing file.BAK, rename file to file.BAK, rename file.TMP
. to full file name. This sequence guarantees that the old file
. will not get mangled if their is an error outputting the new file.
. Special note: If the target file extension is ".TMP", then the
. temp file will use the extension ".TM1".
. The "file_error_code" global variable will be set to indicate
. any failure: null for success, "create", "get_lines, "write",
. "close", "rename", "remove_backup", or "rename_backup".
write_linesbool write_lines(string path, array lines);

Output an array of lines of text to a file

Source file: FILE.L

. Line terminators (CRLF) will be added.
. The "file_error_code" global variable will be set to indicate
. any failure: null for success, "create", "get_lines, "write",
. or "close".
write_linesbool write_lines(string path, array lines, bool partial);

Output an array of lines of text to a file with optional last terminator

Source file: FILE.L

. Line terminators (CRLF) will be added, except for the last line
. if "partial" is true.
. The "file_error_code" global variable will be set to indicate
. any failure: null for success, "create", "get_lines, "write",
. or "close".
xprintfstring xprintf(string format, array args);

Format a string using embedded format codes and an array of values

Source file: FUN.L

. See "printf" for formatting details
. See also: sprintf
yes_nobool yes_no(string caption, string text);

Display Yes/No question in a message box with a caption

Source file: MSGBOX.L

. It will use the question mark icon.
. It will have "Yes" and "No" buttons which return true and false.
. The "Yes" button is the default if the user presses the Enter key.
yes_nobool yes_no(string text);

Display Yes/No question in a message box

Source file: MSGBOX.L

. It will use the question mark icon.
. It will have "Yes" and "No" buttons which return true and false.
. The "Yes" button is the default if the user presses the Enter key.
. The application name ("apname" global variable) will be used as
. the message box caption.
yes_no_cancelany yes_no_cancel(string caption, string text);

Display Yes/No/Cancel question in a message box with a caption

Source file: MSGBOX.L

. It will use the question mark icon.
. It will have "Yes", "No", and "Cancel" buttons which return true,
. false, and "cancel".
. The "Yes" button is the default if the user presses the Enter key.
yes_no_cancelany yes_no_cancel(string text);

Display Yes/No/Cancel question in a message box

Source file: MSGBOX.L

. It will use the question mark icon.
. It will have "Yes", "No", and "Cancel" buttons which return true,
. false, and "cancel".
. The "Yes" button is the default if the user presses the Enter key.
. The application name ("apname" global variable) will be used as
. the message box caption.
yieldbool yield();

Allow other apps to run and Windows messages to be processed

Source file: FUN.L

. This is equivalent to calling "yield" with a mode of 0.
yieldbool yield(int mode);

Allow other apps to run and Windows messages to be processed

Source file: FUN.L

. Modes:
.
. 0 = Use PeekMessage until no more messages.
. 1 = Use GetMessage to wait until a message, then revert to mode 0.
. 2 = Use GetMessage until WM_QUIT received.
. 3 = Use GetMessage to wait for a message and then process
. that one message and return.

 

John Elkins (john@vermontdatabase.com) 8-Oct-2000