Show/Hide Toolbars

XSharp

NoteThis command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available

Purpose

Declare a list of routines (procedures or functions) to be linked into the application.

Syntax

EXTERNAL <idRoutineList>

Arguments

<idRoutineList>A comma-separated list of routine names to link.  The names should not include parentheses.

Description

EXTERNAL is a declaration statement that specifies one or more routines to be linked into the application.  It should be placed after the variable declaration statements (such as LOCAL)

 

During the compilation of X# source code, all explicit references to routines are automatically linked.  In some instances however, there can be no references made to a routine until runtime.  EXTERNAL resolves this by forcing the named routines to be linked even if they are not explicitly referenced in the source code.  This is important in several instances:

Routines referenced in macro expressions or variables

Functions used in index keys and not otherwise referenced in the source code

 

Examples

This example forces the code for HardCR(), Tone(), MemoTran(), and StrTran() to be linked into the application, regardless of whether these functions are referenced explicitly in the source code:

 

EXTERNAL HardCR, Tone, MemoTran, StrTran