The following sections contain an alphabetical listing of all Empress 4GL statements and functions. Each entry contains:
The Empress 4GL statements are:
| Description | Update an attribute value in the application. | ||||||
| Syntax |
call attr_update (tabinst, attr, expr);where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| See Also |
update |
||||||
| Example | To update the value of the attribute "nametable"."tel" from
the field "names"@"tel":
call attr_update ("nametable", "tel", "names"@"tel");
|
| Description | Return the current value of an attribute. | ||||||
| Syntax |
let variable = attr_value (tabinst, attr)or if attr_value (tabinst, attr) = exprwhere:
|
||||||
| Returns | Current attribute value or null. | ||||||
| Example |
To assign the value of "nametable"."tel" to the variable telephone, use:
let telephone = attr_value ("nametable", "tel");
|
| Description | Cause the terminal to beep when called. |
| Syntax |
call beep (); |
| Returns | None. |
| Example | To make the terminal beep, use:
call beep (); |
| Description | This calls a procedure. | ||||
| Syntax |
call funcname ([expr {, expr}]);
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To call a subscript named menu use the command:
call menu (); |
| Description | Invokes the Empress 4GL application. | ||||
| Syntax |
call application apname ([expr {, expr}]);
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To call an application named personnel use the command:
call application "personnel" (); |
| Description | Check whether the result of an expression is a valid value for the attribute. | ||||
| Syntax |
check expr for attr;where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To ensure that the data keyed into the field name in window
names is a valid entry for the attribute name in nametable,
use:
check "names"@"name" for "nametable"."name"; |
| Description | Check whether the data in a field is valid for the field. | ||||||||||
| Syntax |
let variable = check_field (window, field_name [, field_number]);or if check_field (...) = exprwhere:
|
||||||||||
| Notes |
|
||||||||||
| Returns | check_field returns one of three values in the following table: | ||||||||||
Table 2-1
|
|||||||||||
| Example | If the field tel in window names is defined as an
integer field in the field definition, you can test if the current value
of the field is an integer value with:
let integerflag = check_field ("names", "tel");
|
| Description | Clears all the fields in the specified window. | ||
| Syntax |
call clear_fields ([window]);where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also | disable | ||
| Example | To clear the fields in the window names, use:
call clear_fields ("names");
|
| Description | Set the saved field value to null. | ||||||
| Syntax |
call clear_save_value (window [, field_name [, field_number]]);where:
|
||||||
| Notes |
|
||||||
| Returns | None | ||||||
| Example | To clear the value saved for the field name in the window
names to null, use:
call clear_save_value ("names", "name");
|
| Description | Clear the buffer containing system messages displayed in the status box on the top right corner of the screen. |
| Syntax |
call clear_status (); |
| Notes | This function clears system information messages such as "record n of N", "no next record", and so on. It does not clear error messages or messages placed in the status box by debug_message, error_message, or info_message calls. |
| Returns | None. |
| See Also |
debug_message, error_message, info_message |
| Example | To prevent record count messages from disturbing the screen, use:
call clear_status (); |
| Description | Close a table or list of tables. | ||
| Syntax |
close tabinst {, tabinst};
where:
|
||
| Notes | This command cannot close a table instance currently in use - that is, a table called in an active select command. To close such a table, first issue an end_select or undefine command. | ||
| Returns | None. | ||
| See Also |
end_select, undefine |
||
| Example | To close the table nametable, use:
close "nametable"; |
| Description | Commit the current transaction. |
| Syntax |
commit [transaction]; |
| Notes |
|
| Returns | None. |
| See Also |
start transaction, rollback transaction |
| Example | To commit the current transaction, use:
commit transaction; |
| Description | Compare the saved field value with the current field value. | ||||||||||
| Syntax |
let variable = compare_save_value (window [, field_name [, field_number]]);or if compare_save_value () = exprwhere:
|
||||||||||
| Notes |
|
||||||||||
| Returns |
|
||||||||||
| See Also |
save_value |
||||||||||
| Example | To compare the value saved for the field name in the window
names to the current value for that field, use:
let nameflag = compare_save_value ("names", "name");
|
| Description | Make the given field in the current window the current field. | ||||
| Syntax |
call current_field (field_name [, field_number] ['-x']);where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To make the field name in the current window current, use:
call current_field ("name");
|
| Description | Return the name of the current field. | ||||
| Syntax |
let variable = current_field_name ();or if current_field_name () = exprwhere:
|
||||
| Returns | The name of the current field or returns null if there is no current field. | ||||
| Example | To put the name of the current field into the variable field_name,
use:
let field_name = current_field_name (); |
| Description | Returns the field number of the current field. | ||||
| Syntax |
let variable = current_field_number ();or if current_field_number () = exprwhere:
|
||||
| Returns | The field number of the current field or null if no current field. | ||||
| Example | To put the field number of the current field into the variable fnum
(to make it look like variable then the function name), use:
let fnum = current_field_number (); |
| Description | Update the value of the current field. | ||
| Syntax |
call current_field_update (expr);where:
|
||
| Returns | None. | ||
| Example | To update the value of the current field with the contents of the variable
goodvalue, use:
call current_field_update (goodvalue); |
| Description | Return the value of the current field. | ||||
| Syntax |
let variable = current_field_value ();or if current_field_value () = exprwhere:
|
||||
| Returns | Value of the current field. | ||||
| Example | To get the value of the current field into the variable goodvalue,
use:
let goodvalue = current_field_value (); |
||||
| Description | Set the video attribute of the current field. | ||
| Syntax |
call current_field_video (video_name);where:
|
||
| Notes |
|
||
| Returns | None. | ||
| Example | To set the video of the current field to reverse, use:
call current_field_video ("reverse");
|
| Description | This makes the given window the current window. If a field is specified, this makes the field the current field. | ||||||
| Syntax |
call current_window (window [, field_name [, field_number]] ['-x']);where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | To make a window called names current and make the field name
in the window current, use:
call current_window ("names", "name");
|
| Description | Returns the name of the current window. | ||||
| Syntax |
let variable = current_window_name ();or if current_window_name () = exprwhere:
|
||||
| Returns | Current window name. | ||||
| Example | To get the name of the current window into the variable wname,
use:
let wname = current_window_name (); |
| Description | Print a given message in the top right hand corner of the screen and wait for a key to be pressed before proceeding. | ||
| Syntax |
call debug_message (message {, message});
where:
|
||
| Notes |
|
||
| Returns | None. | ||
| Example | To view the value of a variable at some stage of execution, use:
let a = b; call debug_message ("a = ", a);
When the debug_message function is executed, the string "a
= " followed by value of a is shown on the top right corner
of the screen. |
| Description | Turns the 4GL Application Debugger on or off. | ||
| Syntax |
call debug_mode (mode);where:
|
||
| Returns | None. | ||
| Example | To turn the 4GL Application Debugger on use:
call debug_mode ("on");
|
| Description | Associate a context with a window for multiple record displays generated by SELECT statements with the GROUP BY option. | ||||||||||||||||
| Syntax |
call define_group_multi (context, window, next_line, prev_line, display_script, locked_script, fill_script {, field_name}) [;]
where:
|
||||||||||||||||
| Notes |
The define_group_multi command will allow for the display of only one group of records at a time, if a GROUP BY clause is present in the define select statement. To access another group of records, either the next_group or prev_group commands must be used. Within a group, the next_line and prev_line functions can be used to access records, including the aggregate record for that group. If the define_multi command is used in conjunction with a context, the first record in one group will be displayed immediately following the last record of the previous group. To access records in another group the functions next_line and prev_line can be used, as well as the functions next_group and prev_group. The next_group and prev_group functions are generally intended to be used with the define_group_multi function. |
||||||||||||||||
| Returns | None. | ||||||||||||||||
| See Also |
set_field_values, select, define select, display_page, next_group, prev_group, define_multi |
||||||||||||||||
| Example | See example for define_multi. |
| Description | Associate a context with a window for multiple record displays. | ||||||||||||||||
| Syntax |
call define_multi (context, window, next_line, prev_line, display_script, locked_script, fill_script {, field_name});
where:
|
||||||||||||||||
| Notes |
|
||||||||||||||||
| Returns | None. | ||||||||||||||||
| See Also |
set_field_values, select, display_page |
||||||||||||||||
| Example | Consider the form names shown below. The field names are shown
beside the fields represented as lines.
_______ name [1] ___________ address [1] ________ tel [1] _______ name [2] ___________ address [2] ________ tel [2] _______ name [3] ___________ address [3] ________ tel [3] _______ name [4] ___________ address [4] ________ tel [4] _______ name [5] ___________ address [5] ________ tel [5]Suppose we have defined a window names to show this form. We would like to show the records of table nametable with the attributes name, address and tel in this window. If we have opened nametable using the default table instance name (same as the table name), we can define a context with the define select statement: define select from "nametable" becomes context "name_list";To associate the context with the window, we use: call define_multi ("name_list", "names", 0, 1,
"display_script" "locked_script", "fill_script");We can then write the script display_script as: call set_field_values ("names", "name_list");
The set_field_values function will assign field values in the names window from attributes of the same name from the name_list context. The script locked_script may be: call set_field_values ("names", "name_list", 0, NULL);
let "names"@"address" = "locked";Here the set_field_values function is used to assign null to each field, then the string locked is put in the address field. The script fill_script may set each field to null: call set_field_values ("names", "name_list", 0, NULL);
To display the records of the context in the window, we can do:
call show_window ("names");
select context "name_list"; call display_page ("name_list");
If you make the names window current and allow tabbing within
the fields of that window, it is important to keep the cursor on the same
line when moving from field to field, otherwise the cursor will not reliably
indicate the current record of the context. Use the previous and next entries
of the field definitions to do this. Specifying previous and next field
names in the field definition without specifying their field numbers causes
the same field number as the current field to be used by default. For instance,
in this example we should define the previous of name to be tel
and the next of tel to be name, without specifying any
field number. |
| Description | Define a select without executing. | ||
| Syntax |
define select_statementwhere:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
select context, select |
||
| Example |
The statement: define select from "nametable" where "nametable"."name" = "names"@"name";defines a context that can be initialized with the select context statement. The context takes the name nametable by default. The statement: define select from "nametable" where "nametable"."name" = "names"@"name" becomes context "namesakes";defines a similar context but with the name namesakes. |
| Description | Delete a record. | ||
| Syntax |
delete tabinst {, tabinst};
where:
|
||
| Notes |
|
||
| Returns | None. | ||
| Example | To delete a record in nametable, use:
delete "nametable"; |
| Description | Disable access to the current record within a given context. | ||
| Syntax |
disable context;where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
enable |
||
| Example | To disable any update or delete operations on namesakes, use:
disable "namesakes"; |
| Description | Disable trapping of system interrupt signals. | ||
| Syntax |
disable interrupt signal_no. {, signal_no. ...};
where:
|
||
| Notes |
After the signals are disabled they can be re-enabled again with the enable interrupt command. |
||
| Returns | None. | ||
| See Also |
on interrupt, enable interrupt |
||
| Example | To disable trapping of the alarm and urgent signals use:
disable interrupt 14, 16; |
| Description | This displays visible fields with current values. | ||||
| Syntax |
display [from funcname |() |]; |(expr {, expr})|
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To refresh the screen after executing a script display_names
that updates field values, use:
display from display_names ();where: display_names is the script: let "names"@"address" = "nametable"."address"; let "names"@"tel" = "nametable"."tel"; |
| Description | Display the current page of records in a multiple record window. | ||
| Syntax |
call display_page ([context]);where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
define_multi |
||
| Example | Referring to the example for the define_multi function, to
display the current page of records of context name_list in the
window names, use:
call display_page ("name_list");
|
| Description | Call Empress Report Writer. | ||||||||||||
| Syntax |
call emprepwr context (script_name, outfile [, message {, expr}])
where:
|
||||||||||||
| Notes |
Although the records in the Empress 4GL context are passed to the Report Writer, the context name is not passed, so that the group of records is not recognized by the context name in the Report Writer. The Report Writer sees the records in exactly the same way that it sees records in a file when it is invoked with the -f option - the Report Writer FOR statements will automatically operate on those records by default, as long as they are not within the scope of a SELECT or READ statement. Table 2-2
MSPAGER and MSPRINTER are Empress variables which specify system paging and printing programs. See the Empress SQL User's Guide. |
||||||||||||
| Example | To call the Report Writer script printnames
to format the records of context namesakes and send the output
to the file printfile, use:
call emprepwr "namesakes" ("printnames", "printfile", "names being printed");
The message "names being printed" appears on the screen when the
Report Writer is called. |
||||||||||||
| Description | Call Empress, invoking the Query Language interface. | ||||
| Syntax |
call empsql ([database_name [, query_language_command]]);where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To call Empress for the database mydatabase,
use:
call empsql ("mydatabase");
To call Empress without a default database use:
call empsql ();Regardless of whether there is a default database, any table in any database can be referenced by preceding the table name with the database name followed by a colon (:) as in: display mydatabase:mytable;To display the table mytable in the database mydatabase, use: call empsql ("mydatabase", "display mytable");
|
| Description | Enable a context that was previously disabled with disable. | ||
| Syntax |
enable context;where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
disable, next_rec, prev_rec, next_record, prev_record |
||
| Example | To enable the context namesakes, use:
enable "namesakes"; |
| Description | Reactivate trapping of system interrupt signals. | ||
| Syntax |
enable interrupt signal_no {, signal_no. ...};
where:
|
||
| Notes | Before using enable interrupt the application must have trapped
the interrupt with the on interrupt command.
The signal(s) may have been temporarily disabled within the application with the disable interrupt command |
||
| Returns | None. | ||
| See Also |
on interrupt, disable interrupt |
||
| Example | To reactivate execution of the default action (as given within the
application by the on interrupt 14 command) when the alarm signal
is received, use:
enable interrupt 14; |
| Description | Remove the given context. | ||
| Syntax |
end_select [context] context;where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
select, define_select |
||
| Example | To remove the context namesakes, use:
end_select "namesakes"; |
| Description | Force Empress 4GL to enter an error state for the script and to print an error message at the top right corner of the screen. | ||||
| Syntax |
call error_message (error_message {, error_message});
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To force an error condition when two variables a and b
are not equal, use:
if a != b then call error_message ("error: a = ", a, " b = ", b);
end; |
| Description | This determines the window and field to be used by an application to display an error message. | ||||
| Syntax |
call error_window ([window, field]);where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To call the window error and the field error_message
in the event of an error, use:
call error_window ("error", "error_message");
|
| Description | Stop execution of a script and exits to a specified location. | ||
| Syntax |
exit [|empress |] [confirm]; |script | |to application|where:
|
||
| Notes |
|
||
| Returns | None. | ||
| Example | To exit the current application, use:
exit;To exit Empress 4GL, use: exit empress;To stop execution in the current script but not exit the current application, use: exit script;To exit to the application menu in the calling sequence, use: exit to "menu"; |
| Description | Some Empress 4GL data structures can be shared across applications. Sharing data saves space by eliminating redundant form and window definitions and opens and selects. Use export to export Empress 4GL data structures across applications. | ||||
| Syntax |
export struct_type struct_name {;
struct_type struct_name} [;] END;where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To export the script check_value from the current application,
use:
export script check_value; end; |
| Description | Declare a variable to be an external variable. | ||||
| Syntax |
external [type] variable {; [type] variable} [;] end;
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To define external name and age so that
they will be identified with a global defined in another application:
external char name; integer age; end; |
| Description | Display the Help screen temporarily. The Help screen will disappear on the next key stroke. |
| Syntax |
call field_help_window () |
| Notes | None. |
| See Also | Help key |
| Example | To display the Help screen, use:
call field_help_window (); |
| Description | Alter the mode of a field while an application is running. | ||||||||
| Syntax |
call field_mode (window, field_name, field_number, mode);where:
|
||||||||
| Notes |
|
||||||||
| Returns | None. | ||||||||
| See Also |
next_field, prev_field |
||||||||
| Example | To change the mode of the field name in the window names
to read, use:
call field_mode ("names", "name", 1, "r");
|
| Description | Update a field with a value. | ||||||||
| Syntax |
call field_update (window, field_name, [field_number, ] expr);where:
|
||||||||
| Notes |
|
||||||||
| Returns | None. | ||||||||
| Example | To update the field "names"@"tel" with the value of attribute
"nametable"."tel", use:
call field_update ("names", "tel", "nametable"."tel");
|
| Description | Return the current value of a field. | ||||||
| Syntax |
let variable = field_value (window, field_name [, field_number]);or if field_value (window, field_name [, field_number]) = exprwhere:
|
||||||
| Notes |
|
||||||
| Returns | The current value of the specified field or null. | ||||||
| Example | To assign the current value of the tel field in window names
to the variable telephone, use:
let telephone = field_value ("names", "tel");
|
| Description | Set the video attribute of a field. | ||||||||
| Syntax |
call field_video (window, field_name, [field_number, ] video_name);where:
|
||||||||
| Notes |
|
||||||||
| Returns | None. | ||||||||
| See Also |
current_field_video |
||||||||
| Example | To set the video of the field "names"@"address" to reverse
use:
call field_video ("names", "address", "reverse");
|
| Description | Return the saved value for a given field. |
| Syntax |
let variable = get_save_value (window, field_name [, field_number]);or if get_save_value (window, field_name [, field_number]) = expr |
| Notes |
|
| Returns | Saved value for a given field. |
| Example | To retrieve the saved value for the field name in the window
names, use:
let variable = get_save_value ("names", "name");
|
| Description | Declare variable to be global. | ||||
| Syntax |
global [type] variable {; [type] variable} [;] END;
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| See Also |
parameter, external, local |
||||
| Example | To define variables name and age so that they will
be known throughout the application, do the following in the application
enter script:
global char name; integer age; end; |
| Description | Choose one of two branches of statements based on the evaluation of a condition. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Syntax |
if condition [then] {statement [;]}
[|else {statement [;]}|]
|elseif_clause | end;where elseif_clause has the format: elseif condition [then] {statement [;]}
[|else {statement [;]|]
|elseif_clause | and condition may be one of the following: (condition) condition or condition condition and condition not condition expr[|is |]range expr[|exclusive|]to expr[|exclusive|] |[is] not| |inclusive| |inclusive| expr[|is |]between expr[|exclusive|]and expr[|exclusive|] |[is] not| |inclusive| |inclusive| expr[|is |] [|= |] null |[is] not| |!=| |~=| null expr expr[|IS |] |= | expr |[is] not| |< | |> | |<= | |>= | |!= | |<> | |~= | |like | |not like| |match | |!match | |smatch | |!smatch |where:
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Notes |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Returns | None. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Example 1 | Suppose you are writing an exit script for the field name
in the window names. If you want to be able to leave the application
by typing stop in the name field, you could use this
statement:
if "names"@"name" = "stop" then exit; end; |
||||||||||||||||||||||||||||||||||||||||||||||||
| Example 2 | Extending the above example, suppose you wish to take the following
actions in the exit script for the name field:
if "names"@"name" = null then call error_message ("enter a name");
elseif "names"@"name" = stop then exit; else call get_details (); end; |
||||||||||||||||||||||||||||||||||||||||||||||||
| Description | Some Empress 4GL data structures can be shared across applications. Sharing data saves time and space by eliminating redundant form and window definitions and opens and selects. Use import to import Empress 4GL data structures across applications. | ||||
| Syntax |
import struct_type struct_name {; struct_type struct_name} [;] end;
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| See Also |
export |
||||
| Example | To import the script SC1 to the current application, use:
import script SC1; end |
| Description | Print the given message in the top right hand corner of the screen. | ||
| Syntax |
call info_message (information {, information});
where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
display |
||
| Example | To display a message when a certain phase (for example phase 5)
of execution begins, use:
call info_message ("phase 5 beginning"); .... .... (phase 5 statements) .... |
| Description | This determines the window and field to be called by an application in the case of an Empress 4GL information message or call to an info_message. | ||||
| Syntax |
call info_window ([window, field]);where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| See Also |
info_message |
||||
| Example | To call the window info and the field info_message
in the event of a call to an information message, use:
call info_window ("info", "info_message");
|
| Description | Insert a record into a table. | ||||
| Syntax |
insert tabinst {, tabinst}
[from funcname |() |]; |(expr {, expr})|
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| See Also |
next_rec, prev_rec, enable |
||||
| Example | To insert a record into a table instance named nametable after
executing a script insert_name that updates attribute variables,
use:
insert "nametable" from insert_name ();where insert_name is the script: let "nametable"."address" = "names"@"address"; let "nametable"."tel" = "names"@"tel"; |
| Description | Return the name of a key context on the key context stack. | ||||||||
| Syntax |
let variable = key_context_name ([[window,] number]);or if key_context_name ([[window,] number]) = exprwhere:
|
||||||||
| Notes |
|
||||||||
| Returns | Name of the key context. | ||||||||
| See Also |
push_key_context, pop_key_context |
||||||||
| Example | To get the name of a key context that is third on the stack in the
window names, use:
let keyname = key_context_name ("names", 3);
|
| Description | Return the name of the key on the terminal keyboard associated with the label for the key used in the application. | ||||
| Syntax |
let variable = key_name (key_label);or if key_name (key_label) = exprwhere:
|
||||
| Notes |
|
||||
| Returns | Name of the key. | ||||
| See Also | |||||
| Example | Suppose you have a field called update in a window called
menu. You have written a script to do the update in the menu
window. The script is associated with the key AP_1. Now you want
to display the menu window, and the physical key that should be
pressed to execute the script. You can type:
call show_window ("menu");
let "menu"@"update" = key_name ("AP_1");
display; |
| Description | Execute a key script. | ||||
| Syntax |
call key_script ([context,] key_label);where:
|
||||
| Notes | If a key context is not specified then the current key context is used. | ||||
| Returns | None. | ||||
| Example | To execute the script associated with the key label AP_8,
use:
call key_script ("AP_8");
|
| Description | Return the highest field number of a multi-field. | ||||
| Syntax |
let variable = largest_field_number (window, field_name);or if largest_field_number (window, field_name) = exprwhere:
|
||||
| Notes |
|
||||
| Returns | The highest field number. | ||||
| See Also |
define_multi |
||||
| Example | To find the largest field number of the field "names"@"name",
use:
let largest_number = largest_field_number ("names",
"name"); |
| Description | Assign a value to a variable. | ||
| Syntax |
let variable = |expr|; |null|where:
|
||
| Notes |
|
||
| Returns | None. | ||
| Example | To assign the value of the attribute nametable.address to
the field names@address, use:
let "names"@"address" = "nametable"."address";This is equivalent to: let "names"@"address"[1] = "nametable"."address"; |
| Description | Declare a variable to be local. | ||||
| Syntax |
local [type] variable {; [type] variable} [;] end;
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| See Also |
parameter, external, global |
||||
| Example | To define variables name and age so that they will
be known only in the script use:
local char name; integer age; end; |
| Description | Apply locking to the specified table. | ||
| Syntax |
lock table [in] |exclusive| [mode]; |excl | |share |where:
|
||
| Notes |
|
||
| Returns | None. | ||
| Example | To lock the table nametable in exclusive mode during a transaction,
type:
lock "nametable" in exclusive mode; |
| Description | Return the field name of the mouse cursor position. | ||||
| Syntax |
let variable = mouse_field_name ();or if mouse_field_name () = exprwhere:
|
||||
| Returns | Null or the mouse cursor position's field name. | ||||
| Example | To assign the field name of the mouse cursor to a variable fname,
use:
let fname = mouse_field_name (); |
| Description | Return the field number of the mouse cursor position. | ||||
| Syntax |
let variable = mouse_field_number ();or if mouse_field_number () = exprwhere:
|
||||
| Returns | Null or the mouse cursor position's field number. | ||||
| Example | To assign the field number of the mouse cursor to a variable fnumber,
use:
let fnumber = mouse_field_number (); |
| Description | Indicate whether a mouse key is being depressed. | ||||
| Syntax |
let variable = mouse_key_down ();or if mouse_key_down () = exprwhere:
|
||||
| Notes |
|
||||
| Returns | One if a mouse key is being depressed, otherwise, zero. | ||||
| See Also | |||||
| Example | To check if the mouse key is being depressed, use:
if mouse_key_down () = 1 then . . . end; |
| Description | Determine the current location of the mouse cursor. |
| Syntax |
call mouse_location (); |
| Notes |
|
| Returns | None. |
| Example | To get to the current mouse cursor location, use:
call mouse_location () ; |
| Description | Determine the current window of the mouse cursor. | ||||
| Syntax |
let variable = mouse_window_name ();or if mouse_window_name () = exprwhere:
|
||||
| Returns | Null or the window name of the mouse cursor. | ||||
| Example | To get the window name of the mouse cursor and assign to a variable
wname, use:
let wname = mouse_window_name (); |
| Description | Move the given window to a new location. | ||||||
| Syntax |
call move_window (window, row_amount, col_amount);where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | To move the window names ten rows down and five columns to
the left, use:
call move_window ("names", 10, -5);
|
| Description | Make current the next field in the current window. |
| Syntax |
call next_field (['-x']); |
| Notes |
If control returns to the same field, the enter script for the field is not executed; if control is passed to another field, the enter script for that field is executed last. |
| Returns | None. |
| See Also |
current_field, prev_field |
| Example | To make current the next field in the current window, use:
call next_field (); |
| Description | Get the next group in a select context. | ||||||||||||||||
| Syntax |
next_group context [number];where:
|
||||||||||||||||
| Notes |
Table 2-4
|
||||||||||||||||
| Returns | None. | ||||||||||||||||
| See Also |
select, define select, next_line, prev_line, prev_group, define_group_multi |
||||||||||||||||
| Example | To make the next group from the context namesakes the current
group, use:
next_group "namesakes" 1; |
| Description | Move the cursor to the next line of a multiple record display. |
| Syntax |
call next_line (); |
| Notes |
|
| Returns | None. |
| See Also |
define_multi, next_page |
| Example | Referring back to the context name_list and window names
set up for multiple record displays in the define_multi example,
if the window names is the current window you can put the cursor
on the next record of the display by executing:
call next_line (); |
| Description | This displays the next page of records in a multiple record display. It has the format: | ||
| Syntax |
call next_page ([context]);where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
define_multi, scroll_page |
||
| Example | Referring back to the context name_list and window names
set up for multiple record displays in the define_multi example,
you can display the next page of records in window names by executing:
call next_page ("name_list");
|
| Description | Get the next record in a select context. | ||||||
| Syntax |
next_rec context [expr];where:
|
||||||
| Notes |
The value of got_records as follows:
|
||||||
| Returns | None. | ||||||
| See Also |
select, define, prev_rec |
||||||
| Example | To make the next record from namesakes the current record,
use:
next_rec "namesakes" 1;If namesakes was generated from the table instance nametable which refers to the table nametable with attributes name, address and tel, then the attributes nametable.name, nametable.address, and nametable.tel are initialized. |
| Description | Get the next record in a select context. | ||||
| Syntax |
next_record context [expr];where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| See Also |
select, define select, prev_record, next _record, next_rec, prev_rec, next_group, prev_group |
||||
| Example | To make the next record from the context namesakes the current
record, use:
next_record "namesakes" 1;If namesakes was generated from the table instance nametable which refers to the table nametable with attributes name, address, and tel, then the attributes nametable.name, nametable.address, and nametable.tel are initialized. |
| Description | Trap errors and determine how the system responds to them. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Syntax |
on error|call script ()|error_number {, error_number...};
|default | |ignore | |exit |where:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Notes |
Table 2-4
Table 2-5
Table 2-6
Table 2-7
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Returns | None. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Example | If form does not exist then execute the actions script.
on error call actions () 1014; |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description | Trap system interrupt signals. | ||||||||
| Syntax |
on interrupt |call script ()| signal_no.{, signal_no....}
|break | |exit |where:
|
||||||||
| Notes |
disable interrupt signal_no.{, signal_no....}
It may then be reactivated by
enable interrupt signal_no.{, signal_no....}
|
||||||||
| Returns | None. | ||||||||
| See Also |
disable interrupt, enable interrupt |
||||||||
| Example | To exit Empress 4GL when the interrupt signal is generated
from the keyboard, use:
on interrupt exit 2; |
| Description | Open database tables for access. | |||||||
| Syntax |
|
|||||||
| Notes |
|
|||||||
| Returns | None. | |||||||
| Example | To open the table nametable in update mode, use:
open "nametable" update;The table instance name becomes nametable by default since no tabinst was specified. On the other hand: open "nametable" update as "exampletable";opens the table to the name exampletable. Any references to this table will then be to exampletable. For instance, the attribute name of the Empress table nametable would be known in the application as "exampletable"."name". |
| Description | Declare variables to pass to a script. | ||||
| Syntax |
parameters [type] variable {; [type] variable} [;] end;
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | Suppose you have a script ages which begins by defining parameters
name and age:
parameters char name; integer age; end;You could then execute the statement: call ages ("John", 30);
The ages script would be invoked, the name parameter
would have the value john, and the age parameter the
value "30". |
| Description | Remove the key context on the top of the key context stack for a window. | ||
| Syntax |
call pop_key_context ([window]);where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
push_key_context |
||
| Example | To remove the key context on the top of the stack for the names
window, type:
call pop_key_context ("names");
|
| Description | Make the previous field current in the current window. |
| Syntax |
call prev_field (['-x']); |
| Notes |
|
| Returns | None. |
| See Also |
next_field, current_field |
| Example | To make the previous field current in the current window, use:
call prev_field (); |
| Description | Get the previous group in a select context. | ||||||||||||||||
| Syntax |
prev_group context [number];where:
|
||||||||||||||||
| Notes |
When the context is re-displayed using the display_page function, the current record will still be the aggregate record. Table 2-8
|
||||||||||||||||
| Returns | None. | ||||||||||||||||
| See Also |
select, define select, next_line, prev_line, next_group, define_group_multi |
||||||||||||||||
| Example | To make the previous group from the context namesakes the
current group, use:
prev_group "namesakes" 1; |
| Description | Move the cursor to the previous line of a multiple record display. |
| Syntax |
call prev_line (); |
| Notes |
|
| Returns | None. |
| See Also |
define_multi, prev_page |
| Example | Referring back to the context name_list and window names
set up for multiple record displays in the define_multi example,
if the window names is the current window you can put the cursor
on the previous record of the display by executing:
call prev_line (); |
| Description | Display the previous page of records in a multiple record display. | ||
| Syntax |
call prev_page ([context]);where:
|
||
| Notes |
|
||
| Returns | 0 if there is no previous page and 1 otherwise. | ||
| See Also |
define_multi, scroll_page |
||
| Example | Referring back to the context name_list and window names
set up for multiple record displays in the define_multi example,
you can display the previous page of records in window names by
executing:
call prev_page ("name_list");
|
| Description | Get the previous record in a select context. | ||||||
| Syntax |
prev_rec context [expr];where:
|
||||||
| Notes |
The value of got_records is as follows:
|
||||||
| Returns | None. | ||||||
| See Also |
select, define, next_rec |
||||||
| Example | To make the previous record from namesakes the current record,
use:
prev_rec "namesakes"; |
| Description | Get the previous record in a select context. | ||||
| Syntax |
prev_record context [expr];where:
|
||||
|
|
|
||||
| Returns | None. | ||||
| See Also |
select, define select, next_record, next_rec, prev_rec, next_group, prev_group |
||||
| Example | To make the previous record from the context namesakes the
current record, use:
prev_record "namesakes" 1;If namesakes was generated from the table instance nametable which refers to the table nametable with attributes name, address, and tel, then the attributes nametable.name, nametable.address, and nametable.tel are initialized. |
| Description | Print the current screen. | ||||||||
| Syntax |
call print_screen ([out_file]);where:
|
||||||||
| Notes |
Table 2-10
|
||||||||
| Returns | None. | ||||||||
| Example | To print the current screen into a file named screen, use:
call print_screen ("screen")
|
| Description | Push a key context onto the top of the key context stack for a window. | ||||
| Syntax |
call push_key_context ([window, ] key_context);where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| See Also |
pop_key_context, push_key_context |
||||
| Example | To push key context names_keys onto the stack for window names:
call push_key_context ("names", "names_keys");
|
| Description | Remove the given window from the screen. | ||
| Syntax |
call remove_window (window);where:
|
||
| Notes |
|
||
| Returns | None. | ||
| Example | To remove the window names from the screen, use:
call remove_window ("names");
|
| Description | Reset fields to their default values. | ||||||
| Syntax |
call reset_fields ([window [, field_name [, field_number]]]);where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | To reset the field name in the window names to the
default, use:
call reset_fields ("names", "name");
|
| Description | Reset the key context stack. | ||
| Syntax |
call reset_key_context ([window]);where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
push_key_context, pop_key_context |
||
| Example | To reset the key context stack for the window names, use:
call reset_key_context ("names");
|
| Description | This sets fields to their saved field values. | ||||||
| Syntax |
call restore_field (window [, field_name [, field_number]]);where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | To set the field name in the window names to the
saved value, use:
call restore_field ("names", "name");
|
| Description | Cause an immediate return from a script. | ||
| Syntax |
return [expr];where:
|
||
| Notes |
|
||
| Returns | None. | ||
| Example | A script that computes a value called result could return
the result with the statement:
return result;If the script is named calculation, and accepts two arguments, then it would be invoked as in: let store_result = calculation (argument1, argument2);Here, the arguments are the contents of argument1 and argument2, and the returned result is stored in the variable store_result. |
| Description | Roll back a transaction. |
| Syntax |
|rollback| [transaction] [to savepoint]; |cancel | |
| Notes |
|
| Returns | None. |
| See Also |
commit, savepoint, start transaction |
| Example | The following group of statements rolls back the transaction to the
save point t1.
start transaction; ... savepoint t1; ... rollback transaction to t1;This returns the database(s) to the state immediately following the setting of the save point. |
| Description | Set the saved field value to the current value of the field. | ||||||
| Syntax |
call save_field (window [,field_name [, field_number]])where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | To save the current value of the field name in the names
window, use:
call save_field ("names", "name");
|
| Description | Set a save point in a transaction. | ||
| Syntax |
savepoint savepoint;where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
start transaction, commit, rollback |
||
| Example | The following sequence starts a transaction, sets a save point, then
rolls back. The operations up to the save point are then committed.
start transaction; ... savepoint t1; ... rollback transaction to t1; commit transaction; |
| Description | Scroll the records in a multiple record window and display a new page. | ||||
| Syntax |
call scroll_page ([context, ] number_records);where:
|
||||
| Notes |
|
||||
| Returns | 0 if it fails (because there are not enough records in the context for the scroll) and 1 if it succeeds. | ||||
| See Also |
define_multi, display_page |
||||
| Example | Referring to the example for the define_multi function, to
scroll the current page of records of context name_list in the
window names by five records, use:
call scroll_page ("name_list", 5);
To scroll the same context by the number of lines on the display
less one, use:
call scroll_page ("name_list",
(largest_field_number ("names", "name") - 1));
|
| Description | Scroll the window over its associated form to the new location specified by the given relative amounts (which may be positive or negative). | ||||||
| Syntax |
call scroll_window (window, row_amount, col_amount);where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | To scroll the window names over its form, use:
call scroll_window ("names", 1, 0);
|
| Description | Select a group of records. | |||||||||
| Syntax |
select[|distinct|][|* |] |all | |select_item {, select_item}|
from tabinst[[alias]aliasname]{,tabinst[[alias]aliasname]}
[where_bool] [group by attr {, attr}]
[having_clause] [sort_clause] [with[display]count] [becomes[context]context];where:
|
|||||||||
| Notes |
An expression will be eliminated from the WHERE clause only if a null variable or a null field appears alone on the right side of a comparison operator opposite an attribute. Pattern matching as in the Query Language is supported. A table of matched patterns is presented under the if statement earlier in this chapter. The where_bool conditions specifying ranges (using range or between) get inclusive ranges by default, i.e., the range boundary is included in the range. Specifying the optional excl excludes the range boundary from the range. expr field exprthe field must contain one of the comparison operators (match, etc.) Note that though a field is acceptable, no other kind of variable may be used. Use of the count option exacts a performance penalty. Selects using count will be slower than selects that do not use count. If the display option is used with count, the message record n of N shows the position of the current record in the context every time a new record is made current with the next_rec or prev_rec statements. The message is displayed in a window in the top right corner of the screen. If, however, the context is used in a multiple record display (i.e., named in a define_multi function), the record count display is disabled for the context. "context"."expression_#"where "#" is the number of the expression in the select list. The first aggregate or expression will be expression_1, and subsequent aggregates/expressions can be referred to as expression_2, expression_3, etc. "context"."print_item"if the optional PRINT clause has been used with the select item. "context"."integer_variable"where the integer_variable is the item number or positional indicator in the select list. For the example given above: select a, b, sum (c) print 'TOTAL' from TABLE_1 alias T1 group by a becomes context t1_cont with display count;The aggregate sum(c) can therefore be referenced as:
The following is an example of the 4GL code to access an expression or aggregate with a positional indicator. local integer i; end; let i = 3; let "window"@"field" = "t1_cont".i; |
|||||||||
| Returns | None. | |||||||||
| Example | The statement:
select from "nametable" where "nametable"."name" = "names"@"name";establishes a context of selected records. The context takes the name nametable by default. On the other hand: select from "nametable" where "nametable"."name" = "names"@"name" becomes context "namesakes";establishes a context containing exactly the same records, but with the name namesakes. |
|||||||||
| Description | Select a group of records from a previously defined select. | ||
| Syntax |
select context context_name;where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
select, define select |
||
| Example | Given the define command:
define select from "nametable" where "nametable"."name" = "names"@"name" as context "namesakes";You can initialize the context with records with: select "namesakes"; |
| Description | Assign attribute values from fields of the same name. | ||||||
| Syntax |
call set_attr_values (|window|, |context|, [field_number]); |NULL | |NULL |where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | Referring to the example given for the define_multi function,
suppose we wished to update the record represented by the current line
of the multiple record display. We could call a script to assign the field
values of the current line of the multiple record display to the attributes
of the name_list context. The script could contain the single
statement:
call set_attr_values ("names", "name_list");
This statement is effective because each field has the same name as the
attribute whose values it is intended to display. It is equivalent to,
yet more compact than, the series:
let "nametable"."name" = "names"@"name"; let "nametable"."address" = "names"@"address"; let "nametable"."tel" = "names"@"tel"; |
| Description | Assign field values from attributes of the same name. | ||||||||
| Syntax |
call set_field_values ( window, context [, field_number [, override]]);where:
|
||||||||
| Notes |
|
||||||||
| Returns | None. | ||||||||
| Example | Referring to the example given for define_multi, the script
display_script is used to assign field values to each line of
the multiple record display. The script is executed for each line in the
window. During each execution each line of fields is assigned values from
the corresponding record. The script display_script is:
call set_field_values ("names", "name_list");
This script is effective because each field has the same name as the attribute
whose values it is intended to display. set_field_values is equivalent
to, yet more compact than, the series of let statements shown
next:
let "names"@"name" = "nametable"."name"; let "names"@"address" = "nametable"."address"; let "names"@"tel" = "nametable"."tel";Similarly, the script fill_script, used to fill lines that display no record, can clear each line with: call set_field_values ("names", "name_list", 0, null);
|
| Description | Assign values to fields named after key labels. The value assigned to each field is the result of applying the key_name function to the name of the field. | ||||
| Syntax |
call set_key_values (window [, field_number]);where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | Suppose we have a window menu used to display a function menu,
and that the fields in the window are named after key labels (by default
AP_1, AP_2, ..., AP_10). To display the keys
on the keyboard that correspond to these labels, we can use:
call set_key_values ("menu");
This is equivalent to, yet more compact than, the series:
let "menu"@"AP_1" = key_name ("AP_1");
let "menu"@"AP_2" = key_name ("AP_2");
let "menu"@"AP_10" = key_name ("AP_10");
|
| Description | Set the saved field value to the specified value. | ||||||||
| Syntax |
call set_save_value (window [, field [, field_number}},value);where:
|
||||||||
| Notes |
|
||||||||
| Returns | None. | ||||||||
| Example | To save the current value of the field name in the names
window, use:
call set_save_value ("names", "name", null);
|
| Description | Show the given window on the screen. The window is guaranteed not to be covered in any way by any other window. | ||
| Syntax |
call show_window (window);where:
|
||
| Notes |
|
||
| Returns | None. | ||
| Example | To show the window names, use:
call show_window ("names");
|
| Description | Start a transaction. |
| Syntax |
start transaction; |
| Notes |
|
| Returns | None. |
| See Also |
commit, rollback, savepoint |
| Example | The following sequence starts a transaction, then sets a savepoint
which is later rolled back. The operations up to the save point are then
committed.
start transaction; ... savepoint t1; ... rollback transaction to t1; commit transaction; |
| Description | Test whether an expression matches one of a number of constants and branch accordingly. | ||||||
| Syntax |
switch expr { case constant {, constant}: {statement [;]} }
[ default: {statement [;] }]
end;where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | In this example, the variable name is matched by the string
"joe", so the message "It's Joe" will be printed. After
printing the message, control leaves the case statement.
let name = "Joe"; switch name case "Jim": call info_message ("It's Jim"); case "Joe":
call info_message ("It's Joe"); case "Ann":
call info_message ("It's Ann");
default: call error_message ("Neither Jim, Joe nor Ann");
end; |
| Description | Execute an operating system command and returns immediately. | ||||
| Syntax |
call sys_command (command {, argument});
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To send a file prtfile to the printer use:
call sys_command ("print", "prtfile");
which is passed to the operating system as:
print "prtfile" |
| Description | 4GL application which can be called to display a question in a pop-up window, wait for a yes or no single character response and then remove the pop-up window. | ||||||||
| Syntax |
let answer = application sys_prompt (question, row, col);where:
|
||||||||
| Notes |
|
||||||||
| Returns | CHAR containing y or n. | ||||||||
| Example |
local char ans; end; let ans = application sys_prompt ("Are you sure", 1, 1);
switch ans case y: call delete_script(); case n: exit; end; |
| Description | Execute the given operating system command and return the resulting standard output of the command. | ||||||
| Syntax |
let variable = sys_value (command {, argument});
or
if sys_value (...) = exprwhere:
|
||||||
| Notes |
|
||||||
| Returns | The result of the operating system command. | ||||||
| Example | To count the number of words in a file ufile and place the
value in wordcount, use:
let wordcount = sys_value ("wc", "-w", "ufile");
which places the result of the command:
wc "-w" "ufile"into the variable wordcount. |
| Description | Return the value of an environment variable. | ||||
| Syntax |
let variable = sys_variable (system_variable);or if sys_variable (system_variable) = exprwhere:
|
||||
| Notes |
|
||||
| Returns | Value of the environment variable. | ||||
| Example | To place the value of the Empress variable MSSCPRINTSCREEN
into a variable screenkey, use:
let screenkey = sys_variable ("MSSCPRINTSCREEN");
This particular Empress variable defines the file where an
Empress 4GL screen will be sent to when the <Print Screen>
key is pressed. If the value returned is screens then pressing
the <Print Screen> key will print the screen and send the output to
the file screens. |
| Description | Causes Empress 4GL to call the operating system. If arguments are given, they are expected to form an operating system command and its arguments, and the command is executed. | ||||
| Syntax |
call system (command {, argument});
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | To escape to the operating system and obtain a directory listing, use:
call system ("ls", "-al");
|
| Description | Display a window that is removed automatically by the next keystroke. | ||||||
| Syntax |
call temporary_window (window [, field_name, message {, message...}]);
where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | To create a temporary window for the field name in the window
names, use:
call temporary_window ("names", "name", "The rain in
Spain falls mostly on the plain."); |
| Description | Returns the field name of position where the screen was touched. | ||
| Syntax |
let variable = touch_field_name ();or if touch_field_name () = exprwhere:
|
||
| Returns | Null or the touch screen position's field name. | ||
| See Also |
touch_field_number, touch_location, touch_window_name |
||
| Example | To get the field name of the touch screen position and store the name
in the variable fname, use:
let fname = touch_field_name (); |
| Description | Return the field number of the touch screen position. | ||
| Syntax |
let variable = touch_field_number ();or if touch_field_number () = exprwhere:
|
||
| Returns | Null or the touch screen position's field number. | ||
| See Also |
touch_field_name, touch_location, touch_window_name |
||
| Example | To get the field number of the touch screen position and store in the
variable fnumber, use:
let fnumber = touch_field_number (); |
| Description | Determine the location where the screen was touched. |
| Syntax |
call touch_location (); |
| Notes | The system global variables touch_row and touch_column are automatically updated. |
| Returns | None. |
| See Also |
touch_field_name, touch_field_number, touch_window_name |
| Example | To locate the touch screen position, use:
call touch_location (); |
| Description | This determines the current window of the touch screen position. | ||
| Syntax |
let variable = touch_window_name ();or if touch_window_name () = exprwhere:
|
||
| Returns | Null or the window name of the touch screen position. | ||
| See Also |
touch_field_name, touch_field_number, touch_window_name |
||
| Example | To determine which window is at the screen touch position and store
the name of the window in the variable wname, use:
let wname = touch_window_name (); |
| Description | Remove a select context created by either select or by define select. | ||
| Syntax |
undefine context context;where:
|
||
| Notes |
|
||
| Returns | None. | ||
| See Also |
end_select, define select, select |
||
| Example | To disable the context namesakes, use:
undefine context "namesakes"; |
| Description | Description Update the current record in a table. | ||||||
| Syntax |
update tabinst {, tabinst} [from funcname |() |];
|(expr {, expr})|
where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | To update the current record in nametable after executing
a script update_name, use:
update "nametable" from update_name ();where update_name is the script: let "nametable"."address" = "names"@"address"; let "nametable"."tel" = "names"@"tel"; |
| Description | Repeatedly execute one or more statements while a condition is true. | ||||
| Syntax |
while condition {statement [;]} end;
where:
|
||||
| Notes |
|
||||
| Returns | None. | ||||
| Example | A script that counts from one to a hundred is:
let number = 1; while number < 100 let number = number + 1; end; |
| Description | Change the size of the window as specified by the given relative amounts (which may be positive or negative). | ||||||
| Syntax |
call zoom_window (window, row_amount, col_amount [, row_amount, col_amount]);where:
|
||||||
| Notes |
|
||||||
| Returns | None. | ||||||
| Example | To grow the window names, use:
call zoom_window ("names", 1, 1);
|