CURRLEN |
currlen determines the number of key parts used.
Shortint [G:abv]currlen
# Example 1: Read on the first
element of the primary key
Local File TABPAYTERM[TPT]
[G:TPT]currind=1
[G:TPT]currlen=1
Read [F:TPT] = "ACPT30";2
Infbox [F:TPT]PTE-num$([F:TPT]PTELIN)
#--------------------------------------#
# Example 2: You get the same result with:
#
Read [F:TPT]TPT0(1) = "ACPT30";2
Infbox [F:TPT]PTE-num$([F:TPT]PTELIN)
currlen is a system variable of the [G] class associated with a table declared by the File command. It contains the number of key parts to be considered:
· in the read of a record (by the Read, Readlock, and For instructions)
· in the verification of a record (by the Look instruction)
· in the filter of a record (by the Filter instruction)
currlen is set to zero (0) by the supervisor; in this case, the entire key is used. This variable may have values from zero (0) to 8.
The read of a record, with the precision of a key part, sets the currlen variable automatically. Warning! Any next read, without precision of key, will be performed on the same key part. To read an entire key, specify the key or set the currlen variable to zero (0). Zero is the default value.
currlen will be considered by default in an instruction, e.g., Read, if the key is not specified. The currind system variable will give the key to be used.
No associated error
Currind - Read - Readlock - For - Look - Filter - Order By
|
|