Advanced PowerBuilder

HomePrevious Lesson: Finding the Current Directory
Next Lesson: Creating a Directory

Setting the Current Directory

Declare a local external function as shown below.
FUNCTION boolean ufx_SetCurrentDirectory(ref string &
         cdir) LIBRARY "kernel32.dll" ALIAS FOR &
         "SetCurrentDirectoryA"

The following code sets the current directory to the specified directory.
// Object: cb_display_current_dir
// Event: Clicked
string ls_Dir
ls_Dir = sle_CurrentDir.Text
ufx_SetCurrentDirectory( ls_Dir )
HomePrevious Lesson: Finding the Current Directory
Next Lesson: Creating a Directory