Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[subject: escape characters]

 [1/7] from: rebol665:ifrance at: 23-Feb-2002 17:33


Hi rebollers, Like the C programming language, rebol has some espace characters. One example is #"^/" for newline. I have found some others, but failed to find a complete list. These are what I have found so far : #"^(tab)" or #"^-" for tabulation #"^(back)" or #"^H" for backspace #"^/" for newline Have you more ? Patrick

 [2/7] from: greggirwin:mindspring at: 23-Feb-2002 12:34


Hi Pat, I think it's only the low ASCII characters that are escaped.
>> for i 1 31 1 [prin mold to-char i]
#"^A"#"^B"#"^C"#"^D"#"^E"#"^F"#"^G"#"^H"#"^-"#"^/"#"^K"#"^L"#"^M"#"^N"#"^O"# ^P #"^Q # ^R"#"^S"#"^T"#"^U"#"^V"#"^W"#"^X"#"^Y"#"^Z"#"^["#"^\"#"^]"#"^!"#"^_" --Gregg

 [3/7] from: rebol665:ifrance at: 24-Feb-2002 10:51


Thanks Gregg Modifying your program, I can produce two columns. What I would like now is to populate a third column with a more symbolic notation. For now, I have got only three item for this column. 1 #"^A" 2 #"^B" 3 #"^C" 4 #"^D" 5 #"^E" 6 #"^F" 7 #"^G" 8 #"^H" #"^(back)" 9 #"^-" #"^(tab)" 10 #"^/" newline 11 #"^K" 12 #"^L" 13 #"^M" 14 #"^N" 15 #"^O" 16 #"^P" 17 #"^Q" 18 #"^R" 19 #"^S" 20 #"^T" 21 #"^U" 22 #"^V" 23 #"^W" 24 #"^X" 25 #"^Y" 26 #"^Z" 27 #"^[" 28 #"^\" 29 #"^]" 30 #"^!" 31 #"^_" Patrick

 [4/7] from: joel:neely:fedex at: 24-Feb-2002 7:31


Hi, Pat, pat665 wrote:
> ... What I would like now is to populate a third column > with a more symbolic notation. For now, I have got only > three item for this column. >
According to http://www.rebol.com/docs/core23/rebolcore-16.html in the section on "Strings": You can include special characters and operations in strings by prefixing them with a caret (^). Special characters include: Special Characters Character Definition " Inserts a double quote ("). } Inserts a closing brace (}). ^ Inserts a caret (^). / Starts a new line. (line) Starts a new line. - Inserts a tab. (tab) Inserts a tab. (page) Starts a new page. (letter) Inserts control-letter (A-Z). (back) Erases one character left of the insertion point. (null) Inserts a null character. (escape) Inserts an escape character. (xx) Inserts an ASCII character by hex (xx) number. and in the section on "Other Values / Character": Characters can include escape sequences that begin with a caret (^) and are followed by one or more characters of encoding. This encoding can include the characters #"^A" to #"^Z" for control A to control Z (upper- and lower-case are the same): #"^A" #"^Z" Following is a table of control characters that can be used in REBOL. Control Characters Character Definition #"(null)" or #"@" null (zero) #"(line)", #"/" or, #"." end of line #"(tab)" or #"-" horizontal tab #"(page)" new page (and page eject) #"(esc)" escape #"(back)" backspace #"(del)" delete #"^" caret character #"^"" quotation mark #"(00)" to #"(FF)" hex forms of characters The entries all (except #"^"") contain the typo that the ^ prefix is omitted. Also, notice that ^(esc) works for both character and string literals, while ^(escape) works only in strings. -jn- -- ; sub REBOL {}; sub head ($) {@_[0]} REBOL [] # despam: func [e] [replace replace/all e ":" "." "#" "@"] ; sub despam {my ($e) = @_; $e =~ tr/:#/.@/; return "\n$e"} print head reverse despam "moc:xedef#yleen:leoj" ;

 [5/7] from: rotenca:telvia:it at: 24-Feb-2002 15:52


Hi, pat
> Modifying your program, I can produce two columns. What I would like now is > to populate a third column with a more symbolic notation. For now, I have > got only three item for this column.
Look at REBOL/Core User Guide Version 2.3 A-48 A-49. The table lacks the caret before "(" it is implicit. --- Ciao Romano

 [6/7] from: g:santilli:tiscalinet:it at: 24-Feb-2002 11:56


At 17.33 23/02/02, Patrick wrote:
>Have you more ?
Gregg already pointed out most, but there's also #"^(XX)" where XX are two hexadecimal digits. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [7/7] from: rebol665::ifrance::com at: 24-Feb-2002 20:49


Thanks Joel, Romano, Gabrielle, and Gregg I had already explored the Rebol/Core ( both the PDF and the .HTML version ) searching for ^(tab). Unfortunately in my case, the caret ^ was missing in the table I was looking for ... It is quite often that I have the feeling "I read that somewhere but where was it" . Patrick