Ooops
November 28, 2020, 01:18:02 PM

Author Topic: [bb] Where is my current directory? by Nicstt [ 1+ years ago ]  (Read 393 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
Title : Where is my current directory?
Author : Nicstt
Posted : 1+ years ago

Description : 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 in 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 :
Code: BlitzBasic
  1. [CODE]
  2. ; *******************************************************************************************************************
  3. ; * * * * * * Checks to see where 'appdir' is.  Once program is installed will set directory to program dir * * * * *
  4. ; **************************************** by Nicholas Tindall 2006 *************************************************
  5. ; *******************************************************************************************************************
  6. app$ = SystemProperty ("appdir")
  7. DebugLog app$
  8.  
  9. If app$ = "F:Program FilesBlitzPlusin" Or app$ = "F:Program FilesBlitz3Din"
  10.         cur_dir$ = "F:Documents And SettingsAdministrator.NSTT1My DocumentsBlitz ProgsSticks n Stones"
  11.         ChangeDir cur_dir$
  12. Else
  13.         cur_dir$ = SystemProperty ("appdir")
  14.         ChangeDir cur_dir$
  15. EndIf
  16.  
  17. DebugLog "1: " + CurrentDir$()
  18. ; *******************************************************************************************************************
  19. ; *******************************************************************************************************************
  20.  
[/code]

Comments :


bytecode77(Posted 1+ years ago)

 where is my current dir?CurrentDir$()


Nicstt(Posted 1+ years ago)

 isnt always reliable


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal