{{Cl|COLOR}} Tclr: {{Cl|LOCATE}} Trow, Tcol: {{Cl|PRINT}} Text$; ' end semicolon prevents screen roll
{{Cl|END SUB}}
{{CodeEnd}}
:''Explanation:'' The procedure centers text printed to the screen. The parameters are the text color, row and the text itself as a string or string variable. The maximum width of the screen mode in characters is found and divided in half to find the center point. The text string's length is also divided in half and subtracted from the screen's center position. The procedure will also work when the [[WIDTH]] statement has been used. When adding variables to Text$ use the + concatenation operator. Not semicolons!
''Example 2:'' SUB and [[FUNCTION]] procedures always return to the place they were called in the main or other sub-procedures:
{{CodeStart}}
a = 10
Add1 a
{{Cl|PRINT}} a 'Add1 returns final 'a' value here
{{Cl|END}}
{{Cl|SUB}} Add1 (n)
n = n + 1
Add2 n
{{Cl|PRINT}} "exit 1"
{{Cl|END SUB}}
{{Cl|SUB}} Add2 (m)
m = m + 2
{{Cl|PRINT}} "exit 2"
{{Cl|END SUB}}
{{CodeEnd}}
{{OutputStart}}exit 2
exit 1
13
{{OutputEnd}}
: ''Note:'' Parameter '''a''' is used to call the sub-procedures even though parameters '''n''' and '''m''' are used internally.