functions or types

Blitz3D Forums/Blitz3D Programming/functions or types

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Custom types are good for objects with the same set of properties.

Arrays are good for a whole bunch of items of the exact same type.

Look at it this way:
	P1	P2	P3	P4
Lives	x	x	x	x
Score	x	x	x	x
Name$	x	x	x	x

Using custom types, you use the columns, and end up with 4 players, each with 3 different fields.
Type Player
	Field Lives
	Field Score
	Field Name$
End Type 

Or, with arrays, you use the rows, and end up with 3 arrays of 4 elements, and each index belongs to a player.
Dim Lives(4)
Dim Score(4)
Dim Name$(4)

In this case, it would make much more sense to go with custom types, since the objects all share the same properties.

If, however, you're asking "linked lists" or "arrays", that's another question.