Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How do I use a particular version of a prg?

How do I use a particular version of a prg?

How do I use a particular version of a prg?

I use west-wind web connection libraries a lot. I have some programs that are many years old and that use older versions of some of west-wind's prg's. I am writing a new program. It must use the latest version of a few of the west-wind prg's. So that I do not adversely effect those older programs, I need to tell my new program to use the newest versions of west-wind's prgs. That is such a twisted loop of a conversation so let me try to be more specific.

I have a project that uses wwapi.prg, wwhttp.prg, wwutils.prg and wwxml.prg. These files are included in the project. They have been used for many years. The project has to continue using these old versions of these prgs.

I am adding a new prg to this same project. Somewhere in this new prg I need to say:
do wwapi (but run the latest version)
do wwhttp (but run the latest version)
do wwutils (but run the latest version)
do wwxml (but run the latest version)
Do some stuff
set everything back so these newer versions of these 4 prgs are unfindable

How would I do that? I know it may be something like set procedure to ... additive but not sure at all. This type of procedures and libraries and environment stuff has never by my strong suit.

RE: How do I use a particular version of a prg?

It may not be impossible to combine several versions of web connection, it shouldn't be hard to upgrade all usage to one version. I'd not even try to mix old and new versions.

To still answer your direct question, if files have the same name you're unlucky, within the IDE you can of course address a specific file, but including both a version A and a version B prg, the final EXE will not enable you to distinguish them. So you'd need to start excluding these PRGs to work around that, not a nice perspective.

Using SET PROCEDURE just helps VFP to find PRGs without needing to address the full path, that's not helping you at all, contrary to what you like to achieve it would introduce the problem you have in a final EXE to the IDE environment. Since I know west wind programs use SET PROCEDURE within their code, that's actually something that makes using two different versions harder rather than simpler, even if you yourself address the specifc file in your code, usage of a prg usually does SET PROCEDURE to itself.

So, again, you better upgrade code to make use of the latest versions overall. It shouldn't at all be as much work as you fear it is, because of compatibility.

As an aside, that won't help you: With different DLL versions used by DECLARE DLL you have AS Aliasname with SET CLASSLIB you have AS Aliasname, with SET PROCEDURE you don't have that mechanism for differentiation.

Problems already start if you try to include two PRGs of the same name in two directories. What still works within the IDE then fails to build. VFP clearly doesn't like this kind of parallel usage of different versions of the same libraries and you'd need to cater for it by programming respectively, with version numbers in the class/function/procedure names, for example. I doubt anybody would like a library that instructs you to CLEAR PROGRAMM and/or CLEAR CLASS and/or even CLEAR CLASSLIB after any single call of a function or instantication of a class to let VFP forget what it buffers for usually faster usage, just so that changing to another VCX or PRGR with essentially the same things in older or newer versions does use them instead of what was first used.


RE: How do I use a particular version of a prg?

Thanks Chris, Well your solution is the SMART solution albeit, yes I do dread it. It would be a much better world if I just suck it up and get that done. I'll set down that path. Thanks and have a good day,

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close