Tips & Tricks - Pick Basic Text Editing - Using Arrows
Text Editing - 1 character at a time
This programming tip will show you how to code an INPUT statement to automatically do a carriage return after the user has entered a character. In this example, it will be used to edit text.
Example:
VALUE = "Robert Smith" CRT@(10,10):VALUE CRT@(10,10): COL = 10 FOR CTR = 1 TO 12 CRT@(COL,10): INPUT NEW,0 IF NEW = CHAR(6) THEN COL = COL + 1 NEXT CTR
This code will display "Robert Smith" on the screen in column 10, row 10. It will then position the cursor at the beginning of the text.
By adding the ",0" to the INPUT statement, thekeys that the user enters will be kept as their actual value. CHAR(6) is equal to the right arrow key. This example shows how the user may edit the text one letter at a time by hitting just theright arrow key and not the <ENTER> key.
As the user presses theright arrow key, the prompt moves one letter to the right. This is helpful when allowing for text editing.
May also be useful for menu applications. Give it a try!
Bakken Software Services ... The Obvious Pick 1-708-450-1062