Numeric data

Just like other systems, NAV supports several numeric data types. The specifications for each NAV data type are defined for NAV independent of the supporting SQL Server database rules. But some data types are stored and handled somewhat differently from a SQL Server point of view than the way they appear to us as NAV developers and users. For more details on the SQL Server-specific representations of various data elements, refer to the Developer and IT Pro Help section. Our discussion will focus on the NAV representation and handling for each data type.

The various numeric data types are as follows:

  • Integer: An integer number ranging from -2,147,483,646 to +2,147,483,647.
  • Decimal: A decimal number in the range of +/- 999,999,999,999,999,99. Although it is possible to construct larger numbers, errors such as overflow, truncation, or loss of precision might occur. In addition, there is no facility to display or edit larger numbers.
  • Option: A special instance of an integer, stored as an integer number ranging from 0 to +2,147,483,647. An option is normally represented in the body of our C/AL code as an option string. We can compare an option to an integer in C/AL rather than using the option string, but that's not good practice because it eliminates the self-documenting aspect of an option field.

An Option string is a set of choices listed in a comma-separated string, one of which is chosen and stored as the current option. Since the maximum length of this string is 250 characters, the practical maximum number of choices for a single option is less than 125. The currently selected choice within the set of options is stored in the option field as the ordinal position of that option within the set. For example, selection of an entry from the option string of red, yellow, blue would result in the storing of 0 (red), 1 (yellow), and 2 (blue). If red were selected, 0 would be stored in the variable; and if blue were selected, 2 would be stored. Quite often, an option string starts with a blank to allow an effective choice if none has been chosen. An example of this (blank,Hourly,Daily,Weekly,Monthly) follows:

  • Boolean: A Boolean variable is stored as 1 or 0, in C/AL code is programmatically referred to as True or False, but sometimes referred to in properties as Yes or No. Boolean variables may be displayed as Yes or No (language dependent), P or blank, True, or False.
  • BigInteger: 8-byte Integer as opposed to the 4 bytes of Integer. BigIntegers are for very big numbers (from -9,223,372,036,854,775,807 to 9,223,372,036,854,775,807).
  • Char: A numeric code between 0 and 65,535 (hexadecimal FFFF) representing a single 16-bit Unicode character. Char variables can operate either as text or as numbers. Numeric operations can be done on char variables. Char variables can also be defined with individual text character values. Char variables cannot be defined as permanent variables in a table, but only as working storage variables within C/AL objects.
  • Byte: A single 8-bit ASCII character with a value of 0 to 255. Byte variables can operate either as text or as numbers. Numeric operations can be done on Byte variables. Byte variables can also be defined with individual text character values. Byte variables cannot be defined as permanent variables in a table, but only as working storage variables within C/AL objects.
  • Action: A variable returned from a PAGE RUNMODAL function or RUNMODAL (Page) function that specifies what action a user performs on a page. Possible values are OK, Cancel, LookupOK, LookupCancel, Yes, No, RunObject and RunSystem.
  • ExecutionMode: Specifies the mode in which a session is running. The possible values are Debug or Standard.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.69.143