Difference between revisions of "Handling Environmental Variable"

From ArcoWiki
Jump to: navigation, search
(Created page with "In ARCO it is possible to create, read and delete entries in the Windows Registry, in this way the user can have specific '''environmental variables''' for his use.<br/> ==Se...")
 
Line 10: Line 10:
 
::<code><span style="color: green; text-decoration: none;">$$ Declare the base Variable</span><br/></code>
 
::<code><span style="color: green; text-decoration: none;">$$ Declare the base Variable</span><br/></code>
 
::::<CODE>DECL/CHAR,200, STR1</code>
 
::::<CODE>DECL/CHAR,200, STR1</code>
::::<CODE>STR1=ASSIGN/’C:\Report Folder’)</code>
+
::::<CODE>STR1=ASSIGN/'C:\Report Folder')</code>
 
::<code><span style="color: green; text-decoration: none;">$$ Use the command SETENV/ to create the entry in the registry</span><br/></code>
 
::<code><span style="color: green; text-decoration: none;">$$ Use the command SETENV/ to create the entry in the registry</span><br/></code>
::::<CODE>SETENV/’MY_REPORT_FOLDER’, STR1</code>
+
::::<CODE>SETENV/'MY_REPORT_FOLDER', STR1</code>
  
  
Line 19: Line 19:
 
::::<CODE>DECL/CHAR,200, STR2</code>
 
::::<CODE>DECL/CHAR,200, STR2</code>
 
::<code><span style="color: green; text-decoration: none;">$$ Use the command GETENV/ to read the entry from the registry</span><br/></code>
 
::<code><span style="color: green; text-decoration: none;">$$ Use the command GETENV/ to read the entry from the registry</span><br/></code>
::::<CODE>STR2=ASSIGN/GETENV(‘MY_REPORT_FOLDER’)</code>
+
::::<CODE>STR2=ASSIGN/GETENV('MY_REPORT_FOLDER')</code>
  
 
::<code><span style="color: green; text-decoration: none;">$$ Declare the base , the dummy point, the tolerances and build the output</span><br/></code>
 
::<code><span style="color: green; text-decoration: none;">$$ Declare the base , the dummy point, the tolerances and build the output</span><br/></code>
 
::::<CODE>DECL/CHAR,200, STR2</code>
 
::::<CODE>DECL/CHAR,200, STR2</code>
 
::::<CODE>DECL/CHAR,200, STR3</code>
 
::::<CODE>DECL/CHAR,200, STR3</code>
::::<CODE>STR3=ASSIGN/CONCAT(str2,’output.mea’)</code>
+
::::<CODE>STR3=ASSIGN/CONCAT(str2,'output.mea')</code>
 
::::<CODE>DID(OUT_FILE)=DEVICE/STOR,STR3</code>
 
::::<CODE>DID(OUT_FILE)=DEVICE/STOR,STR3</code>
 
::::<CODE>F(q)=FEAT/POINT,CART,00,0,0,0,0,1</code>
 
::::<CODE>F(q)=FEAT/POINT,CART,00,0,0,0,0,1</code>
Line 42: Line 42:
 
::<code><span style="color: green; text-decoration: none;">$$ Declare the base Variable</span><br/></code>
 
::<code><span style="color: green; text-decoration: none;">$$ Declare the base Variable</span><br/></code>
 
::::<CODE>DECL/CHAR,200, STR1</code>
 
::::<CODE>DECL/CHAR,200, STR1</code>
::::<CODE>STR1=ASSIGN/’C:\Report Folder’)</code>
+
::::<CODE>STR1=ASSIGN/'C:\Report Folder')</code>
 
::<code><span style="color: green; text-decoration: none;">$$ Use the command SETENV/ to create the entry in the registry</span><br/></code>
 
::<code><span style="color: green; text-decoration: none;">$$ Use the command SETENV/ to create the entry in the registry</span><br/></code>
::::<CODE>SETENV/’MY_REPORT_FOLDER’, STR1</code>
+
::::<CODE>SETENV/'MY_REPORT_FOLDER', STR1</code>
  
 
*From another part program we clear the environment folder:<br/>
 
*From another part program we clear the environment folder:<br/>
 
::<code><span style="color: green; text-decoration: none;">$$ Use the command DELENV/ to remove the entry from the registry</span><br/></code>
 
::<code><span style="color: green; text-decoration: none;">$$ Use the command DELENV/ to remove the entry from the registry</span><br/></code>
::::<code>DELENV/’MY_REPORT_FOLDER’</code>
+
::::<code>DELENV/'MY_REPORT_FOLDER'</code>

Revision as of 12:34, 4 August 2016

In ARCO it is possible to create, read and delete entries in the Windows Registry, in this way the user can have specific environmental variables for his use.

Setting and Reading Environmental Variable

This is used to set general variable that can be read from all the different part programs.
The typical use is to set a path to copy result files from all the programs.
An example of application is:

  • From one part program the program set the environment folder:
$$ Declare the base Variable
DECL/CHAR,200, STR1
STR1=ASSIGN/'C:\Report Folder')
$$ Use the command SETENV/ to create the entry in the registry
SETENV/'MY_REPORT_FOLDER', STR1


  • From all the other programs the program read the folder and output there:
$$ Declare the base Variable
DECL/CHAR,200, STR2
$$ Use the command GETENV/ to read the entry from the registry
STR2=ASSIGN/GETENV('MY_REPORT_FOLDER')
$$ Declare the base , the dummy point, the tolerances and build the output
DECL/CHAR,200, STR2
DECL/CHAR,200, STR3
STR3=ASSIGN/CONCAT(str2,'output.mea')
DID(OUT_FILE)=DEVICE/STOR,STR3
F(q)=FEAT/POINT,CART,00,0,0,0,0,1
FA(q)=FEAT/POINT,CART,00,0,0,0,0,1
T(CORTOL_1)=TOL/CORTOL,XAXIS,-0.1000,0.1000
T(CORTOL_2)=TOL/CORTOL,YAXIS,-0.1000,0.1000
T(CORTOL_3)=TOL/CORTOL,ZAXIS,-0.1000,0.1000
OPEN/DID(OUT_FILE),FDATA,V(TEXT),OUTPUT,OVERWR
OUTPUT/FA(Q),TA(CORTOL_1),TA(CORTOL_2),TA(CORTOL_3)
CLOSE/DID(OUT_FILE)

Deleting Environmental Variable

This is used to clean an Environmental general Variable that has been previously set.
An example of application is:

  • From one part program we set the environment folder:
$$ Declare the base Variable
DECL/CHAR,200, STR1
STR1=ASSIGN/'C:\Report Folder')
$$ Use the command SETENV/ to create the entry in the registry
SETENV/'MY_REPORT_FOLDER', STR1
  • From another part program we clear the environment folder:
$$ Use the command DELENV/ to remove the entry from the registry
DELENV/'MY_REPORT_FOLDER'