GLBasic forum

Main forum => Bug Reports => Topic started by: MrTAToad on 2015-Dec-01

Title: IF/THEN problem with "\"
Post by: MrTAToad on 2015-Dec-01
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
Title: Re: IF/THEN problem with "\"
Post by: Slydog on 2015-Dec-02
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"
Title: Re: IF/THEN problem with "\"
Post by: spacefractal on 2015-Dec-02
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.
Title: Re: IF/THEN problem with "\"
Post by: Ian Price on 2015-Dec-02
Yeah. It was something I posted about years ago when using it as part of a string.
Title: Re: IF/THEN problem with "\"
Post by: MrTAToad on 2015-Dec-03
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
Title: Re: IF/THEN problem with "\"
Post by: sf-in-sf on 2015-Dec-05
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!