By patvdv at 26 Feb 2008 - 21:57
function_name [, ...] )
This copies the contents current record of the main table to the record buffer of that table, saves the record, and executes the specified function. After that the saved record buffer is restored. This enables you to perform actions on the record contents without affecting the values in the table.
The name of the function that must be executed. The function must be of type void.
. . .
Use these optional arguments to pass one or more arguments to the function.
4GL library function.
You can use this function only in 4GL scripts. You cannot use it in the before.program section because the main table has not yet been defined at this point. The function is not relevant to programs of type 4.
In DAL scripts, with.object.set.do() is the equivalent of on.main.table().
| Suppose you have a table to which you can add numbers only
| if a certain value is present in the main table
on.main.table( check_number, 5 )
if not go_ahead then
set.input.error("pctst0003", 5) |"Number %d not present"
function void check_number( long number )
where pctst999.number = :number
as set with 1 rows
go_ahead = TRUE
go_ahead = FALSE