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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP7 cannot find utility.prg

Status
Not open for further replies.

andre65

Programmer
Jan 19, 2003
95
NL
I have an application created with VFP60. Now while testing this application with VFP70, strange things happens.

In a Form I put code: p_set_env() which is a procedure in UTILITY.PRG. The first thing to do when starting the application is: SET PROCEDURE TO UTILITY.PRG

Now this works fine when using VFP60, but when using VFP70, I get a runtime error: cannot find program p_set_env (the Forms have all Private Datasessions)

Anyone knows what's going on here?
... I noticed that the compiler of VFP70 is more strict, so compiling VFP60 code succesfully, sometimes does not compile the first time using VFP70.

Thanks for any reply.
André
 

Are you using the ADDITIVE clause in your SET PROCEDURE TO?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
No, I just appended ADDITIVE, but has the same result.
 
just to be sure...you are using ADDITIVE on all of the set procedure to commands in your system? Or at least the ones that could potentially remove the utility.prg as one of your procedure files...such as would be the case with:

Set procedure to Utility.prg Additive
Set Procedure to SomethingElse.prg &&utility.prg will no longer be referenced

boyd.gif

 
I have only one entrypoint (in MAIN.PRG) where I have the line SET PROCEDURE TO UTILITY.PRG

The strange thing is, that I have also a function called F_PUT_SYSUSER in UTILITY.PRG where runtime error [Operator/Oprand type mismatch] occurs. So it looks like VFP70 does see this function???
 
Ok next questions:

Since I've done it myself in the past...are you sure that the number of underscores "_" match between the call to that function that is throwing the error and the function itself? "p_set_env" as opposed to "p__set__env"

Are you sure that there isn't a semi-colon directly above the function p_set_env in utility.prg that would cause VFP to treat it like a comment (I would expect maybe some other errors on compile with this, but it could happen)?

Are you sure you don't have a single other "Set Procedure To" line in your entire project or any of the classes or apps it uses?

boyd.gif

 
I have found the problem.

In procedure P_SET_ENV I have a line SET HELP TO MYHELP.CHM
Now file MYHELP.CHM does not exist.
The runtime error from VFP70 suggest that P_SET_ENV is not found, but is the help file.

Thank you Mike and Craig for your suggestions and help!

André
 
andre65,

Glad to hear you found the problem. I'm still a little confused by it all though. First, there isn't an error that I know of that would have the error message "cannot find program 'p_set_env'", I even consulted the help's listing of error messages and couldn't find one that matched. If VFP was giving you the error "File 'P_SET_ENV' does not exist on the call to p_set_env, I don't see how it even saw the SET HELP TO command. Plus, with the SET HELP TO command, VFP should throw a File does not exist error without referencing any file name.

boyd.gif

 
Craig: to be exact, the error message was [File does not exist] referencing to P_SET_ENV.

André
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top