CoCoA:Ascii

From ApCoCoAWiki
Revision as of 10:02, 24 October 2007 by XMLBot (talk | contribs) (pushing XML rev. 1.46, again)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Ascii

convert between characters and ascii code

Description

In the first form, Ascii returns the character whose ascii code is N.

In the second form, Ascii returns the string whose characters, in

order, have the ascii codes listed in L.

The third form is the inverse of the second: it returns the ascii codes

of the characters in S.

Example

  Ascii(97);
a
-------------------------------
  C := Ascii(<quotes>hello world</quotes>);
  C;
[104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100]
-------------------------------
  Ascii(C);
hello world
-------------------------------

Syntax

Ascii(N:INT):STRING
Ascii(L:LIST of INT):STRING
Ascii(S:STRING):LIST of INT
   <type>string</type>