OAProfessor

Deep OA Product Insight

User Tools

Site Tools


dp_fct_expressions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dp_fct_expressions [2023/04/19 18:38] toddmalonedp_fct_expressions [2023/04/19 18:52] (current) toddmalone
Line 29: Line 29:
 </code> </code>
  
 +
 +Another feature of the dp_fct is to call a library function.  This is pretty advanced and allows for more complex logic.  Be careful, this script is running in the EVENT manager, don't do things that are "waiting functions" like system() and complex dpQuery sql.
 +
 +To use a function, you will still need to setup the p1, p2, etc. as these become the library variables passed into the function.  In the function field, just put the function name and parameters like:  tableLookup(p1, p2).  The function must return a value which is the same type as the DPE where this dp_fct is configured.
 +
 +The trick to all this is to setup the system to recognize your functions in the library.  I recommend to make a special lib .ctl file for just dp_fct so that it is easier to load.  You will need to put a couple of lines in the config file:
 +<code>
 +[event]
 +loadCtrlLibs = "dpfct.ctl"
 +</code>
 +
 +A function might look like this:
 +<code>
 +float tableLookup(anytype p1, anytype p2)
 +{
 +  float fRet;
 +  // table lookup with arrays, mapping, etc. where fRet = something
 +  return(fRet);
 +}
 +</code>
  
dp_fct_expressions.1681929489.txt.gz · Last modified: by toddmalone

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki