Centralizing new or existing Foxpro code for re-use in AVFP - UPDATE

Coordinator
May 4, 2012 at 4:54 PM

The existing documentation was kind of fuzzy on this topic so I clarified it somewhat:

Custom or existing VFP Functions, Procedures, Methods can use the traditional ways to centralize VFP code:

SET PROC TO  ... ADDITIVE,

CREATEOBJECT,

etc  (see examples).  These objects will be cached by IIS and perform very fast.  If you will make changes to these libraries, you must release them from memory using their release commands.  Otherwise, IIS won't let you change these objects unless you re-cycle the App or IIS.

Here are some examples:

In any .avfp page (AVFP 5.61) or .htm page (5.51):

<% oAA=newOBJECT('schedbizobj','c:\avfp5.61Demo\prg\utiltest2.prg') %>

<%=oAA.test3('news')%>

<% oAA=null

CLEAR CLASS ('schedbizobj')

CLEAR PROGRAM ('prg\utiltest2.prg')

%>

OR

<% SET PROC to 'c:\avfp5.61Demo\prg\utiltest' ADDITIVE %>

<%= test3('new')%>

<% RELEASE PROCEDURE 'c:\avfp5.61Demo\prg\utiltest'%>

 

Alternatively, in main.prg, at the top of the CASE statement:

oAA=newOBJECT('schedbizobj','c:\avfp5.61Demo\prg\utiltest2.prg')

OR

SET PROC to 'c:\avfp5.61Demo\prg\utiltest' ADDITIVE

AND, at the bottom of the CASE statement:

oAA=null

CLEAR CLASS ('schedbizobj')

CLEAR PROGRAM ('prg\utiltest2.prg')

 

OR

RELEASE PROCEDURE 'c:\avfp5.61Demo\prg\utiltest'