I tried this code:
LOCAL lcDirName
lcDirName = ""
lcpath = "D:\tom\data\"
lcDirName = GETDIR(lcPath,'Store data where?')
?lcdirname
?type('lcdirname')
in both the command window and as an EXE. I tried both picking a directory and canceling. A character value was returned each time. This is in 5.0a Build 415.
Do you see the problem you describe with exactly the code you posted? Or is it a summary? If a summary, I suggest you try the example and see if it is really due to the GETDIR().
>The code fragment below works from the command line and when
>I go to the debug window and come to the top of the code
>fragment and choose "Set Next Statement".
>
>This very bizzare behavior is occuring in an APP under
>VFP 5.0a.
>
>
>I am running the following code where oApp.cDataPath = "D:\tom\data\"
>and lcDirName returns a numeric 3.
>
>LOCAL lcDirName
>lcDirName = ""
>IF TYPE("oApp.cDataPath") = "C" AND NOT EMPTY(oApp.cDataPath)
> lcpath = oApp.cDataPath
>ELSE
> lcpath = ""
>ENDIF
>
>lcDirName = GETDIR(lcPath,'Store data where?')