Word variables and the backslash

Previous topic - Next topic

Synthetic

I was working on some test code and found that a word variable doesn't like to hold backslashes.

In example:
textvariable$ = "\"

It didn't matter if it was mixed in with other characters either.

The compiler returned this:
C:\Program Files\GLBasic\Compiler\platform\gpc_temp.cpp:32: unterminated string or character constant
C:\Program Files\GLBasic\Compiler\platform\gpc_temp.cpp:17: possible real start of unterminated constant

Is this a bug or just a reserved character for the compiler?
"Impossible is a word people use to make themselves feel better when they quit."

My AMXMODX plugins for Day of Defeat 1.3 can be found here.

Kitty Hello

No, it's correct:
\" is the escape sequence for the " character. So you should write:
textvariable$="\"" // for a "
textvariable$="\\" for a \

Synthetic

Ah, ok. That makes sense. Thanks for the fast reply!
"Impossible is a word people use to make themselves feel better when they quit."

My AMXMODX plugins for Day of Defeat 1.3 can be found here.