Well, sort of. You can
define a type in an include file, and you don't even have to execute it. But you
do have to execute the declare statement for the type variable you are going to use.
These two work together...
REM Program: Global Variables or Data
REM Project: Class A
REM Author: Sam Weddington
REM Created: Friday, March 25, 2011
REM ***** Main Source File *****
REM Main Loop
gosub Declare_Array
DO
PRINT character(1).Radius
gosub Change_Value
WAIT KEY
LOOP
REM _____ Systems _____
REM ===== Systems::Character =====
TYPE Intelligence_Design
SightAPos AS Integer
SightBPos AS Integer
SightCPos AS Integer
SoundRadius AS Integer
SoundXPos AS Integer
SoundYPos AS Integer
ENDTYPE
TYPE Character_Design
Radius AS Integer
XPos AS Integer
YPos AS Integer
Color AS String
MechType AS Integer
Parts AS Integer
Intel AS Intelligence_Design REM Error!!!
ENDTYPE
Declare_Array:
REM Character(Control)
DIM character(1) AS Character_Design REM Array I created!!!
REM Team Leader
character(1).Radius = 10
character(1).XPos = 20
character(1).YPos = 20
character(1).Color = "green"
character(1).MechType = 0
character(1).Parts = 100
return
Change_Value:
character(1).radius = character(1).radius+10
return
To me, the amazing thing is that you don't have to execute the code that defines the type, you just have to have it "above" the actual declare. And as has been mentioned, an include file is basically just pasted onto the end of your main code.
Anyway, in answer to your original question, a variable
can be modified by code in an include file, with the caveat that the variable must still be global if the modification is done in a function, and that the code must be executed, either by function or gosub calls.
Note that
all arrays are global, and don't need the "global" in front of the "dim" statement. And you can take all the "global"s out of the UDT definitions, too.