You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/escape.html
+57-18Lines changed: 57 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -65,15 +65,14 @@ <h4>SmallBASIC</h4>
65
65
</div>
66
66
<divclass="article">
67
67
<h1id="escape-codes">Escape codes</h1>
68
-
<p>SmallBASIC supports a number of escape codes for controlling the display. The codes allow you to set foreground and background colors, change the font and also set underline and inverse text display.</p>
69
-
<p>The escape codes are based on <ahref="http://en.wikipedia.org/wiki/ANSI_escape_code">ANSI Codes</a>. SmallBASIC also support a number of additional codes which are not part of the standard.</p>
70
-
<p>Escape sequences start with the characters ESC (ASCII 27d / 1Bh / 033o ) and [ (left bracket). This sequence is called CSI for “Control Sequence Introducer”.</p>
71
-
<p>The supported standard codes are:</p>
68
+
<p>SmallBASIC supports a number of escape codes for controlling the display. The codes allow you to set foreground and background colors, change the font and also set underline and inverse text display. The escape codes are based on <ahref="http://en.wikipedia.org/wiki/ANSI_escape_code">ANSI Codes</a>.</p>
69
+
<h2id="the-supported-standard-codes-are">The supported standard codes are:</h2>
<h2id="using-the-escapecode-unit">Using the EscapeCode Unit</h2>
100
+
<p>The EscapeCode Unit makes it easier to use the escape codes and to deal with the different colors for foreground and background. The uint can be downloaded or copy pasted from the <ahref="https://github.com/smallbasic/smallbasic.plugins/blob/master/units/EscapeCodes.bas">SmallBASIC Github website</a>. Please save the unit in the same directory as you basic file.</p>
print esc.SAVECURSOR + "YOU SHOULD NOT READ THIS"
134
+
print esc.RESTORECURSOR + esc.CLEAR_LINE + "SAVE AND RESTORE THE CURSOR POSITION"
135
+
print
136
+
print "OTHER:"
137
+
print
138
+
print esc.QUOTE + "YOU CAN USE QUOTES" + esc.QUOTE
139
+
print esc.BP + "A BEEP SHOULD BE AUDIBLE"</code></pre>
140
+
<h2id="escape-codes-in-smallbasic-console-version">Escape codes in SmallBASIC console version</h2>
141
+
<p>In the console version of SmallBASIC (sbasic.exe or sbasic) most of the escape codes, for example <ahref="http://en.wikipedia.org/wiki/ANSI_escape_code">ANSI Codes at wikipedia</a>, can be used in version 12.25 or later. The support of the escape codes depends on the operating system and the terminal you are using.</p>
103
142
</div>
104
143
<divclass="pagefooter">
105
-
This page was last edited on Fri, 30 Mar 2018 12:09:12 +1000
144
+
This page was last edited on Tue, 20 Dec 2022 23:03:24 +0100
<atitle="Version and build information" href="/reference/1523.html">SBVER</a>
616
617
<atitle="Scans an array for the key. If key is not found the SEARCH command returns (in ridx) the value. (LBOUND(A)-1). In default-base arrays that means -1. The cmpfunc (if its specified) it takes 2 vars to compare. It must return 0 if x = y; non-zero if x <> y." href="/reference/548.html">SEARCH</a>
<atitle="Splits the string 'src' into variables which are separated by delimiters." href="/reference/768.html">SINPUT</a>
632
633
<atitle="Sorts an array. The cmpfunc if specified, takes 2 vars to compare and must return: -1 if x < y, +1 if x > y, 0 if x = y." href="/reference/549.html">SORT</a>
633
634
<atitle="Plays a sound." href="/reference/536.html">SOUND</a>
<atitle="Terminates execution of a program, closes all files opened by the program, and returns control to the operating system." href="/reference/656.html">STOP</a>
0 commit comments