Hi Fabian;
DEBUG comand only works in VFP, why dont you try something like this:
lAnyError=.f.
lcOldError = ON('ERROR')
On ERROR lAnyError = .T.
DEBUG
If lAnyError
Wait window "I am running at .EXE file " nowait
return
Endif
On ERROR &lcOldError
..Or, Try something that can be recognized only at VFP !
CLAUDIO
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20