wexist() seems safest to me.
Please note that this is language-specific. E.g., in Spanish VFP, I have to check for WEXIST("Depurador de Visual FoxPro").
Hilmar.
>Although it doesn't tell if the debugger is open, _VFP.StartMode will tell you if you are running your app/exe in the FoxPro environment or not.
>_VFP.StartMode = 0 means you are running in the VFP environment.
>_VFP.StartMode = 4 means you are running as stand-alone.
>
>Also, borrowing from someone else's post in this thread, you could try something like WEXIST("Visual FoxPro Debugger").
>
>>Is there some way to tell if the debugger is being run?
>>
>>I.e. I want something that in pseudocode would look like..
>>
>>IF THE CODE IS BEGIN RUN THROUGH THE DEBUGGER
>> DO THIS
>>ELSE
>> DO THIS
>>ENDIF
>>
>>
>>THANKS!!!!
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)