Baanboard.com

Go Back   Baanboard.com

User login

Frontpage Sponsor

Main

Google search


Poll
What version of Baan have you installed
Baan IV
30%
FP3
3%
FP4
0%
FP5
1%
FP6
3%
FP7
4%
10.2 (incl. 10.2.1)
3%
10.3
6%
10.4
19%
10.5
29%
Other
2%
Total votes: 97

Baanboard at LinkedIn


Reference Content

 
External variables
By patvdv at 26 Feb 2008 - 21:56

External variables

An external variable is declared outside the function blocks. You can use them in all functions that occur after the variable declaration, and also in other programs (for example, forms, reports, and runtime expressions). It is possible to declare external variables within a function block but this is not recommended.

If a local variable has the same name as an external variable, the local variable is used within the function. The external variable is not affected.

Declaration, initialization, and scope

Point of declaration

Outside the functions. (Or within a function, but this is not recommended.)

Syntax of declaration

extern <type> name

Initialization

At program start:

numeric set to 0

strings ""

Scope (validity and time)

Valid anywhere in the source, throughout the execution. Also valid outside the program. For example, on forms/reports, in runtime expressions, and by way of import() and export().

Example

 extern long   i
 function void test()
 {
    i = 10        | This is the external variable
 }

Related topics


0
No votes yet


All times are GMT +2. The time now is 04:51.


©2001-2017 - Baanboard.com - Baanforums.com