ArborX


format_seq

Longname: format_seq uence   Open the Documentation Legend
Released: 7.95 
Created: 7.95 
See also: stream perl hash format_num Technote: 0080

Summary
A keyword used with function variables: ^[funcname parameter(s)]. This syntax can be used anywhere that a regular 3B2 variable can be used: in show strings, in scripts, in expressions, etc. Function variables are a V8 feature that uniforms variable use and functions into a readable syntax. The 'format_seq' function, similar to format_num, but takes a positive integer and converts it into a sequence specified by a format pattern. The number to be formatted, pattern is the sequence to use when formatting the number, and separator and size are optional parameters for determining the separation of digits in the output. If the grouping separator and grouping size are not specified they default to a separator of ’,’and a size of 3.
Example extract

The following show string will display the current value of the th command (text height).

 <?show ^[prop th]?>

Syntax (95)
format_seq num:s pattern:s  [  separator:s size:s  ]? 
num:s

The number to be formatted.

pattern:s

Pattern is the sequence to use when formatting the number.

A A, B, C, ...

X,Y, Z, AA, AB, ...

i i, ii, iii, iv, v, vi, ...

I I, II, III, IV,V,VI, ...

separator:s

Optional parameter for determining the separation of digits in the output.

size:s

Optional parameter for determining the separation of digits in the output.

Example
 ^[format_seq 12,"A"]

will output "L"

 ^[format_seq 30,"a"]

will output "ad"

 ^[format_seq 14,"I"]

will output "XIV"

 ^[format_seq 12345,"0001"]

will output "12,345"

 ^[format_seq 12345,"000001"]

will output "012,345"

 ^[format_seq 12345,"1",’ ’,2]

will output "1 23 45"

 ^[format_seq 1984,"i",’ ’,2]

will output "m-c-m-l-x-x-x-i-v"


Document created on 22-Nov-2004 (revision 1)