Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble with operators
#1
Hey!

I'm having a little trouble finding the correct syntax:

Function enumeracao_alpha
Code:
Copy      Help
function str'letra

if letra="a"
,ret 1

Without using "else if" I want the code to say to return 1 if it's "a" OR "A". But I find the correct way to use or (||).

Can you help? Thanks! Big Grin
#2
if letra="a" || letra="A"
,ret 1

or

if letra~"a"
,ret 1

or

if 0=StrCompare(letra "a" 1)
,ret 1

or

sel letra
,case ["A","a"] ret 1

or

sel letra 1
,case "a" ret 1
#3
awesome!

Thanks


Forum Jump:


Users browsing this thread: 1 Guest(s)