FF3 Function Library - How do I use this to my advantage

Started by Andy Flowers, November 22, 2009, 05:09:36 PM

Previous topic - Next topic

Andy Flowers

I am seeing alot of posts about adding new functions to the FF3_Function Library. I read the help on this but is still unclear as to the benefits of this new great thing. Please help me understand how to use this to my advantage. Maybe an example or two may shed some light. Right now all of this is as clear as mud to me.

Andy Flowers

Brian Chirgwin

Quote from: Andy Flowers on November 22, 2009, 05:09:36 PM
I am seeing alot of posts about adding new functions to the FF3_Function Library. I read the help on this but is still unclear as to the benefits of this new great thing. Please help me understand how to use this to my advantage. Maybe an example or two may shed some light. Right now all of this is as clear as mud to me.

Andy Flowers

. A function, in its own .inc file, is compiled into the project only if it is used (added to the project from the function library). This reduces the compiled size of the exe. The function is included only once, so it isn't a PB Macro

. You don't need to remember the function name or open an .inc file to find it. Using the Function Library, categorize the functions to make them easy to find. 

. The parameters of the function are listed and added to the code. You don't need to remember the parameter order or data types.

Not everything is good in the Function Library. I have a .inc file which requires some TYPE, enums, etc... and there are initFunctions and close functions. In this case adding the .inc to the Special Function FF_AppStart

I have not yet gone through my own libraries of code yet, so I am just including via the FF_AppStart function; similar to the way I did things in FF2.  As time permits I may move some functions/subs that have no dependencies to the Function Library but I do have some concerns and need to verify some things first.  One concern includes recreating the source from source control. I think including the Function Library in source control will work, but I need to think about it.

At least this is what I have figured out so far. I'd like other opinions as well. 



Paul Squires

Quote
Not everything is good in the Function Library. I have a .inc file which requires some TYPE, enums, etc... and there are initFunctions and close functions. In this case adding the .inc to the Special Function FF_AppStart

That is a great point. If your routines are very complex and depend on each other too much and a bunch of TYPEs, Equates, Globals, then you may be better off just #INCLUDE'ing them via FF_AppStart. The Functions Library is best used for functions that can stand on their own. At least that has been my experience.

Paul Squires
PlanetSquires Software