ChDir
Changes the current drive and directory
result = ChDir( path )
Returns zero (0) on success and negative one (-1) on failure.
Changes the current drive and directory to that specified.
Syntax
Usage
result = ChDir( path )
Parameters
Return Value
Returns zero (0) on success and negative one (-1) on failure.
Description
Changes the current drive and directory to that specified.
Example
Dim pathname As String = "x:\folder"
Dim result As Integer = ChDir(pathname)
If 0 <> result Then Print "error changing current directory to " & pathname & "."
Dim result As Integer = ChDir(pathname)
If 0 <> result Then Print "error changing current directory to " & pathname & "."
Platform Differences
- Linux requires the filename case matches the real name of the file. Windows and DOS are case insensitive.
- Path separators in Linux are forward slashes / . Windows uses backward slashes \ but it allows for forward slashes . DOS uses backward \ slashes.
Differences from QB
- In QB, the drive could not be specified.
See also