Quote: "How is this possible when the message you are getting is "declaration is not valid at line 1""
Perhaps it's possible when someone removes trouble code and tries to compile it separately from the rest of the code that has been shown to work? I dunno, just a guess.
I'm using the IDE to clump everything together, not includes.
@Diggsey
Thanks. I've tried different names, commenting out things, moving the typedef around, even copying to notepad then saving then reopening. Still an error. This wouldn't be a pressing problem (maybe it's just an IDE only error) if I didn't need to use the type (obviously). It compiles, throws an error, then runs fine as long as I comment out the dim statements which use the HUD type later on. But as soon as I add those DIM statements it reverts back to the typedef error and won't compile. I remember running into a similar problem years ago, but its been so long that I don't remember the cause/solution.
type Byte_3
R as byte
G as byte
B as byte
endtype
type Float_2
X as float
Y as float
endtype
type Float_3
X as float
Y as float
Z as float
endtype
type Integer_2
X as integer
Y as integer
endtype
type Integer_3
X as integer
Y as integer
Z as integer
endtype
type Angle_3
Min as Float_3
Current as Float_3
Max as Float_3
endtype
type Color_Data
Red as byte
Green as byte
Blue as byte
endtype
type Database_Entry
Designator as string
Path as string
Version as string
endtype
`Display data type definitions
type Display_Resolution
Resolution as Integer_2
Depth as byte
endtype
type Display_Entry
Mode as Display_Resolution
endtype
type EnergyWeapon_Entry
Object as string
EmitterObject as string
EmitterWeapon as string
EmitterTarget as string
Active as boolean
Class as byte
Wavelength as word
Damage as float
Range as float
FireStart as integer
FireTimer as integer
PulseStart as integer
PulseTimer as integer
endtype
type EngineData_Variables
Version as string
ConsoleLog as string
DatabaseLoaded as boolean
Directory as string
Skysphere as word
AverageFPS as integer
AveragePolys as integer
endtype
remstart
type HUDElement_Entry
Name as string
Object as string
CameraLock as boolean
Position as Float3
ShowOnFriendly as boolean
ShowOnEnemy as boolean
ShowOnNeutral as boolean
ShowOnUnknown as boolean
IsTargetPip as boolean
IsTargetBracket as boolean
IsLeft as boolean
IsLeftUpper as boolean
IsUp as boolean
IsRightUpper as boolean
IsRight as boolean
IsRightLower as boolean
IsLower as boolean
IsLeftLower as boolean
IsCompass as boolean
IsRecticle as boolean
ShowOnMissile as boolean
ShowOnGun as boolean
ShowOnNull as boolean
endtype
type HUDEntity_Entry
Name as string
ElementPointer as word
ElementCount as word
CameraLock as boolean
Position as Float3
VisiblePilot as boolean
VisibleExternal as boolean
VisibleFree as boolean
VisibleSatellite as boolean
`ShowOnFriendly as boolean
`ShowOnEnemy as boolean
`ShowOnNeutral as boolean
`ShowOnUnknown as boolean
endtype
remend
type Image_Entry
Name as string
Number as integer
endtype
`Light data type definitions
type Light_Cycle_Entry
TimeTo as float
Time as float
Color as Byte_3
Image as string
endtype
type Light_Entry
Name as string
Number as word
Class as byte
Position as Float_3
Rotation as Float_3
Angle as Float_3
Range as float
On as Light_Cycle_Entry
Off as Light_Cycle_Entry
endtype
`Model data type definitions
type Model_Entry
Name as string
Visible as boolean
ObjectPointer as dword `The index for the model's object data in the model object database
ObjectCount as word `The number of object the model contains
MountPointer as dword `The index for the model's mount data in the mount database
MountCount as dword `The number of mount points the model contains
Size as Float_3
Scale as Float_3
CollisionRadius as Float_3
Position as Float_3
Velocity as Float_3
Angle as Float_3
Rotation as Float_3
endtype
print "Press any key"
wait key
Try to compile with the "HUD" type defs not commented out, then retry with them commented out. What
should happen is that it will be "kind of amusing" when the code compiles fine w/o the HUD type defs, yet throws an error with them (for tiresius' ease of recognition, this time it should say "Declaration is not valid at line 82."). Maybe it won't throw an error for you either way, which would be odd.
In Development: K96 - Combat Simulation