Call a function: Difference between revisions
Call a function in PureBasic
(Call a function in PureBasic) |
|||
Line 4,221:
<lang PicoLisp>(setq A (+ 3 4) B (* 3 4))</lang>
i.e. the first argument 'A' is not evaluated, the second evaluates to 7, 'B' is not evaluated, then the fourth evaluates to 12.
=={{header|PureBasic}}==
{{trans|FreeBASIC}}
<lang PureBasic>Procedure Saludo()
PrintN("Hola mundo!")
EndProcedure
Procedure.s Copialo(txt.s, siNo.b, final.s = "")
Define nuevaCadena.s, resul.s
For cont.b = 1 To siNo
nuevaCadena + txt
Next
Resul = Trim(nuevaCadena) + final
ProcedureReturn resul
EndProcedure
Procedure testNumeros(a.i, b.i, c.i = 0)
PrintN(Str(a) + #TAB$ + Str(b) + #TAB$ + Str(c))
EndProcedure
Procedure testCadenas(txt.s)
For cont.b = 1 To Len(txt)
Print(Mid(txt,cont,1))
Next cont
EndProcedure
OpenConsole()
Saludo()
PrintN(Copialo("Saludos ", 6))
PrintN(Copialo("Saludos ", 3, "!!"))
PrintN("")
testNumeros(1, 2, 3)
testNumeros(1, 2)
PrintN("")
testCadenas("1, 2, 3, 4, cadena, 6, 7, 8, \'incluye texto\'")
Input()
CloseConsole()</lang>
{{out}}
<pre>Same as FreeBASIC entry.</pre>
=={{header|Python}}==
|