Difference between revisions of "Variables declaration"

From ArcoWiki
Jump to: navigation, search
(Created page with "DECL/ command is used to declare new variable in ARCO. You must set the variable type, some specification and the name. <code>$$ Declaration of different variable types</code...")
 
 
(7 intermediate revisions by one other user not shown)
Line 1: Line 1:
DECL/ command is used to declare new variable in ARCO.
+
In order to perform a '''[[Variable]] Declaration''' it is necessary to use the <code>DECL/</code> command.<br />
You must set the variable type, some specification and the name.
+
With that command it is specified the [[variable]] type and its name.
  
<code>$$ Declaration of different variable types</code>
+
The [[variables]] can be:<br/>
<code>DECL/CHAR,80,TCDIRS</code>
+
::<code>COMMON<br/></code>
<code>DECL/INTGR,TCNSLT</code>
+
::<code>GLOBAL<br/></code>
<code></code>
+
::<code>LOCAL<br/></code>
<code>$$ It is possible to declare different variables of the same type in the same row</code>
 
<code>DECL/DOUBLE,TCDIFX,TCDIFY,TCDIFZ</code>
 
<code></code>
 
<code>$$ Declaration of an array of 10 char, called result. Each char has 80 characters.</code>
 
<code>DECL/CHAR,80,RESULTS[10]</code>
 
<code></code>
 
<code>$$ Declaration of an array of 10 x 5 char</code>
 
<code>DECL/CHAR,80,RESULTS[10,5]</code>
 
  
 +
and can be declared in the following types:<br/>
 +
::<code>BOOL<br/></code>
 +
::<code>CHAR<br/></code>
 +
::<code>INTGR<br/></code>
 +
::<code>REAL<br/></code>
 +
::<code>VECTOR<br/></code>
 +
::<code>LONG<br/></code>
  
By means of the DECL command, you declare variables.
+
 
DECL/INTGR,IND
+
<code><span style="color: green; text-decoration: none;">$$ Declaration of different variable types</span><br /></code>
DECL/CHAR,80,RESULTS[10]
+
::<code>DECL/CHAR,80,TCDIRS<br /></code>
DO/IND,1,10,1
+
::<code>DECL/INTGR,TCNSLT<br /></code>
RESULTS[IND]=ASSIGN/''
+
 
ENDDO
+
 
You can declare the following types of variables:
+
<code><span style="color: green; text-decoration: none;">$$ It is possible to declare different variables of the same type in the same row</span></code>
BOOL
+
::<code>DECL/DOUBLE,TCDIFX,TCDIFY,TCDIFZ<br /></code>
CHAR
+
 
INTGR
+
 
REAL
+
<code><span style="color: green; text-decoration: none;">$$ Declaration of an array of 10 char, called result. Each char has 80 characters.</span><br /></code>
VECTOR
+
::<code>DECL/CHAR,80,RESULTS[10]<br /></code>
LONG
+
 
The variables can be:
+
 
COMMON
+
<code><span style="color: green; text-decoration: none;">$$ Declaration of an array of 10 x 5 char</span><br /></code>
GLOBAL
+
::<code>DECL/CHAR,80,RESULTS[10,5]<br/></code>
LOCAL
+
 
 +
[[it:Dichiarazione delle variabili]]
 +
[[zh-cn:变量声明]]
 +
[[pt:Declaração de variáveis]]
 +
[[de:Deklaration von Variablen]]
 +
[[es:Declaración de variables]]
 +
[[en:Variables declaration]]
 +
 
 +
[[Category:Dmis_Tutorial]]

Latest revision as of 10:01, 29 June 2018

In order to perform a Variable Declaration it is necessary to use the DECL/ command.
With that command it is specified the variable type and its name.

The variables can be:

COMMON
GLOBAL
LOCAL

and can be declared in the following types:

BOOL
CHAR
INTGR
REAL
VECTOR
LONG


$$ Declaration of different variable types

DECL/CHAR,80,TCDIRS
DECL/INTGR,TCNSLT


$$ It is possible to declare different variables of the same type in the same row

DECL/DOUBLE,TCDIFX,TCDIFY,TCDIFZ


$$ Declaration of an array of 10 char, called result. Each char has 80 characters.

DECL/CHAR,80,RESULTS[10]


$$ Declaration of an array of 10 x 5 char

DECL/CHAR,80,RESULTS[10,5]