RosettaCodeData/Task/Nested-function/FreeBASIC/nested-function.basic

20 lines
385 B
Plaintext

' FB 1.05.0 Win64
Sub makeItem(sep As String, ByRef counter As Integer, text As String)
counter += 1
Print counter; sep; text
End Sub
Sub makeList(sep As String)
Dim a(0 To 2) As String = {"first", "second", "third"}
Dim counter As Integer = 0
While counter < 3
makeItem(sep, counter, a(counter))
Wend
End Sub
makeList ". "
Print
Print "Press any key to quit"
Sleep