Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program running from Debugger or EXE? 1

Status
Not open for further replies.

jlcca

Programmer
Jul 28, 2010
20
Canada
I am developing a console application using VFP9.

At present, I do
Code:
ext = JUSTEXT(Sys(16))

...to determine the file extension of the complete application path.

When I am in the debugger, this returns FXP, thus (partial code)
Code:
If ext = "FXP" then
  ? theRecord
Else
  .WriteLine( theRecord )
Endif

...allows me to print the results to the VFP screen when in the VFP IDE or Debugger. All works as I want it to.

Question: Is this the best way to determine if I am running a program from within the VFP IDE/Debugger, or is there a better way than JUSTEXT(Sys(16))?

FYI, I use;
Code:
editbin.exe /nologo /subsystem:console console.exe
in the AfterBuild event to make the compiled .exe into a true console .exe

Joe
 
FXP will not point out running within EXE. Simply ExecScript("? Sys(16)") from command window or anywhere within the IDE.

There is _vfp.startmode to detect running within the IDE (0) or anything else (>0), the help topic will tell you about the differences.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Hey Olaf,
[tt]_vfp.startmode[/tt] seems the better method. Thanks!

Joe
 
Hi,

You can also make use of the function version().
Version(2) # 0 &&& We are in Development Mode
Koen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top