Re: Alphanumeric pager codes
Quote from Forum Archives on November 22, 1997, 12:18 pmPosted by: rbrown <rbrown@...>
Ken wrote:
> LOCAL FN checkKeys
> EFnum = WINDOW(_EFnum)
> key$ = TEKEY$
> SELECT WINDOW(_EFclass)/4
> LONG IF ASC(key$) => ASC("0") AND ASC(key$) <=ASC("9")
> TEKEY$ = key$
> XELSE
> FN errorWarning
> END IF
> END SELECT
> inNow$ = EDIT$(EFnum) 'get string from EF
> IF LEN(inNow$) = 3 THEN FN getCode$ 'if 3 numbers in do it
> IF LEN(inNow$) > 3 THEN SETSELECT 0,255 'if more then 3 select all
> END FNIf I might offer a suggestion:
Your function currently does not let the user press the right- or
left-arrow keys, nor the "Delete" key. (Consider this scenario: I want
to enter "247" but I enter "25" by mistake. I hit "Delete" to erase the
"5"--not only does the "5" _not_ go away, but I also get this annoying
warning message.)I would add the following "OR" clause to your LONG IF statement:
OR ASC(key$) = 8 OR ASC(key$) = 28 OR ASC(key$) = 29
(8 is "Delete", 28 is left-arrow, 29 is right-arrow).
- Rick
Posted by: rbrown <rbrown@...>
> LOCAL FN checkKeys
> EFnum = WINDOW(_EFnum)
> key$ = TEKEY$
> SELECT WINDOW(_EFclass)/4
> LONG IF ASC(key$) => ASC("0") AND ASC(key$) <=ASC("9")
> TEKEY$ = key$
> XELSE
> FN errorWarning
> END IF
> END SELECT
> inNow$ = EDIT$(EFnum) 'get string from EF
> IF LEN(inNow$) = 3 THEN FN getCode$ 'if 3 numbers in do it
> IF LEN(inNow$) > 3 THEN SETSELECT 0,255 'if more then 3 select all
> END FN
If I might offer a suggestion:
Your function currently does not let the user press the right- or
left-arrow keys, nor the "Delete" key. (Consider this scenario: I want
to enter "247" but I enter "25" by mistake. I hit "Delete" to erase the
"5"--not only does the "5" _not_ go away, but I also get this annoying
warning message.)
I would add the following "OR" clause to your LONG IF statement:
OR ASC(key$) = 8 OR ASC(key$) = 28 OR ASC(key$) = 29
(8 is "Delete", 28 is left-arrow, 29 is right-arrow).
- Rick