Qbasicnews.com

Full Version: How to get the current directory path with FreeBasic?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I am a QB user trying to adapt myself to FreeBasic.

I saw that FreeBasic uses Dir$ function instead of FILES statement to read files.
I am needing to read the current directory path when getting a file list, that in QB could be made (for instance) by capturing the first line of the FILES statement's output text.

How do I properly get the current directory path with FreeBasic?

Thank you,
-Izan

Anonymous

you can get the path that the exe resides in with the function EXEPATH. try this proggie


Code:
? EXEPATH
Sleep
You can also get *just* the exe name by doing this:

Code:
dim exe_name as string
exe_name = dir(command$(0))
print exe_name
sleep
I dont think he wants the exe path, he wants the current path, which could be something else. If I am right, you want the Curdir $ command

Anonymous

good call deleter :chinese:
Thanks everybody for the fast and useful replies!
Yes Deleter, CurDir$ is exactly what I was looking for!
-Izan