>HI, last try...
>
>how do I know if an .EXE file is a VFP exe before call it ?
>
>I got answers that pointed to use AGETFILEVERSION() function and to use the DEBUG command...
>any other?
Here's a thought: I just opened 3 VFP applications in Notepad, and after the usual gibberish, there seems to contain readable strings, most likely function declaration or something. Within those, the string "VisualFoxProRuntime.6" can be found.
So you could open the file using FOPEN(), then look for the "VisualFoxProRuntime.6" string.
Here's a little code that I just made up and that seems to work:
#DEFINE C_STRING "VisualFoxProRuntime.6"
LOCAL x, y
x = FOPEN(GETFILE("EXE"))
FSEEK(x, 5144)
y = FREAD(x, LEN(C_STRING))
IF y == C_STRING
MESSAGEBOX("VFP signature found!")
ELSE
MESSAGEBOX("Sorry, this is not a VFP executable!")
ENDIF
FCLOSE(x)
Note that while it appears to work on VFP6 executable, there is no guaranties (sp?) that it will work on another version of VFP.
HTH!
Sylvain Demers