>I like to find a way to know if I am running a APP or EXE.
>Is there a SYS() function that I can use to know?
FULLPATH(SYS(16,0)) will tell you the full name of the module run at the top level If it's an app as opposed to an .EXE, you should be able to tell.