Variable Types (Datatypes)
Description:
AutoWeb Variable Types:
|
Integer |
All whole numbers, positive, zero, and negative. Ranging from –32768 to +32767. Mathematical operations can be performed on Integers. Use Integers for counters, pointers, row numbers, etc. The default value for an Integer is 0. |
|
Decimal |
Signed decimal numbers with up to 18 digits. You can place the decimal point anywhere within the 18 digits—for example: 123.456, 0.000000000000000001 or 12345678901234.5678. AutoWeb does not support Decimals with a fixed number of decimal places. Mathematical operations can be performed on Decimals. Use Decimals for monetary amounts, totals, etc. The default value for a Decimal is 0. |
|
String |
Any set of characters up to a length of 2,147,483,647, Mathematical operations cannot be used on Strings even if there are only number characters in the string. There are many function available for manipulating strings. Use Strings for Names, Addresses, Text, etc. The default value for a String is '' (an empty string). |
|
Boolean |
A variable that can store only one of two values, TRUE or FALSE. Use Booleans to remember if a particular condition has occurred. The default value for a Boolean is FALSE. |
Usage:
Integer Example:
Declare three integers, assign two of them values and add the two values together into the third integer. The naming convention for integers is an 'int' prefix.
// Declare Integers
integer intValue1
integer intValue2
integer intSum
// Assign Values
intValue1 = 5
intValue2 = 7
// Add the two values together – intSum will be 12
intSum = intValue1 + intValue2
Decimal Example:
// Declare Decimals
decimal decValue1
decimal decValue2
decimal decSum
// Assign Values
decValue1 = 5.5
decValue2 = 7.25
// Add the two values together – decSum will be 12.75
decSum = decValue1 + decValue2
String Example:
// Declare Strings
string strValue1
string strValue2
string strConcat
// Assign Values
strValue1 = '1234'
strValue2 = ' Main Street'
// Concatenate the two values together – strConcat will be '1234 Main Street'
strConcat = strValue1 + strValue2
Boolean Example:
// Declare Variables
boolean boolPassword
string strPassword
string strUserID
// Assign Value
boolPassword = TRUE
// Get either the UserID or Password based on the boolean value
If boolPassword
strPassword = InputBox('Enter Data', 'Please enter Password', 'Passowrd:', 'OK')
Else
strUserID = InputBox('Enter Data', 'Please enter User ID', 'User ID:', 'OK')
EndIf