04-11-2023, 09:20 PM
Fun Fact #2 - Custom types can be returned from functions!
Try it on QBJS
Code: (Select All)
Screen 12
Type Circ
x As Integer
y As Integer
r As Integer
c As Integer
End Type
Dim i As Integer
Dim c As Circ
Do
Cls
For i = 1 To 100
c = MakeCircle
Circle (c.x, c.y), c.r, c.c
Next i
_Limit 10
Loop
Function MakeCircle
Dim c As Circ
c.x = Rnd * 640
c.y = Rnd * 480
c.r = Rnd * 100 + 10
c.c = Rnd * 14 + 1
MakeCircle = c
End Function
Try it on QBJS