Skip to content

BASIC CD Statement

Mike Hogsett edited this page Aug 10, 2024 · 1 revision

CD

TYPE: plusBASIC disk statement


FORMAT: CD

Action: prints the current directory path.

Examples:

CD

Immediately after boot up prints the string "/"

FORMAT: CD path-spec

Action: Changes the current directory to the path specified by the path-spec.

  • Prints "Ok" upon successful current directory change.
  • Without and SD card inserted will print the "No disk error".
  • An invalid directory path will print the "File not found error".

Examples:

CD "/"

Changes current directory to root directory of the SD Card.

CD "/roms"

Changes current directory to /roms/ directory of the SD Card.

CD "/roms/"

Changes current directory to /roms/ directory of the SD Card.

CD "."

Changes current directory to the current directory. Essentialy does nothing.

CD ".."

Changes current directory to parent directory of the current directory.


CD$

TYPE: plusBASIC disk statement


FORMAT: CD$

Action: Returns a strings containing the current directory path.

Examples:

CD /roms
D$=CD$
PRINT D$

Prints /roms

Clone this wiki locally