GeorgRottensteiner / C64Studio

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

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

Closed truebluepl closed 5 months ago

truebluepl commented 5 months ago

Hello Georg,

Simple example:

VARIABLE='abc' ; works ok

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

Would be nice if it works:)

GeorgRottensteiner commented 5 months 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 5 months ago

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