Walter Meester
HoogkarspelNetherlands
General information
Category:
Forms & Form designer
Hi Walter
THank you again for you help.
I think the cause of the infinite loop problem in your code was the following block:
* Remove space and return characters from the beginning of the command if there.
nT = nT + 1
DO WHILE (INLIST(SUBSTR(THIS.Text,nT,1), CHR(13), CHR(10), " ") OR nT < 1)
nT = nT + 1
ENDDO
Imagine If I type 'Enter' key as the first command in your command window it will run forever and hang up the computer.
To fix, I think you can check the number of continuous Entery key (Chr(13)) in DO..ENDDO and exit the loop if 2 Enter
keys were pressed. Sth like the following:
nT = nT + 1
DO WHILE (INLIST(SUBSTR(THIS.Text,nT,1), CHR(13), CHR(10), " ") OR nT < 1) AND numberofchar13 < 2
nT = nT + 1
IF INLIST(SUBSTR(THIS.Text,nT,1), CHR(13))
numberofchar13 = numberofchar13 + 1
ENDIF
ENDDO
Hope this makes sense.
THanks
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only