spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * Script language keywords

import

import declaration ;

Declares declaration as a variable or function which is external to the current script, but that the script needs access to it. You use this to provide your room scripts with access to parts of your global script.

For example:

import int counter;
import function add_numbers (int, int);

This imports an integer variable counter and the function add_numbers from the global script to enable the current script to call them. You normally place import statements into the script header so that all rooms can benefit from them.

In order to import the variable, it must have been exported from the global script with the export keyword.

NOTE: You MUST import external variables with the correct type. If counter was declared as a short in the global script, you MUST import it as a short, otherwise your game may crash.

NOTE: You cannot import old-style string variables (this does not apply to new-style String variables).


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.