I. EQUEL/FORMS Examples : Getform
 
Share this page                  
Getform
Transfers data from the form into program variables.
Examples--getform statement:
Example 1:
The following example places data from the ename and sal fields of form empform into program variables:
## getform empform (vname = ename, vsal = sal)
Example 2:
The following example places data from the field specified by the variable fieldvar, in the form specified by the variable formvar, into the variable namevar:
## getform formvar (namevar = fieldvar)
Example 3:
The following example places data from the current form into a database table. Within a display block, the form name need not be specified:
## activate menuitem "add"
## {
##   validate
##   getform (vname = ename, vsal = sal)
##   append to employee (ename = vname, sal = vsal)
## }
Example 4:
The following example illustrates the use of a null indicator variable when retrieving a nullable value from a field:
## getform empform (spousevar:indicator_var = spouse)
Example 5:
This example retrieves the current values from a form and puts them into the database using getform and append param target lists:
addresses(1) = address_of(vnum)
addresses(2) = address_of(vname)
addresses(3) = address_of(vage)
addresses(4) = address_of(vsal)
get_target_string = "%i4 = eno, %c = ename,
                      %i4 = age, %f4 = sal"
put_target_string = "eno = %i4, ename = %c, 
                      age = %i4, sal = %f4"
## getform empform (param(get_target_string, addresses))
## append to employee (param(put_target_string,
##                      addresses))