Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Linux Or #PB_OS_MacOS
#Slash$ = "/"
CompilerElse
#Slash$ = "\"
CompilerEndIf
Code: Select all
Pic1: IncludeBinary "game data" + #Slash$ + "image.png"

Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Linux Or #PB_OS_MacOS
#Slash$ = "/"
CompilerElse
#Slash$ = "\"
CompilerEndIf
Code: Select all
Pic1: IncludeBinary "game data" + #Slash$ + "image.png"
Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Linux Or #PB_Compiler_OS = #PB_OS_MacOS
History: Why is the DOS path character "\"?Microsoft MSDN wrote:Note:
File I/O functions in the Windows API convert "/" to "\" as part of converting the name to an NT-style name, except when using the "\\?\" prefix as detailed in the following sections.
Why do you say that? It works just fine here on my Mac and my XP pc. Did it not work for you? What OS are you using?luis wrote:The compilerif should be
otherwise it doesn't work (always true).Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Linux Or #PB_Compiler_OS = #PB_OS_MacOS
Probably it's shorter to reverse the thing and test for "windows or else" anyway
I would say It seem to work, since the "/" works anyway in normal paths under Windows too.J. Baker wrote: Why do you say that? It works just fine here on my Mac and my XP pc. Did it not work for you? What OS are you using?
Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Linux Or #PB_OS_MacOS
#Slash$ = "/"
CompilerElse
#Slash$ = "\"
CompilerEndIf
Debug #Slash$
Not sure what you are asking here?What does your XP machine prints ?
Just read my previous post, and try what I included between the CODE tags. All should be clear then (the reason why the compilerif you wrote is wrong).J. Baker wrote: Not sure what you are asking here?
Sorry, didn't see you had Debug there.luis wrote:Just read my previous post, and try what I included between the CODE tags. All should be clear then (the reason why the compilerif you wrote is wrong).J. Baker wrote: Not sure what you are asking here?