GLBasic forum

Main forum => GLBasic - en => Topic started by: MrTAToad on 2009-Oct-31

Title: / is the new \
Post by: MrTAToad on 2009-Oct-31
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 / ?
Title: Re: / is the new \
Post by: Moru on 2009-Oct-31
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)
Title: Re: / is the new \
Post by: Kitty Hello on 2009-Oct-31
backward slashes are escape characters: \n \t. If you want a \ you must write \\. But all file pathes _must_ be "/" in GLBasic.
Title: Re: / is the new \
Post by: Ian Price on 2009-Oct-31
I've always used "/" so never noticed any difference.
Title: Re: / is the new \
Post by: MrTAToad on 2009-Oct-31
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...