Previous

10.3.4.6. String patterns



10.3.4.6.1. Syntax a) NEST string pattern{A341c } : NEST character frame{A341k } sequence.

b) character marker{A341k } : letter a{94a } symbol. {Example:

}

a)
p "table of"x 10a
{For the semantics of string-patterns see 10.3.4.1.2.e .} {

aa) The modes which are output (input) compatible with a 'string' pattern are those specified by CHAR and [ ] CHAR (by REF CHAR, REF [ ] CHAR and REF STRING).

bb) A value V is converted to a string using a 'string' pattern P as follows:

· if necessary, V is rowed to a string:

· if the length of the string V is equal to the length of the string controlled by P, then V is supplied: otherwise, the conversion is unsuccessful,

cc) A string S is converted to a character or a string suitable for a name N, using a 'string' pattern, as follows:

Case A: The mode of N is specified by REF CHAR:


· if S does not consist of the character, the conversion is unsuccessful: otherwise, that character is supplied:

Case B: The mode of N is specified by REF [ ] CHAR:


· if the length of S is not equal to the number of characters referred to by N, the conversion is unsuccessful: otherwise, S is supplied,

Case C: The mode of N is specified REF STRING:


· S is supplied. }
 
Next