[Implemented] GetCurDir or something!

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] GetCurDir or something!

Post by BackupUser »

Restored from previous forum. Originally posted by TronDoc.

I've been through all of the dox...File...FileSystem...GetFilePart
GetPathPart...none of these address this issue....I've searched the forums.
viewtopic.php?t=18 Current Directory&Forum_Title=Tricks %27n%27 Tips
is a valiant effort at a work-around..

we really need some way to get rid of having to use FULL PATHNAMES.
a built-into-PureBASIC command that
will work on WinOS, AmigaOS and LinuxOS
that gets the current directory into a string
would help immensely...especially while troubleshooting!

I keep having to cut and paste things like:
C:\APPSWIN\PROG\PureBasic\!MORECODE\0119PBX\registry\testfile.bin
Joe Block
P.S. a KillDir() function is common in many BASICs also
P.P.S. maybe I'm just having another bad day - the doc reduced my meds..
elecTRONics DOCtor
{registeredPB}

Edited by - TronDoc on 02 February 2002 02:48:24
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> also, wouldn't it be more logical that the executable
> operate on files in its current directory by DEFAULT?

But it does... compile the following into an executable, then run it, and the
test file will be created in the same folder as the executable.

Code: Select all

r=createfile(0,"test.txt")
if r0
  writestringn("worked")
  closefile(0)
endif

PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TronDoc.

my mistake, I was once again refering to the IncludeBinary problem I have..
..it seems to work without a path for some folks and not for others....

Code: Select all

MyIncludeFile:
IncludeBinary "filename.ext"
the first time (EVERY first time) that I try to compile the code I get
this message box:
ASSEMBLY ERROR!
PLEASE MAIL US THIS FILE.

if I attempt to compile the code after acknowledging the
error I get this message box:

ERROR REPORTED:
Line ##: Included file not found: filename.ext

Edited by - TronDoc on 02 February 2002 02:50:59
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Have you tried using the IncludePath command??
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TronDoc.
Have you tried using the IncludePath command??
no...I'll have to do that. thank you.
the other issues still pend.....

Edited by - TronDoc on 02 February 2002 02:52:10
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.
it just doesn't make sense that
some users/don't have to do
anything special for it
to work..
I've misunderstood your problem, and now I acknowledge that I have the same
problem as you. I'm looking into it now to see if there's a way to do it.
Rest assurred I'll post anything I find here!

UPDATE: Yep, it's a bug. Even using IncludePath doesn't make it work.
Fred, can you make the next version of the editor make IncludeBinary search in
the same path as the *.pb file being edited? Thanks!


PB - Registered PureBasic Coder

Edited by - PB on 01 February 2002 23:22:47
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TronDoc.
it just doesn't make sense that some users/don't have to do
anything special for it to work..
I've misunderstood your problem, and now I acknowledge that I have the same
problem as you. I'm looking into it now to see if there's a way to do it.
Rest assurred I'll post anything I find here!
UPDATE: Yep, it's a bug. Even using IncludePath doesn't make it work.
Fred, can you make the next version of the editor make IncludeBinary search in
the same path as the *.pb file being edited? Thanks!
PB - Registered PureBasic Coder
whew! I thought I was going crazy for a little while there...thanks...jb
Post Reply