RosettaCodeData/Task/Call-a-function/FreeBASIC/call-a-function.basic

33 lines
665 B
Plaintext

Sub Saludo()
Print "Hola mundo!"
End Sub
Function Copialo(txt As String, siNo As Short, final As String = "") As String
Dim nuevaCadena As String
For cont As Short = 1 To siNo
nuevaCadena &= txt
Next
Return Trim(nuevaCadena) & final
End Function
Sub testNumeros(a As Integer, b As Integer, c As Integer = 0)
Print a, b, c
End Sub
Sub testCadenas(txt As String)
For cont As Byte = 0 To Len(txt)
Print Chr(txt[cont]); "";
Next cont
End Sub
Saludo
Print Copialo("Saludos ", 6)
Print Copialo("Saludos ", 3, "!!")
?
testNumeros(1, 2, 3)
testNumeros(1, 2)
?
testCadenas("1, 2, 3, 4, cadena, 6, 7, 8, \'incluye texto\'")