What is documentation saying about esc codes?

Started by twgonder, July 08, 2021, 19:37:02

Previous topic - Next topic

twgonder

I don't understand the documentation on escape codes.

At the top of the list is \a for beep. What does the "\" mean? How does one ring the bell?
(I used to print chr(7) in my old mini-based BASIC)

For the escape codes there is a sample snip below. I just don't get the purpose of "\e" based on the sample code.

Can someone please explain?
I would be willing to help clean-up the helps (when I refer to them) if someone would give me an intro in how to edit them properly.

bplus

#1
ASC(escape) = 27 try CHR(27)

I dont use escape codes but CHR(27) + the other chars should do it.

This quick little example works for me:

escCodeUnderline = chr(27) + "[4m"

? escCodeUnderline + "This sentence better be underlined.
1 person likes this

chrisws

In a recent update I made a change where you can do away with needing to use chr(27)

Here's an except from one of the tests

if (asc("\a") !=  7) then throw "err1"
if (asc("\b") !=  8) then throw "err2"
if (asc("\e") != 27) then throw "err3"
if (asc("\f") != 12) then throw "err4"
if (asc("\n") != 10) then throw "err5"
if (asc("\r") != 13) then throw "err6"
if (asc("\t") !=  9) then throw "err7"
if (asc("\v") != 11) then throw "err8"

s="Hello\033There"
if (27 != asc(mid(s, 6, 1))) then throw "err"