Previous

10.3.4.2. Integral patterns

10.3.4.2.1. Syntax a) NEST integral pattern{A341c ,A343c} : NEST sign mould{c} option, NEST integral mould{b}.

b) NEST integral mould{a,A343b,c ,A347a} : NEST digit frame{A341k } sequence.

c) NEST sign mould{a,A343a } : NEST unsuppressible zero frame{A341k } sequence option, NEST unsuppressible sign frame{A341j } .

d) zero marker{f,A341k } : letter z{94a } symbol.

e) sign marker{A341j } : plus{94c } symbol ; minus{94c} symbol.

f) digit marker{A341k } : letter d{94a } symbol ; zero marker{d}. {Examples:

}

a)
"x " 12z+d
b)
d
c)
"x " 12z+
{For the semantics of integral-patterns see 10.3.4.1.2.e .} {

aa) The modes which are output (input) compatible with an 'integral' pattern are those specified by {L} INT (by REF {L} INT).

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

· if P contains a sign mould, the first character of S is the sign of V; otherwise, if V < 0, the conversion is unsuccessful;

· the remainder of S contains a decimal representation of V determined as follows:

· the elements of S controlled by "d" and "z" frames are the appropriate digits (thus the pattern specifies the number of digits to be used);

· if V cannot be represented by such a string, the conversion is unsuccessful;

(For example, the value 99 could be converted to a string using the pattern zzd, but 9999 and -99 could not.)

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

· the integer I for which S contains a decimal representation {8.1.1.2 } is considered;

· if I is greater than the largest value to which N can refer, the conversion is unsuccessful; otherwise, I is the required integer (e.g., if the mode of N is specified by REF SHORT INT, and the value of short max int is 65535, then no string containing a decimal representation of a value greater than 65535 may be converted).}



 
Next