Description
Shows how to pass a number to or convert a number from a variable which has been created as a Unit Variable [our term, not Cyrious's] meaning a variable where the unit option has been selected and a unit like inches has been chosen as shown in the screen shot below. The unit type is Length and the units expected in data entry are inches and the number returned (displayed) is inches..
When a pricing_ch_07-global_variables is given a unit designation, any number “stored” for that variable is stored in centimeters. [The screen shot below shows the System Variable Height set up as Unit Type Length and the Units it expects for entries made to it as well as the other types of units which might be selected]. Click this link list of all units available for use within Control and their relevant factor formulas that are used internally by Control to calculate the conversion. Thereafter, whenever the variable is called, it returns the basic centimeter value converted to the designated unit. For example, when a 7 is entered in a variable like Height which is an Inch Unit Variable, it actually stores the number as 17.78. Whenever cfl_reference encounters this variable, it divides by 2.54 to convert it back to Inches. When calling the variable in CFL, the correct code is Height in Inches. If the conversion function is omitted, Cyrious will return the 17.78 centimeters number. When passing variables to these numbers as, for example, you would want to do if drawing the height from a Property value, the number must be converted by code to the proper base centimeter number to get the correct result.
Always test code carefully using various magnitudes of numbers in a live product as well as the how_to_preview_test_cfl_coding_resultsr before unleashing it on a user population.
ListPropertyValue(VariableName,"Property Name",0)* 2.54 //2.54 is the conversion number to convert this number to the higher centimeters number OR ListPropertyValue(YourVariable,"Height2",0) Inches //Inches is the CFL function which converts Centimeters to Inches //Per Lori the Inches function supplies the multiplier to convert from a number to //centimeters and the function In Inches supplies the Divisor to convert from //centimeters back to inches,
Contributor: Steve Gillispie, Acorn Sign Graphics
Date:06/03/2009
Version: Control 4.04.40.1003.3102