Select Random Type

Blitz3D Forums/Blitz3D Programming/Select Random Type

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.

Here is a simple little program. It does not realy do much, but if you look at the code I think it does basicaly what you want. Use the left mouse button to select a new random type.
Type whatever
	Field number
End Type

For whatevers=0 To 100
	w.whatever=New whatever
	w\number=whatevers
Next

While Not KeyDown(1)
Delay 1
If MouseHit(1)
	pick=Rand(0,100)
EndIf

For w.whatever=Each whatever
	If w\number=pick
		Print w\number
	EndIf
Next

Wend

If this is not what you want, just say so!