Quantcast
Channel: Sage X3 – Tips, Tricks and Components
Viewing all articles
Browse latest Browse all 1524

Checking the Type of variable

$
0
0

Sometimes when you do coding, you may come across a situation where you don’t  know  what is the data type of the variable and you may be initializing the variable which may give you “Type compatibility error”. This issue can be handled in the code. If you have a check on this variable with the help of “Type” keyword which will return you the value depending on the type of variable. TYPE can also be used to check the existence of variable.

New Stuff: Populating the description of the field using X3 methodology

Type : type  is used to find the type of variable. It can also be used to test the existence of variable

Syntax:

type(Varaible)

Parameter details:

Variable : name of the variable whose type is to be tested.

type returns a code for the type of variable given in the parameters. This code has the following values

Code returned Data type
-1 Non- Existence of Variable
1 Text
2 Short Integer
3 Date
4 Long Integer
5 Float
6 Double
7 Decimal
>10 Char

Kindly refer to the below snippet of code for better understanding

Var-1

Also Read:
1) Checking the Existence of variable
2) How to check “Active” Activity Code
3) Global Variables in X3
4) Login Warning on Logical Date in Sage X3
5) Determine Calling Screen in Sage X3


Viewing all articles
Browse latest Browse all 1524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>