Compare a series of numbers - Forum

Forum Navigation
You need to log in to create posts and topics.

Compare a series of numbers

Hello Luis, I would like to compare a series of numbers with a variable [xa]
Here's what I'm trying to do;

SetVar [data] 1, 3, 6, 8, 9, 11, 33

If [xa] == [data]

action

End IF

If [xa] is equal to one of the values found in [data] then an action is taken.
I did not find a way to do it.

thanks for your help

Roger

Hi rocote, try this, it maybe solve your problem

CreateArray [data] 1,3,6,8,9,1,13
ArrayLen [data] [len]
setvar [length] [len]-1
......................................
setvar [xa] 6
......................................

Loop 0 [length] [i]
     If [xa] == [data([i])]
       hello
     Endif
Endloop

 

Uploaded files:
  • You need to login to have access to uploads.

Thanks @asmat!  You have propose an advance solution.

A few mins ago, I found a way out.  There is so much stuff in the ACTION tab.  I didn't saw this one.

SetCompVar [xa] 1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,25,27

IF [xa] == [xa]

AlertBox "Solo" "Il n'y a pas de solo pour cette sélection désolé!" ""

EndIF

@rocote, @asmat answer is correct.
Regards.

Thanks to both of you @asmat and Luis