SyntaxBomb - Indie Coders

Languages & Coding => Blitz Code Archives => Miscellaneous => Topic started by: BlitzBot on June 29, 2017, 00:28:41

Title: [bb] Where is my current directory? by Nicstt [ 1+ years ago ]
Post by: BlitzBot on June 29, 2017, 00:28:41
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) Select
[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 FilesBlitzPlusin" Or app$ = "F:Program FilesBlitz3Din"
cur_dir$ = "F:Documents And SettingsAdministrator.NSTT1My DocumentsBlitz ProgsSticks n Stones"
ChangeDir cur_dir$
Else
cur_dir$ = SystemProperty ("appdir")
ChangeDir cur_dir$
EndIf

DebugLog "1: " + CurrentDir$()
; *******************************************************************************************************************
; *******************************************************************************************************************
[/code]

Comments :


bytecode77(Posted 1+ years ago)

 where is my current dir?CurrentDir$()


Nicstt(Posted 1+ years ago)

 isnt always reliable