Yes, there are a few different ways. If you have only a few planets (say three) per solar system, then you can create types within types like this:
type Planet
//Planet data goes here
PlanetType as integer
endtype
type SolarSystem
StarType as integer
PlanetOne as Planet
PlanetTwo as Planet
endtype
// example solar system
AlphaCentauri as SolarSystem
AlphaCentauri.startype = 1
AlphaCentauri.PlanetOne.PlanetType = 1
but this means you can't scan planets directly, or loop over multiple planets.
A more complex way is to create an array of solar systems and an array of planets, but include in the solar system the index at which the first planet may be found.
type SolarSystem
number as integer
numberOfPlanets as integer
firstPlanetIndex as integer
endtype
type Planet
number as integer
planetType as integer
endtype
Dim SolarSystemList(50) as SolarSystem
Dim PlanetList(100) as Planet
// Create first solar system:
SolarSystemList(0).number = 5
SolarSystemList(0).firstPlanetIndex = 0
SolarSystemList(0).numberOfPlanets = 1
// Two planets in fiorst solar system
PlanetList(0).number = 0
PlanetList(0).planetType = 0
PlanetList(1).number = 1
PlanetList(1).planetType = 15
// Create second solar system:
SolarSystemList(1).number = 5
SolarSystemList(1).firstPlanetIndex = 2
SolarSystemList(1).numberOfPlanets = 1
// Two planets in second solar system
PlanetList(2).number = 2
PlanetList(2).planetType = 0
PlanetList(3).number = 3
PlanetList(3).planetType = 15
To loop over all planets in a solar system, just call
For P = SolarSystemList(1).firstPlanetIndex to (SolarSystemList(1).firstPlanetIndex + SolarSystemList(1).numberOfPlanets)
SomeValue = PlanetList(P).number
//Do other stuff
Next P
The solarSystemList array tells you where to start looking in the planetList array, and also how far to keep looking. The only snag is that you can't easily add planets to a solar system mid-game (but I doubt that would be an issue). Create and fill your arrays at startup, and then don't alter them at all.
One more thing, using data types also allows you to call "Array Insert At Bottom", etc. to easily set up the database. You don't need to know how many planets will exist in total, you can just keep adding more as needed.
Hope this helps!
We spend our lives chasing dreams. Dark Basic lets us catch some of them.