Previous: Break procedure To the Table of Content Next: Chr function

- 4.62.2.11 -
Standard Units
System Unit
System Unit Procedures and Functions

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


Previous: Break procedure To the Table of Content Next: Chr function
Break procedure Table of Content Chr function

- 4.62.2.11 -