QBJS - Fun Facts!
#1
Starting a thread here to post fun facts about QBJS that you might not know.

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
Reply


Messages In This Thread
QBJS - Fun Facts! - by dbox - 04-10-2023, 08:46 PM
RE: QBJS - Fun Facts! - by mnrvovrfc - 04-10-2023, 09:48 PM
RE: QBJS - Fun Facts! - by Sprezzo - 04-10-2023, 10:23 PM
RE: QBJS - Fun Facts! - by mnrvovrfc - 04-11-2023, 06:11 AM
RE: QBJS - Fun Facts! - by dbox - 04-11-2023, 08:55 PM
RE: QBJS - Fun Facts! - by dbox - 04-11-2023, 09:20 PM
RE: QBJS - Fun Facts! - by vince - 04-11-2023, 10:03 PM
RE: QBJS - Fun Facts! - by dbox - 04-13-2023, 11:48 AM
RE: QBJS - Fun Facts! - by mnrvovrfc - 04-14-2023, 03:04 AM
RE: QBJS - Fun Facts! - by CharlieJV - 04-14-2023, 04:00 AM
RE: QBJS - Fun Facts! - by bplus - 04-13-2023, 01:45 PM
RE: QBJS - Fun Facts! - by SMcNeill - 04-14-2023, 11:38 AM
RE: QBJS - Fun Facts! - by dbox - 04-14-2023, 01:31 PM
RE: QBJS - Fun Facts! - by vince - 04-14-2023, 11:55 AM
RE: QBJS - Fun Facts! - by mnrvovrfc - 04-14-2023, 02:53 PM
RE: QBJS - Fun Facts! - by dbox - 04-14-2023, 03:55 PM
RE: QBJS - Fun Facts! - by dbox - 04-21-2023, 02:04 PM



Users browsing this thread: 7 Guest(s)