Main Board > Nomads
Logic with Numeric Multi_lines
James Zukowski:
I'm using a generated File Maint program to work on a file that has numeric fields in it. When I want to refer to these values in Logic procedures in a multi_line, I seem to get inconsistent results. Which of these should I actually use?
* Field_Name
* Field_Name.Ctl'Value
* Field_Name$
* Field_Name.Ctl'Value$
Thanks!
Thomas Bock:
We use "Auto Refresh" in the header properties and Field_Name / Field_Name$ in the logic. This way you can keep a lean code. If you omit the header property, then you must use the control properties Field_Name.ctl'value($).
James Zukowski:
But if I have a numeric field variable, do I use the Field_Name or Field_Name$ in the procedures?
Mike King:
If the control is set as number then use the numeric variable.
James Zukowski:
I guess that calls into question whether I should set up the control as Number if the data field is numeric. In the generated F/Ms, the Num_To_Str routine is called after reading the record, and Str_To_Num before being rewritten. Which suggests I should use the controls as strings, not numbers, even though the underlying file variable is numeric.
Clarification? Is this the way to go?
Navigation
[0] Message Index
[#] Next page
Go to full version