GeorgRottensteiner/C64Studio

Can't use string as comparision value inside !if

Closed this issue · 2 comments

Hello Georg,

Simple example:

VARIABLE='abc' ; works ok

;doesn't work
!if(VARIABLE='def'){
}

Would be nice if it works:)

In this case it's because apostrophes are interpreted as single character, whereas quotes are used for strings.
If you use quotes the check works:

`VARIABLE="abc" ; works ok

;doesn't work
!if(VARIABLE="def"){
}`

If using apostrophes VARIABLE is actually set to the first character of the literal. Of course the behaviour is still somewhat wonky, I ought to make it more consistent, or spit out warnings of potential unwanted side effects.

Ah, all right. I've changed conditions and now is ok:) Thank you!