User login
|
|
|
Frontpage Sponsor
|
|
|
Poll
|
Would you like to see a separate forum on Baanboard for the ION product? No 13% Yes 87% Total votes: 91 |
Baanboard at LinkedIn
|

|
|
|
|
Items for 'BaanERP' (by date)
|
|
By patvdv at 26 Feb 2008 - 21:56
|
String expressions (ON CASE)
|
|
|
|
By patvdv at 26 Feb 2008 - 21:56
|
Constants
A constant is a value of a special type that you can assign to a variable. The Baan 3GL programming language supports the following types of constants:
|
|
|
|
By patvdv at 26 Feb 2008 - 21:56
|
Local variables
Variables declared within a function block are local variables. They are accessible only within the function in which they are declared.
Declaration, initialization, and scope
Point of declaration
In the function between the brackets { }.
Syntax of declaration
<type> name
|
|
|
|
By patvdv at 26 Feb 2008 - 21:56
|
Data types
There are five types of variables: long, double, string, table, and domain variables.
|
|
|
|
By patvdv at 26 Feb 2008 - 21:56
|
|
Logical operators
Logical operators perform logical operations on their operands. The operator NOT is unary, so it has only one operand. The operands of logical operators can be logical expressions, relational expressions, variables, or constants.
The following table illustrates the results of logical expressions:
|
|
|
|
By patvdv at 26 Feb 2008 - 21:56
|
Declarations
You can declare variables either within a function block or at the start of the program. Variables declared in a function block can be used within that function block only. Variables declared at the start of the program can be used in each function described below the declaration.
General syntax
You declare variables with the following syntax (parts between [ ] are optional):
|
|
|
|
By patvdv at 26 Feb 2008 - 21:56
|
|
Long expressions (ON CASE)
The expression after ON CASE is evaluated and compared with the various CASE expressions that follow. All expressions in the case labels must be of type LONG or STRING. When string expressions are used, the ASCII value of the string is compared with the ON CASE expression. For example:
|
|
|
|
By patvdv at 26 Feb 2008 - 21:56
|
Domains
When declaring temporary variables for storing values of database fields, you can use normal variables of type long, double, or string. But this can cause problems if the length or type of the table field has been changed in the data dictionary. It is preferable to use domain declarations for storing the value of a database table field. When you use a domain declaration, the type and length for the declared variable are read from the data dictionary.
|
|
|
|
By patvdv at 26 Feb 2008 - 21:56
|
Macro definition (preprocessor)
Use the following statement to define a macro:
#define macroname[(arguments)]
Use the folowing statement to undefine a macro:
|
|
|
|
By patvdv at 26 Feb 2008 - 21:56
|
|
Enumerate and set constants
In the data dictionary you can define database table fields and domains of type enumerate or set.
An enumerate or set domain consists of a number of constants. In the program script (and other places in the data dictionary), a symbolic name is used. The symbolic name is the domain name, followed by a period [.] followed by the name of the constant. Variables of type set can also consist of a combination of set values.
|
|
|
|
All times are GMT +2. The time now is 09:48.