- 4.67.2.11. -
Table of Contents
4. Standard Units
4.67. System - Built-in routines
4.67.2. System Unit Procedures and Functions
4.67.2.11. ChDir procedure
4.67.2.11. ChDir procedure
Targets: MS-DOS, OS/2, Win32
System Unit
Changes the current directory.
Declaration:
procedure ChDir(S: String);
Remarks:
With {$I-}, IOResult returns an error code
if an error occurred, otherwise IOResult
is set to zero. The current directory is changed to the path specified by
S. If S specifies a drive letter, the current drive is also
changed.
Example:
{$ifndef __CON__}
This program must be compiled as console application only
{$endif}
begin
{$I-}
ChDir('MyDir');
{$I+ }
if IOResult <> 0 then
WriteLn('Directory does not exist');
end.
See also:
{$I} - I/O Checking Switch
- 4.67.2.11. -