Strlen Predefined Variable
Obsolete
This variable is obsolete. This command is valid only in character-mode DataFlex.
Purpose
To hold the length of the substring found in the last string-manipulating command.
Syntax
strlen
What It Does
Strlen is used and set by the index_def, mid, pos, right, and sysdate commands. In the right command, for example, the endinglengthargument is optional. If it is not used, the value of strlen from the last previous index_def, mid, pos, right, or sysdate command will be used for the value of length.
string sighting type
move "10 Bombers" to sighting
pos " " in sighting
right sighting to type
In this example, the pos command determines the position of the length of the substring in the value of sighting, which begins with the space (8), and puts the value to strlen (regardless of whether any position argument was included in the command). The succeeding right command, since it has no length argument, relies on the value of strlen to extract the eight-character substring " Bombers" (including the leading space) from sighting and move it to type.
If, on the other hand, the right command had given a length specification, that value would become the new value of strlen.
The mid command uses both a position and a length specification. If the command is given with neither specification, it uses the value of strlen for length and the value of strmark (also set by pos) for position (see strmark Predefined Variable).
string sighting type
move "10 Bombers" to sighting
pos " " in sighting
mid sighting to type
This example would produce exactly the same results as the right example above. The pos command determines the length of the substring in the value of sighting, which starts with the space (8), and puts the value to strlen, and it puts the position of the space as counted from the left (3) to strmark (and also puts three to any optional position argument). The succeeding mid command, since it has no length or position arguments, relies on the value of strmark (3) for its starting point, and on strlen for the length of the substring, to extract the eight-character substring " Bombers" (including the starting space) from sighting and move it to type.
Use of strlen is entirely optional. Your own explicit arguments may be used to hold the same values and produce the same results.
Notes
-
The
sysdatecommand outputs the minutes of the time tostrlen, so do not allowsysdatecommands to intervene among other commands which depend on the value ofstrlen. -
Functions having the same names as commands that move a value to
strlendo not affect the value ofstrlen.