Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If statements
#1
I am a new programmer and am having a little bit of a problem with an IF statement.

What I want to do is set the str s1 to recognize one cell in excel and determine whether or not its F or M and then activate a two different child windows according to the variable.

Ex:

str s1

if s1="F"
__act child(1)
__key V

else
__act child(2)
__key V

Do I have to add any commands to s1 to get it to recognize the cell?
#2
When need to compare a variable with several constant values (in this case "F" and "M"), better use sel.

sel s1
,case "F"
,act child(1)
,key V
,case "M"
,act child(2)
,key V

With IF it would be

if s1="F"
,act child(1)
,key V
else if s1="M"
,act child(2)
,key V

If does not work, before insert

s1.trim

, because sometimes cell text may end with space or newline.
#3
awesome thanks!


Forum Jump:


Users browsing this thread: 1 Guest(s)