GeorgRottensteiner / C64Studio

C64Studio is a .NET based IDE specializing in game development for the C64 in assembler and BASIC
Other
243 stars 36 forks source link

Can't use string as comparision value inside !if #120

Closed truebluepl closed 3 weeks ago

truebluepl commented 3 weeks ago

Hello Georg,

Simple example:

VARIABLE='abc' ; works ok

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

Would be nice if it works:)

GeorgRottensteiner commented 3 weeks ago

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.

truebluepl commented 3 weeks ago

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