hr_sea
11-04-2009, 11:51 PM
When using an If - then statement, can I compare against a string?
I'm working on interfacing a Basic Stamp 2 to a laptop by wireless RS-232. I'd like to pass it commands in plain text via Windows Hyperterminal and have the stamp turn pins on and off. I can't seem to only be able to get if-then statements to work with numerical values.
I'm collecting 5 characters or less into "DataIn" array. Appropriate code snippets
SERIN SerialInput,BaudMode,TimeOut,begin,[SKIP 1, STR DataIn\5\"*"]
IF DataIn ="on" THEN
HIGH 1
ENDIF
I'm working on interfacing a Basic Stamp 2 to a laptop by wireless RS-232. I'd like to pass it commands in plain text via Windows Hyperterminal and have the stamp turn pins on and off. I can't seem to only be able to get if-then statements to work with numerical values.
I'm collecting 5 characters or less into "DataIn" array. Appropriate code snippets
SERIN SerialInput,BaudMode,TimeOut,begin,[SKIP 1, STR DataIn\5\"*"]
IF DataIn ="on" THEN
HIGH 1
ENDIF