Hi,
I am trying to better familiarize myself with Custom Functions and am going through some very basic exercises to get an understanding of how they can be used in calculations, and also make use of global variables as parameters. Along the way I've run into what to my eyes seems a bit odd. I'm hoping a more experienced developer can help me understand why. I've created the following:
Custom Function:
name: TESTFUNCTION
Parameters: PAR1; PAR2
TESTFUNCTION( PAR1; PAR2 ) = PAR1 + PAR2
Calculation Field:
= TESTFUNCTION( $$PAR1; $$PAR2 )
*Calculation result is Number
Script: (to set the variables $$PAR1 and $$PAR2)
1. Set Variable [ $$PAR1; Value: $$PAR1 + 1 ]
2. Set Variable [ $$PAR2; Value: 2 ]
I've placed the field on a layout and am expecting that when I run the script, the value in the field will change, but the field data is not changing. However, when I change the properties of the calculation field such that the calculation result is text, the value does change as expected. Can someone help me understand why this is not working when the calculation is set to output a number.
Thanks in advance!
Daniel
ps If there is a better for for this topic amongst the many forums, I apologize. I am currently using FM Advanced 17 so this was the appropriate place I could find.