I took your code, made a few code modification to make it do something without all the extra info, and moved it all to one file for ease of testing and it seems to work just fine.
Code: Select all
TYPE ShipData
ShipID AS long
ShipTypeID as Long
ShipClassID As Long
ShipCallSign AS String * 40
UAPShipRegistryNumber AS String * 20
'Location AS AstrometricPosition
'Position As SensoryPosition
ShipWidth As Double
ShipHeight AS Double
ShipDepth AS Double
ShipWeight As Double
DeckCount As Long
SectionCount AS Long
CruiseSpeed AS DOUBLE
MaximumSpeed AS DOUBLE
EmergencySpeed AS DOUBLE
Communications As Double
HullIntegrity As Double
Computer As Double
Transporters AS Double
LifeSupport As Double
AuxilliaryLifeSupport As Double
MedicalBays As Double
MedicalBedConsoles aS Double
PrimaryWeaponName As String * 40
PrimaryWeapon AS Double
SecondaryWeaponName As String * 40
SecondaryWeapon AS Double
PrimaryDefenseName AS String * 40
PrimaryDefense as double
SecondaryDefenseName AS String * 40
SecondaryDefense as double
CloakingSystem as Double
CurrentCrew as Double
MaximumCrew As Double
Probes as Double
Decoys as Double
ShuttleBays As Double
Shuttles AS Double
Supplies AS Double
Torpedoes As Double
Defenses As Double
Weapons As Double
MedicalSupplies As Double
Naterials As Double
IsDestroyed AS Byte
IsDisabled As Byte
ENd TYPE
DIM SHARED FleetShips() as ShipData
SUB ReadFleetShips()
DIM Counter AS LONG
DIM ShipCount AS LONG
DIM WorkCount AS LONG
DIM ArrayOffset AS LONG
DIM WorkShip AS ShipData
REDIM PRESERVE FleetShips(460) AS ShipData
ArrayOffset = 0
FOR Counter = 1 TO 10
READ WorkShip.ShipID
READ WorkShip.ShipTypeID
READ WorkShip.ShipClassID
Read WorkShip.ShipCallSign
READ WorkShip.UAPShipRegistryNumber
READ ShipCount
READ WorkShip.ShipHeight
READ WorkShip.ShipWidth
READ WorkShip.ShipDepth
Read WorkShip.ShipWeight
Read WorkShip.DeckCount
Read WorkShip.SectionCount
Read WorkShip.CruiseSpeed
Read WorkShip.MaximumSpeed
Read WorkShip.EmergencySpeed
Read WorkShip.Communications
Read WorkShip.HullIntegrity
Read WorkShip.Computer
Read WorkShip.Transporters
Read WorkShip.LifeSupport
Read WorkShip.AuxilliaryLifeSupport
Read WorkShip.MedicalBays
Read WorkShip.PrimaryWeaponName
Read WorkShip.PrimaryWeapon
Read WorkShip.SecondaryWeaponName
Read WorkShip.SecondaryWeapon
Read WorkShip.PrimaryDefenseName
Read WorkShip.PrimaryDefense
Read WorkShip.SecondaryDefenseName
Read WorkShip.SecondaryDefense
Read WorkShip.CloakingSystem
Read WorkShip.CurrentCrew
Read WorkShip.MaximumCrew
Read WorkShip.Probes
Read WorkShip.Decoys
Read WorkShip.ShuttleBays
Read WorkShip.Shuttles
Read WorkShip.Supplies
Read WorkShip.Torpedoes
Read WorkShip.Defenses
Read WorkShip.Weapons
Read WorkShip.MedicalSupplies
Read WorkShip.Naterials
Read WorkShip.IsDisabled
Read WorkShip.IsDestroyed
FOR WorkCount = 0 TO ShipCount - 1
WorkShip.ShipID = ArrayOffset + WorkCount
FleetShips(ArrayOffset + WorkCount) = WorkShip
NEXT WorkCount
ArrayOffset = ArrayOffset + ShipCount
NEXT Counter
END SUB
Data 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"X",1,"X",1,"X",1,"X",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"X",1,"X",1,"X",1,"X",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"X",1,"X",1,"X",1,"X",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"X",1,"X",1,"X",1,"X",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"X",1,"X",1,"X",1,"X",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"X",1,"X",1,"X",1,"X",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"X",1,"X",1,"X",1,"X",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"X",1,"X",1,"X",1,"X",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"X",1,"X",1,"X",1,"X",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Data 9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"X",1,"X",1,"X",1,"X",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
ReadFleetShips()
for i as integer = 0 to 460
if FleetShips(i).shipTypeID <> 0 then
print FleetShips(i).shipID, FleetShips(i).shipTypeID
end if
next
sleep
My guess is there is something else here, or the typo mentioned above.