I am using Adobe Acrobat to print to PDF. To do this, I have to
write to the Registry the name of the executable. How do I determine
this? My thoughts so far:
If the app is running as a collection of .fxp files under VFP,
then VFP is the actual executable. How do I find out the name of the
VFP executable? (I mean the name of the .exe that is VFP.)
If the app is running as an .exe, then sys(16,1) does it.
If the app is running as an .exe under VFP, then VFP is the
actual executable (I think). I can distinguish between this case and
the one before using version(2).
I think there might be other possibilities such as .app. (I have
never used a .app, nor do I even know how they are created.) There is
also the possibility of one .exe calling another and on and on. If I
have the first three above, that should do it for my case, and I need
them anyway before experimenting with the rest.
This is somewhat important as my app printing will not work
properly under the full VFP. This means that I would not have access
to the debugger and that I would have to build the .exe each time I
want to test anything to do with PDF printing.
Here is my code so far:
***** Start of Included Code *****
* tryname
* Try to Get Name of Executable
* Last Modification: 2006-10-25
? "*** Execution begins."
set talk off
local sys16name, apptype, underruntime, vfpexe, appname
sys16name=sys(16,1)
apptype=upper(right(sys16name,4))
underruntime=version(2)=0
vfpexe="***insert name of VFP executable***"
do case
case apptype=".FXP"
appname=vfpexe
? "running as .fxp under "+appname
case apptype=".EXE" and !underruntime
appname=vfpexe
? "running as .exe named "+appname
case apptype=".EXE" and underruntime
appname=sys16name
? "running as .exe under "+appname
otherwise
appname="???"
? "running in unknown state"
endcase
wait
? "*** Execution ends."
return
***** End of Included Code *****
Sincerely,
Gene Wirchenko
Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.