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
  1. 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).
  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 1
      Description
      PRO1
      EXTERN DEFINT AA
      DEFINT AA
      END
      List 1 causes a compilation error since the same variables AA are declared in a PAC program.

      List 2
      Description
      PRO1
      EXTERN DEFINT AA
      EXTERN DEFINT AA
      END
      List 2 causes a compilation error since the same EXTERN variables are declared in a PAC program.

      List 3
      Description
      PRO1
      EXTERN DEFINT AA
      END
      PRO2
      EXTERN DEFINT AA
      END
      List 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 4
      Description
      List 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.

Top