/ is the new \

Previous topic - Next topic

MrTAToad

Since the update, I've noticed one unusual different when running a program on Windows - absolute file access now requires / (forward slashes) as opposed to the generally more used \ (backslashes).

For example :

Code (glbasic) Select
IF DOESFILEEXIST("c:/temp/ship.ddd")=FALSE
DEBUG "Not found"
ENDIF

Does display the debug message

but

Code (glbasic) Select
IF DOESFILEEXIST("c:\temp\ship.ddd")=FALSE
DEBUG "Not found"
ENDIF


doesn't

I presume all platforms now have to use / ?

Moru

#1
Oh, I thought it was forward-slashes all the time on all platforms?

Edit: Tried it with an old version of GLBasic now and only works with forward-slashes (example 1)

Kitty Hello

backward slashes are escape characters: \n \t. If you want a \ you must write \\. But all file pathes _must_ be "/" in GLBasic.

Ian Price

I've always used "/" so never noticed any difference.
I came. I saw. I played.

MrTAToad

I've usually used \ for Windows, which did mean having to convert to / for Mac and Linux.  Forcing the use of / now is probably a good idea...