Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
CompilerIf #PB_Compiler_Debugger = 1 ; Debugger is on
path$ = #PB_Compiler_FilePath
CompilerElse ; Debugger is off (executable)
path$ = RemoveString(GetPathPart(ProgramFilename()),"YourApp.app/Contents/MacOS/") ; change 'YourApp' into the program name --> an example for a full path: /Users/geoworld/GeoWorld2/Developing/PureBasic0.app/Contents/MacOS/
CompilerEndIf
CompilerElse ; Windows
path$ = GetPathPart(ProgramFilename())
CompilerEndIf
; MessageRequester("Program Path =", path$)
For example I want to load some images, which are completely outside of the directory containg the PB code. Here for example a (Windows compatible) path from a PB code in the CodeArchiv:
Code: Select all
LoadImage(0,"..\Gfx\PureBasicLogoNew.png")