Author Topic: / is the new \  (Read 1230 times)

MrTAToad

  • Guest
/ is the new \
« 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 / ?
« Last Edit: 2009-Oct-31 by MrTAToad »

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1779
    • View Profile
    • Homepage
Re: / is the new \
« Reply #1 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)
« Last Edit: 2009-Oct-31 by Moru »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10715
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: / is the new \
« Reply #2 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.

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4147
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: / is the new \
« Reply #3 on: 2009-Oct-31 »
I've always used "/" so never noticed any difference.
I came. I saw. I played.

MrTAToad

  • Guest
Re: / is the new \
« Reply #4 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...