See Also: File I/O Commands, File_Exist, Make_Directory, Make_Temp_File, Remove_Directory, Valid_Drive
To set the current working folder.
Set_Directory {sVariable}
Set_Directory sets the current working folder in variable sVariable.
This example shows how to set the current directory to a folder after checking that the provided folder exists.
Procedure ChangeCurrentFolder
String sFolderName
Boolean bExists
// Retrieve a folder name from a Form or other control
Get Value of oFolderName to sFolderName
File_Exist sFolderName bFolderExists
If (bFolderExists) Begin
Set_Directory sFolderName
End
End_Procedure
Send ChangeCurrentFolder
If the folder specified in {sVariable} does not exist, it will trigger error 4358 DFERR_RAWFILE_ERROR.
You can (and should) use File_Exist to test if the folder exists before attempting to set the working folder to that folder.