Skip to content

Strmark Predefined Variable

Obsolete

This variable is obsolete. This command is valid only in character-mode DataFlex.

See Also

Purpose

To hold the position of the substring found in the last string-manipulating command.

Syntax

strmark

What It Does

Strmark is used and set by the insert, left, mid, pad, pos, and replace commands. In the left command, for example, the endinglength argument is optional. If it is not used, the value of strmark from the last previous insert, left, mid, pad, pos, replace, or sysdate command will be used for the value of length.

string sighting count
move "10 Bombers" to sighting
pos " " in sighting
left sighting to count

In this example, the pos command determines the position of the space in the value of variable sighting (3) and puts the value to strmark (and would put the same value to any optional position argument included in the command). The succeeding left command, since it has no length argument, relies on the value of strmark to extract the three-character substring "10 " (including the ending space) from variable sighting and move it to variable count.

If, on the other hand, the left command had given a length specification, that value would become the new value of strmark.

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 (also set by pos) for length (see strlen Predefined Variable) and the value of strmark for position. If the command is given with one specification, it uses that specification for length and strmark for position.

string sighting type
move "10 Bombers" to sighting
pos " " in sighting
mid sighting to type 5

This example would move the string "Bomb" (including the leading space) to variable type. The pos command determines the position of the space as counted from the left (3) and puts it to strmark (and also puts three to any optional position argument). The succeeding mid command, since it has no position argument, relies on the value of strmark (3) for its starting point, and on the literal argument (5) for the length of the substring, to extract the five-character substring "Bomb".

Use of strmark is entirely optional. Your own explicit arguments may be used to hold the same values and produce the same results.

Notes

  • The file_size, page, and sysdate commands also change the value of strmark, so do not allow these or, better, any commands to intervene among other commands which depend on the value of `strmark.

  • Functions having the same names as commands that move a value to strmark do not affect the value of strmark.