1. Computing
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

SetCurrentDir

unit
Sysutils
category
file management routines

declaration
function SetCurrentDir(const sNewDir:string): boolean;

description
Sets the current directory.

Function returns True if the directory specified in sNewDir was successfully set as the curent, False otherwise.

example
var sAppDir : string;

//app path
sAppDir := ExtractFileDir(ParamStr(0));

if Not SetCurrentDir(sAppDir) then 
  raise Exception.Create
       ('Unable to set current dir.');

in real code

see also
GetDir, GetCurrentDir,


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

©2013 About.com. All rights reserved.