Mike Yearwood
Toronto, Ontario, Canada
Hi Bill
A raw .prg UDF is faster than a method of a class.
>I want to ship compiled code to be used with a desk top exe. The procecures are created from tabular data. -- case statements based on logic that must be evaluated sequentially -- Since the rules are based on many different variables, the determination of a result is not as simple as a single or even multi key lookup. I created an fxp file that produced a huge preformance improvement. Now it isseven times faster than a looping structure that sequentially evaluates sets of rules. The rules are produced in a 5 table join. Now I am able to do the joins in the creation of the fxp rather than at runtime. I think speed also results from logic evaluation in the compiled code rather than through parsing of words in the case statements.
>
>Now I'm wondering what is the best suggestion for accessing the code at runtime. I may not be able to get the code included in the exe and the application doesn't use a container (no stored procedures). It seems that there are 6 options. What are the pros and cons?
>
>1. Set procedure to the fxp. Nested cases.
>2. Set procedure to the fxp. Many Procs within the fxp.
>3. Create a prg-based class with many methods.
>4. Create a vcx with many classes? (Having trouble with this because when I run the following code, the class is not recognized when I try to instantiate it.
>
>(xxxproc is the foxpro code
>propstring is a list of properties)
>
>thisclass = "xyz"
>CREATE CLASS &thisclass OF carcalc as "Custom"
>USE carcalc.vcx
>LOCATE for objname = thisclass AND baseclass ="custom"
>REPLACE methods with xxxproc,PROPERTIES WITH PROPSTRING,RESERVED1 WITH "Class",Reserved1 WITH "1"
>
>5. Execscript on memo fields.
>6. Put compiled code in memo fields,write to file, and execute.
>
>The VCX seems like a good place to put the code. I would probably eliminate the readable code and ship only the compiled code. I just can't get the right method to make it.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only