6. Working with Arrays, Table Fields, and Collections : Table Field Operations : How You Can Scroll Through Data : How You Can Use Single-character Find
 
Share this page                  
How You Can Use Single-character Find
When a user positions the cursor in a column that has an entry field as its protofield and types a letter or number, the cursor moves to the first row whose value in that column begins with the specified letter or number. Each time the user types the character, the cursor moves to the next row whose column value begins with that character.
In searching for a specified character, when the cursor reaches the last row of the table field, it loops back to the first row.
Because typing in a field whose mode is changeable actually displays the value in the field, you can use single-character find only when the column is Landable but not Changeable.
You can disable this feature for a column in either of the following ways:
Use the Property Inspector to set the HasSingleCharacterFind attribute.
Set the HasSingleCharacterFind attribute in your 4GL code.
For example, the following code disables this feature for the vid_no column of the vlist table field:
field(vlist[*].vid_no).HasSingleCharFind = FALSE;
To implement a custom find operation for a table field whose bias is changeable, use the ArrayObject's Find method. For an explanation about using the Find method, see How You Can Scroll Indirectly with the Find Method (see How You Can Scroll Indirectly with the Find Method).