You use program sections to define functions, and to declare tables and global variables, that you want to use in the other sections in the script. You also use program sections to program actions that you want to be executed when the session starts or ends.
The following program sections are available. They are all main sections. There are no subsections associated with program sections.
Main sections
declaration:
Use this section to declare tables and global variables that you want to use in other sections in the script. See Variable declarations and Table declarations for details of the declaration syntax. You also use this section to define function prototypes.
before.program:
Use this section to program actions that must be executed when the session starts. For example, you can use this section to initialize or import variables or to read a special record. Note that the default values or imported values overwrite the fields of the main table.
on.error:
Use this section to program actions that must be executed at the end of the session, before the after.program section. If the session is canceled, the actions in this section are not executed. If an error is detected, you can check the predefined variable e for the error code.
after.program:
Use this section to program actions that must be executed at the end of the session, after the on.error section. If the session is canceled (with the command ABORT.PROGRAM), the actions in this section are not executed.
after.update.db.commit:
Use this section to program actions that must be executed immediately after a commit.transaction() call, if the database is updated.
before.display.object:
Use this section to program actions that must be executed each time the entire record is displayed.
before.new.object:
Use this section to program actions that must be executed once before the input of the first field of the new created record. It is used for setting the default values of the record fields.
functions:
Use this section to define the functions used in the other sections. This must be the last section in the script. The function syntax is the same as for 3GL functions.
Example:
declaration:
table tpctst999
long var01, ret
before.program:
if read_parameter() then
mess("pctsts0001", 1) | Parameter not present
stop()
endif
on.error:
mess("........", 1)
functions:
function long read_parameter()
{
select pctst999.*
from pctst999
order by pctst999._index1
as set with 1 rows
selectdo
return(0)
selectempty
return(1)
endselect
}
Related Post:
The following program sections are available. They are all main sections. There are no subsections associated with program sections.
Main sections
declaration:
Use this section to declare tables and global variables that you want to use in other sections in the script. See Variable declarations and Table declarations for details of the declaration syntax. You also use this section to define function prototypes.
before.program:
Use this section to program actions that must be executed when the session starts. For example, you can use this section to initialize or import variables or to read a special record. Note that the default values or imported values overwrite the fields of the main table.
on.error:
Use this section to program actions that must be executed at the end of the session, before the after.program section. If the session is canceled, the actions in this section are not executed. If an error is detected, you can check the predefined variable e for the error code.
after.program:
Use this section to program actions that must be executed at the end of the session, after the on.error section. If the session is canceled (with the command ABORT.PROGRAM), the actions in this section are not executed.
after.update.db.commit:
Use this section to program actions that must be executed immediately after a commit.transaction() call, if the database is updated.
before.display.object:
Use this section to program actions that must be executed each time the entire record is displayed.
before.new.object:
Use this section to program actions that must be executed once before the input of the first field of the new created record. It is used for setting the default values of the record fields.
functions:
Use this section to define the functions used in the other sections. This must be the last section in the script. The function syntax is the same as for 3GL functions.
Example:
declaration:
table tpctst999
long var01, ret
before.program:
if read_parameter() then
mess("pctsts0001", 1) | Parameter not present
stop()
endif
on.error:
mess("........", 1)
functions:
function long read_parameter()
{
select pctst999.*
from pctst999
order by pctst999._index1
as set with 1 rows
selectdo
return(0)
selectempty
return(1)
endselect
}
Related Post:
9 comments:
Use this section to program actions that must be executed when the session starts. For example, you can use this section to initialize or import variables or to read a special record. Note that the default values or imported values overwrite the fields of the main table. cotton kurtis wholesale , winter kurti wholesale , wholesale kurtis for sale , ladies kurti wholesale , wholesale kurtis buy online , linen kurtis wholesale
perde modelleri
sms onay
turkcell mobil ödeme bozdurma
nft nasıl alınır
ANKARA EVDEN EVE NAKLİYAT
TRAFİK SİGORTASI
DEDEKTOR
kurma websitesi
Aşk Romanları
nft nasıl alınır
en son çıkan perde modelleri
minecraft premium
en son çıkan perde modelleri
yurtdışı kargo
lisans satın al
uc satın al
özel ambulans
Good content. You write beautiful things.
korsan taksi
vbet
sportsbet
vbet
hacklink
taksi
mrbahis
hacklink
sportsbet
Good text Write good content success. Thank you
betmatik
kralbet
slot siteleri
bonus veren siteler
betpark
kibris bahis siteleri
tipobet
mobil ödeme bahis
salt likit
salt likit
Z4F4
شركة مكافحة حشرات بالاحساء e1aX0gFNsX
شركة كشف تسربات المياه بالدمام VXH7anc1eM
Post a Comment