Code archives/Miscellaneous/Where is my current directory?
This code has been declared by its author to be Public Domain code.
Download source code
| |||||
Ensure current directory is know, and where it should be. I wanted a few lines of code that would check directories were correct, regardless of if it was a final program or under development. Simply: 1. Change the path in the conditional statement to where your B+ or B3D \bin file is loacted. 2. Enter your desired path to use whilst under development. Occasionally blitz would throw an error when I presumed it was set to working directory, now I know it is (well it's not caused me any problems yet). | |||||
[CODE] ; ******************************************************************************************************************* ; * * * * * * Checks to see where 'appdir' is. Once program is installed will set directory to program dir * * * * * ; **************************************** by Nicholas Tindall 2006 ************************************************* ; ******************************************************************************************************************* app$ = SystemProperty ("appdir") DebugLog app$ If app$ = "F:\Program Files\BlitzPlus\bin\" Or app$ = "F:\Program Files\Blitz3D\bin\" cur_dir$ = "F:\Documents And Settings\Administrator.NSTT1\My Documents\Blitz Progs\Sticks n Stones\" ChangeDir cur_dir$ Else cur_dir$ = SystemProperty ("appdir") ChangeDir cur_dir$ EndIf DebugLog "1: " + CurrentDir$() ; ******************************************************************************************************************* ; ******************************************************************************************************************* [/CODE] |
Comments
| ||
where is my current dir? CurrentDir$() |
| ||
isnt always reliable |
Code Archives Forum