CONTACT US Phone: (412) 835-9417 Email: sales@vss3.com |
Tip #19 - Positioning the Cursor During Data Entry
It is often usful to supply default information, but allow the user to add more or replace the supplied data. This trick can be useful in many situations. Here is one I like to use. I often fill in a date field with today's date. When the user needs to change it, it is usually the day that is changed. To make the data entry smoother, it is handy to place the cursor on the first digit of the day. On a date with an edit, mm/dd/yy, that would be position 4. If the date field is field number 10, the following logic would be used.
@wef10 If: |
10 eq "" |
Then: | 10=@td;pushkey "[crgt][crgt][crgt]";display;end |
If: | |
Then: | end |
To move the cursor to the end of the field to begin typing use the following:
@wef5 If: |
|
Then: | pushkey "[prtc]";end |
If: | |
Then: | end |
(PRTC) is filepro's code for F7 in DOS or CTRL E in UNIX. This will position you to one character after the end of data.
Query If: |
aa eq "" |
Then: | aa(2,yesno,g)="Y";pushkey "Y[ltab]" |
If: | |
Then: | input popup aa "Continue? (Y/N) > " |
The answer "Y" will already be typed and the user has no doubt about what will happen if they just press ENTER. This makes the default answers much clearer to the user. I have found that you must have a field that is not full when you supply the data, that is why I made the yesno field 2 characters.
Give it a try and see what you think.
Written by Nancy Palmquist
Copyright, 1999 by Virtual Software Systems. All rights reserved.