Starting a thread here to post fun facts about QBJS that you might not know.
Fun Fact #1 - You can define optional parameters!
Output:
Try it out on QBJS
Fun Fact #1 - You can define optional parameters!
Code: (Select All)
PrintLines "First Test"
PrintLines "Second Test", 4
PrintLines "Third Test", , " -> "
Sub PrintLines (msg As String, lines As Integer, prefix As String)
If lines = undefined Then lines = 2 ' default to 2 lines
If prefix = undefined Then prefix = "" ' default to blank prefix
Dim i As Integer
For i = 1 To lines
Print prefix; msg
Next i
End Sub
Output:
Code: (Select All)
First Test
First Test
Second Test
Second Test
Second Test
Second Test
-> Third Test
-> Third Test
Try it out on QBJS