Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,35 @@
|
|||
'Task
|
||||
'Take a combined set of elements and apply a function to each element.
|
||||
'UDT
|
||||
Type Friend
|
||||
Names As String * 8
|
||||
Surnames As String * 8
|
||||
Age As Integer
|
||||
End Type
|
||||
|
||||
Dim Friends(1 To 6) As Friend
|
||||
Restore
|
||||
FillArray
|
||||
SearchForAdult Friends(), LBound(friends), UBound(friends)
|
||||
|
||||
End
|
||||
|
||||
Data "John","Beoz",13,"Will","Strange",22
|
||||
Data "Arthur","Boile",16,"Peter","Smith",21
|
||||
Data "Tom","Parker",14,"Tim","Wesson",24
|
||||
|
||||
Sub FillArray
|
||||
Shared Friends() As Friend
|
||||
Dim indeX As Integer
|
||||
For indeX = LBound(friends) To UBound(friends) Step 1
|
||||
Read Friends(indeX).Names, Friends(indeX).Surnames, Friends(indeX).Age
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Sub SearchForAdult (F() As Friend, Min As Integer, Max As Integer)
|
||||
Dim Index As Integer
|
||||
Print "Friends with more than 18 years old"
|
||||
For Index = Min To Max Step 1
|
||||
If F(Index).Age > 18 Then Print F(Index).Names; " "; F(Index).Surnames; " "; F(Index).Age
|
||||
Next Index
|
||||
End Sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue