The following code sample shows how to invoke the Win32 API SetCurrentDirectoryA Function to change the current Working Directory of the 4GL/ABL session to: "C:\OpenEdge\WRK101B":
DEFINE VARIABLE iResult AS INTEGER NO-UNDO.
RUN SetCurrentDirectoryA (INPUT "C:\OpenEdge\WRK101B", OUTPUT iResult).
IF iResult = 1 THEN MESSAGE "Current directory has been changed" VIEW-AS ALERT-BOX.
ELSE MESSAGE "Directory does not exist, or access is denied" VIEW-AS ALERT-BOX.
/* Define the entry point for the external DLL function */
PROCEDURE SetCurrentDirectoryA EXTERNAL "KERNEL32.DLL":
DEFINE INPUT PARAMETER chrCurDir AS CHARACTER.
DEFINE RETURN PARAMETER iResult AS LONG.