top of page
Search

Escape sequences

  • Writer: Ivaylo Fiziev
    Ivaylo Fiziev
  • Aug 1
  • 2 min read
ree

These are special symbols, often having specific syntax, used in programming and text formats to represent characters that are difficult or impossible to type directly or have a special meaning. Non-printable characters (line new lines or tabs) are a typical example. Usually you use them when formatting strings.

In the context of SCL these character sequences start with a dollar sign ($) that is followed by either a two digit hexadecimal number or a specific symbol.

Here are some of them:


1. $$ - the dollar sign itself ('35$$')

2. $' - a single quote. This is how you put a quote inside a string. ('$'Quoted text$'')

3. $N - a new line 16#0D16#0A ('This is a $Nmulti line text')

4. $L - a line feed 16#0A ('This is a $Lmulti line text')

5. $R - a carriage return 16#0D

5. $T - a tab ('This is a $Ttext containing a tab')

6. $30 - the symbol with ASCII code 16#30 ('$30 requests')


In the code escape sequences can be used in the default values of strings as well as in string manipulation statements like this one:

	#data := #data + '$N'; // append a new line

SCL uses the standard 7bit ASCII table (0-127) for the variables of type CHAR / STRING.

In Process Simulate we are still missing the CHAR data type and hence the ability to index STRING variables.

You can expect the escape sequences to be available in early 2512 builds. We rarely deal with strings but at some point in the future these tools could become essential.

For now they are just nice to have.


 
 
 

Bình luận

Đã xếp hạng 0/5 sao.
Chưa có xếp hạng

Thêm điểm xếp hạng

Subscribe Form

Thanks for submitting!

bottom of page