Differences

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

Link to this comparison view

cfl_ch_4-constants [2019/01/30 09:22]
127.0.0.1 external edit
cfl_ch_4-constants [2019/01/31 11:25] (current)
kcifreo
Line 1: Line 1:
- 
- 
- 
- 
 Many numbers used in computations are not easy to remember. As an example, whole books are written to calculate the value of PI to one million decimal places. Many numbers used in computations are not easy to remember. As an example, whole books are written to calculate the value of PI to one million decimal places.
- 
- 
  
 CFL uses names to represent these constant values. These constant names can be used in a formula anywhere a number can be used. CFL will automatically replace the constant with its appropriate value. CFL uses names to represent these constant values. These constant names can be used in a formula anywhere a number can be used. CFL will automatically replace the constant with its appropriate value.
  
 +===== Built-In Constants =====
  
 +|**Constant** ||**Value** ||**Description** ||
 +|FALSE||0||The Boolean value for FALSE||
 +|LN2||2.71828…||The natural log constant||
 +|NO||0||The Boolean value for FALSE||
 +|NoDate||0||The system value used when no date is entered||
 +|OneDay||1||One Day of Time in a DateTime Type||
 +|OneHour||1/​24||One Hour of Time in a DateTime Type||
 +|OneMinute||1/​(24*60)||One Minute of Time in a DateTime Type||
 +|OneSecond||1/​(24*60*60)||One Second of Time in a DateTime Type||
 +|PI||3.14159…||The ratio of a circle to its diameter||
 +|TODAY||Current Date/​Time||This (pseudo) constant returns the current date and time in a DateTime Type||
 +|TRUE||1||The Boolean value for TRUE||
 +|YES||1||The Boolean value for TRUE||
  
-Built-In Constants+Store-Wide Constants
  
 +|**Constant** ||**Returns the value setup in pricing setup as the default multiplier for...** ||
 +|DefaultEquipmentMultiplier||Equipment||
 +|DefaultFreightMultiplier||Freight||
 +|DefaultLaborMultiplier||Labor parts||
 +|DefaultMaterialMultiplier||Materials||
 +|DefaultOtherMultiplier||Other parts||
 +|DefaultOutsourceMultiplier||Outsourced items||
 +|DefaultOverheadMultiplier||Overhead||
  
- 
-|| **Constant** || **Value** || **Description** || 
-|| FALSE || 0 || The Boolean value for FALSE || 
-|| LN2 || 2.71828… || The natural log constant || 
-|| NO || 0 || The Boolean value for FALSE || 
-|| NoDate || 0 || The system value used when no date is entered || 
-|| OneDay || 1 || One Day of Time in a DateTime Type || 
-|| OneHour || 1/24 || One Hour of Time in a DateTime Type || 
-|| OneMinute || 1/(24*60) || One Minute of Time in a DateTime Type || 
-|| OneSecond || 1/​(24*60*60) || One Second of Time in a DateTime Type || 
-|| PI || 3.14159… || The ratio of a circle to its diameter || 
-|| TODAY || Current Date/Time || This (pseudo) constant returns the current date and time in a DateTime Type || 
-|| TRUE || 1 || The Boolean value for TRUE || 
-|| YES || 1 || The Boolean value for TRUE || 
-Store-Wide Constants \\ || **Constant** || **Returns the value setup in pricing setup as the default multiplier for…** || 
-|| DefaultEquipmentMultiplier || Equipment || 
-|| DefaultFreightMultiplier || Freight || 
-|| DefaultLaborMultiplier || Labor parts || 
-|| DefaultMaterialMultiplier || Materials || 
-|| DefaultOtherMultiplier || Other parts || 
-|| DefaultOutsourceMultiplier || Outsourced items || 
-|| DefaultOverheadMultiplier || Overhead || 
 This value is normally multiplied by the outsourced costs to determine their price. This value is normally multiplied by the outsourced costs to determine their price.
  
- +===== User-Defined Global Constants ​=====
- +
-User-Defined Global Constants +
- +
  
 CFL allows the user to create custom built-in constants. All these global constants are accessible from CFL. It is common to preface a constant with "​gc"​ as in the following examples. This is not necessary, but helps to jog the memory a few months later. CFL allows the user to create custom built-in constants. All these global constants are accessible from CFL. It is common to preface a constant with "​gc"​ as in the following examples. This is not necessary, but helps to jog the memory a few months later.
- 
- 
  
 <​code>​ <​code>​
Line 56: Line 44:
 Const gcPromotionEndDate ​ #​12/​31/​2007#​ Const gcPromotionEndDate ​ #​12/​31/​2007#​
 </​code>​ </​code>​
- 
- 
  
 Global Constants can have units or be unit-less. They can be strings, numbers, or dates. They are also infrequently used for items that vary. Once a global constant has been created, it can be used in any formula as shown in the following examples: Global Constants can have units or be unit-less. They can be strings, numbers, or dates. They are also infrequently used for items that vary. Once a global constant has been created, it can be used in any formula as shown in the following examples:
- 
- 
  
 <​code>​ <​code>​
Line 68: Line 52:
 </​code>​ </​code>​
  
 +A few rules apply to creating global constants and variables.
  
- +  ​- A global constant and a variable cannot have the same name. 
-A few rules apply to creating global constants and variables.  +  - A text constant must be less than 50 characters.
-  ​- A global constant and a variable cannot have the same name.  +
-  - A text constant must be less than 50 characters. ​+
   - Global constants must follow the same naming convention as variables.   - Global constants must follow the same naming convention as variables.
  
 +See Also
  
- +\\
-See Also+