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!!!!