IF/THEN problem with "\"

Previous topic - Next topic

MrTAToad

If you have something like

Code (glbasic) Select
IF a$="\\" then debug "Hello"

all code after the conditional check is never converted to uppercase, generating compiler errors.

If you split the code over multiple lines, then everything is okay

Slydog

#1
Strange problem.
Is it interpreting the escape characters \" before (or after) the \\ is interpreted?

You could change it to:
Code (glbasic) Select
IF a$=CHR$(92) THEN DEBUG "Hello"
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

spacefractal

im thinks im have accounted this nearly from im discovered glbasic. the CHR$ is the way to go. Im dont thinks glbasic intepreting the escape correctly.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Ian Price

Yeah. It was something I posted about years ago when using it as part of a string.
I came. I saw. I played.

MrTAToad

Yes, I thought it had been mentioned before.

QuoteIs it interpreting the escape characters \" before (or after) the \\ is interpreted?
I dont know - using CHR$ will be needed though

sf-in-sf

Yes the escape character is tricky. could you use / instead? even for a path name ? try once c:/here/there/file.ext
Could you use KEY() if you just get the keyboard input ? Good luck!
On the day the atom is a cube I will start believing in the square pixel.