QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The _CWD$ function returns the current working directory path as a string value without a trailing path separator.

Syntax

workingDirectory$ = _CWD$

Description

Error(s)

Example(s)

Get the current working directory, and move around the file system:


startdir$ = _CWD$
PRINT "We started at "; startdir$
MKDIR "a_temporary_dir"
CHDIR "a_temporary_dir"
PRINT "We are now in "; _CWD$
CHDIR startdir$
PRINT "And now we're back in "; _CWD$
RMDIR "a_temporary_dir"


We started at C:\QB64
We are now in C:\QB64\a_temporary_dir
And now we're back in C:\QB64

See Also