EXTERN
(Statement)
[RC7 Version 2.2 or later]
Declare access to a FOLDER variable defined in another program.
EXTERN DEFINT <variablename>[,<variablename>,...]
EXTERN DEFSNG <variablename>[,<variablename>,...]
EXTERN DEFDBL <variablename>[,<variablename>,...]
EXTERN DEFSTR <variablename>[,<variablename>,...]
EXTERN DEFVEC <variablename>[,<variablename>,...]
EXTERN DEFPOS <variablename>[,<variablename>,...]
EXTERN DEFJNT <variablename>[,<variablename>,...]
EXTERN DEFTRN <variablename>[,<variablename>,...]
EXTERN DIM <variablename><suffix>[(<element count> [,<element count> [,<element count>]])] [AS<variable type>][, <variablename>,...]
Searching for a FOLDER variable
-
This statement first searches for a FOLDER variable in a folder where the PAC program containing EXTERN is located.
-
If the FOLDER variable is found, the search terminates.
-
If it is not found, the search proceeds to step (2).
-
The search for a FOLDER variable continues with the folder just above the previous level.
-
If the FOLDER variable is found, the search terminates.
-
If it is not found, step (2) is repeated.
-
If it cannot be found even after reaching the top folder, then a compilation error will result.List 1DescriptionPRO1EXTERN DEFINT AADEFINT AAENDList 1 causes a compilation error since the same variables AA are declared in a PAC program.
List 2DescriptionPRO1EXTERN DEFINT AAEXTERN DEFINT AAENDList 2 causes a compilation error since the same EXTERN variables are declared in a PAC program.
List 3DescriptionPRO1EXTERN DEFINT AAENDPRO2EXTERN DEFINT AAENDList 3 is correct in declaring EXTERN variables AA. These variables have the same name but are declared in different folders so that they are treated as different ones.
List 4DescriptionList 4 is correct in declaring EXTERN variables AA. These variables have the same name but are declared in different folders.
Editing a program from the teach pendant or sending <Map/executable program> to the robot controller in WINCAPSIII clears the EXTERN variables.
Refer to the coding example given in FOLDER.