12-06-2004, 08:49 AM
I while ago Dr. Davenstein gave me this codei modded it a little bit as needed)
Say I enter this in the TS$
D080???? 00100000
1080???? 00000###
How can I make a function that searches for text other than the characters 0-F and return it in a string? The above code works, (PRINT MID$(TS$, X, 1); " is an invalid character!" ) but it only returns one character of the text that isnt hex.
What I want it to do is return ????, ????, and ### all in different string variables. Thanks!
Code:
GetInput:
CLS
INPUT "Enter Hex code"; TS$
FOR X = 1 TO LEN(TS$)
Error1 = ASC(MID$(TS$, X)) < 48 OR ASC(MID$(TS$, X)) > 57
Error2 = ASC(MID$(TS$, X)) < 65 OR ASC(MID$(TS$, X)) > 70
IF Error1 AND Error2 THEN
PRINT MID$(TS$, X, 1); " is an invalid character!"
SLEEP 1
GOTO GetInput
END IF
NEXT
PRINT "&H" + S$
Say I enter this in the TS$
D080???? 00100000
1080???? 00000###
How can I make a function that searches for text other than the characters 0-F and return it in a string? The above code works, (PRINT MID$(TS$, X, 1); " is an invalid character!" ) but it only returns one character of the text that isnt hex.
What I want it to do is return ????, ????, and ### all in different string variables. Thanks!