Below is code but containing a few errors. If we try to compile this code it will generate a number of error messages. On this occasion I would suggest you copy and paste this code into MapBasic if you are not familiar with correcting coding errors. Normally I would always recommend typing coding samples, as you learn more through that method. However, on this occasion copying and pasting is the correct procedure.
Purpose: Show the note, print and loop facilities
' Declare
Declare Main
' Function: Main
' Purpose: Loop five times and print out a message each time
' Shows how the print, note and loop statements work
Sub Main
i As Integer
' the loop will execute a Print statement 5 times
For i = 1 to 5
Print "Hello world! The count is now " + Str$(i)
Next
' Let the user know that looping has finished
Note The loop is now finished."
End Sub