Baanboard.com

Go Back   Baanboard.com

User login

Frontpage Sponsor

Main

Poll
Would you like to see a separate forum on Baanboard for the ION product?
No
14%
Yes
86%
Total votes: 80

Baanboard at LinkedIn


Reference Content

 
on.main.table()
By patvdv at 26 Feb 2008 - 21:57

on.main.table()

Syntax

void on.main.table(
         function_name [, ...] )




Description

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.

Arguments

function_name

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.

Context

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().

Example

 | Suppose you have a table to which you can add numbers only
 | if a certain value is present in the main table

 declaration:
                 long go_ahead

 field.pctst999.number:
 check.input:
                 on.main.table( check_number, 5 )
                 if not go_ahead then
                                 set.input.error("pctst0003", 5)    |"Number %d not present"
                 endif

 functions:
 function void check_number( long number )
 {
                 select pctst999.*
                 from pctst999
                 where pctst999.number = :number
                 as set with 1 rows
                 selectdo
                                 go_ahead = TRUE
                 selectempty
                                 go_ahead = FALSE
                 endselect
                 return
 }

Related topics



0
No votes yet


All times are GMT +2. The time now is 08:31.


©2001-2013 - Baanboard.com - Baanforums.com