EXTERNAL Command

Alerts the Project Manager Window to an undefined reference.

EXTERNAL FILE FileList | ARRAY ArrayList
   | CLASS | FORM | LABEL | LIBRARY | MENU
   | PROCEDURE | QUERY | REPORT | SCREEN | TABLE

Parameters

FILE FileList

Specifies that the file you include in an indirect file reference or macro substitution is a stand-alone file, such as a text file, .BMP bitmap file, and so on. FileList may contain a list of file names separated by commas.

ARRAY ArrayList

When an array is created in a program and then used in a lower-level program, include ARRAY with the array name in the lower-level program. ArrayList may contain a list of array names separated by commas.

In the following example, the first program creates an array named gaInvoice. The array is initialized and a lower-level program named dispinvo is called. dispinvo displays the contents of the array created in the higher-level program. The command EXTERNAL ARRAY GAINVOICE is included to alert the Project Manager.

 CopyCode imageCopy Code
DIMENSION gaInvoice(4)
STORE 'Paid' TO gaInvoice
DO dispinvo
*** Program dispinvo ***
PROCEDURE dispinvo
EXTERNAL ARRAY gaInvoice
? gaInvoice(1)
? gaInvoice(2)
? gaInvoice(3)
? gaInvoice(4)
RETURN
*** End of dispinvo program ***

When an array is passed to a user-defined function or procedure, the corresponding array in the user-defined function or procedure must be identified to the Project Manager. Include the ARRAY option with the name of the array included in the PARAMETER statement.

 CopyCode imageCopy Code
DIMENSION gaArrayOne(2)      && Create an array
EXTERNAL ARRAY gaArrayTwo   && Name of the array used in the UDF
SET TALK OFF
STORE 10 TO gaArrayOne(1)
STORE  2 TO gaArrayOne(2)
= ADDTWO(@gaArrayOne)      && Pass the array by reference to a UDF
FUNCTION ADDTWO
PARAMETER gaArrayTwo
CLEAR
gaArrayTwo(1) = gaArrayTwo(1) + 2
gaArrayTwo(2) = gaArrayTwo(2) + 2
? gaArrayTwo(1)
? gaArrayTwo(2)
CLASS

Specifies that the file you include in an indirect file reference or macro substitution is a visual class library.

 CopyCode imageCopy Code
EXTERNAL CLASS myvclass  && CLASS myvclass must exist
STORE 'myvclass' TO gcClassFile
MODIFY CLASS (gcClassFile)
FORM

If a Form definition file is included in an indirect file reference or macro substitution, include FORM and the Form file name. FORM is identical to SCREEN.

 CopyCode imageCopy Code
EXTERNAL FORM dataentr  && FORM dataentr must exist
STORE 'dataentr' TO gcFormFile
DO FORM (gcFormFile)
LABEL

Specifies that the file you include in an indirect file reference or macro substitution is a label definition file.

 CopyCode imageCopy Code
EXTERNAL LABEL Maillabl     && LABEL FORM Maillabl must exist
STORE 'Maillabl' TO gcLabelFile
LABEL FORM (gcLabelFile) PREVIEW 
LIBRARY

Include LIBRARY when a library file is referenced by indirect file referencing or macro substitution in SET LIBRARY.

 CopyCode imageCopy Code
EXTERNAL LIBRARY regress  && LIBRARY regress must exist
STORE 'regress' TO gcStatFunc
SET LIBRARY TO (gcStatFunc)
MENU

If a menu definition file is included in an indirect file reference or macro substitution, include MENU and the menu file name.

 CopyCode imageCopy Code
EXTERNAL MENU pickfile  && MENU pickfile must exist
STORE 'pickfile' TO gcSysMenPad
MODIFY MENU (gcSysMenPad)
PROCEDURE

Identifies an external procedure or user-defined function.

 CopyCode imageCopy Code
EXTERNAL PROCEDURE delblank     && PROCEDURE delblank must exist
STORE 'delblank' TO gcTrimBlanks
DO (gcTrimBlanks) WITH 'A B C D E'
QUERY

Specifies that the file you include in an indirect file reference or macro substitution is a query file.

 CopyCode imageCopy Code
EXTERNAL QUERY sales  && QUERY sales must exist
STORE 'sales.qpr' TO gcSalesFile
DO (gcSalesFile)
REPORT

Specifies that the file you include in an indirect file reference or macro substitution is a report definition file.

 CopyCode imageCopy Code
EXTERNAL REPORT overdue     && REPORT overdue must exist
STORE 'overdue' TO gcReportFile
REPORT FORM (gcReportFile) PREVIEW
SCREEN

If a form definition file is included in an indirect file reference or macro substitution, include SCREEN and the screen file name. SCREEN is identical to FORM.

 CopyCode imageCopy Code
EXTERNAL SCREEN dataentr  && SCREEN dataentr must exist
STORE 'dataentr' TO gcScreenFile
MODIFY SCREEN (gcScreenFile)
TABLE

Specifies that the file you include in an indirect file reference or macro substitution is a Visual FoxPro table.

 CopyCode imageCopy Code
EXTERNAL TABLE customer && Table customer must exist
STORE 'customer' TO gcMyTable
USE (gcMyTable)

Expand imageRemarks

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic