ATTRIBUTE MODIFIERS

NAME

type – UNIBASE attribute modifiers

DESCRIPTION

UNIBASE attributes have default display properties. This lists modifiers that are used to change the default behaviour.

Modifiers are included in the attribute reference and separated from the attribute name by a ‘:’.

eg [name:T]

Each description is followed by one or more examples.

+<suffix>{:}EXAMPLE[amount:-%]
” 100.00″ will be displayed as ” 100.00%”
Note the suffix is added to the field width.

CODETITLEDESCRIPTIONSYNTAXEXAMPLE
AAscii fillLeft (or right) fill the attribute with the next character.A<fill character>

[units:A0]
” 123″ is printed as “0123”

BBankers’ formatNumber is left filled with ‘0’, no commas, no decimal point, and fixed decimal places.B

[amount:B]
” 1,123.45″ is printed as “000112345”

CRemove commasThe commas (thousands separators) in a number are removed.C

[amount:C]
” 1,123.45″ is printed as ” 1123.45″

CSV CSV format Formats attribute suitable for CSV CSV[description:CSV] printed as “product name”

 

[price:CSV] printed as 50.00

DSuppress decimal 0If the decimal part of a number is all 0, then it is not printed.D

[amount:D]
“123.00” is printed as “123 “

EEscape control charactersWhitespace control characters are escaped. This is particularly useful if the output of a command is put into a union field.E

[text:E]
“abc
def” is printed as “abc\ndef”.

EMPTYTrim field in only if it is emptyIf the field is empty then there is no output. If the field is not empty then the field contents including trailing spaces etc is dispalyedEMPTY[text:EMPTY]
FFree formatThere isn’t a default decimal places for a number. Used for input, this only has decimal places if a decimal point is typed.F

[count:F]

FIRSTValue from first recordValue from first record in associationFIRST[sales.amount:FRST]
HELPLINELine of helpSingle line help message. This comes from the first line of the attribute help in the data dictionary.HELPLINEIn dictionary:date, 8 DC
#DATE OF DELIVERY
#Date goods were delivered.
#
#NB This is not the invoice date.[date:HELPLINE] will display:DATE OF DELIVERY
HELPMSGLong help messageExtensive help message. This is the full help message in the data dictionary.HELPMSGIn dictionary:date, 8 DC
#DATE OF DELIVERY
#Date goods were delivered.
#
#NB This is not the invoice date.[date:HELPMSG] will display:DATE OF DELIVERY
Date goods were delivered.NB This is not the invoice date.
IInvisible input.Used for input (particularly for passwords). Any character typed is displayed as a ‘*’.I

[password:I]

INPUTData input fieldOutput an “INPUT” or similar HTML input element for editing and saving the edited changes to the attribute.INPUT

[units:INPUT]

JJoin characterJoin array elements with <join char>J<join char>[address:J,]
JSONMake field value suitable for JSONAny JSON special characters are escapedJSON[name:JSON]
LLeft justifyLeft justify a number. Normally numbers are right justified.L

[amount:L]
” 123″ will be displayed as “123 “

LASTLast valueValue from last record in associationLAST

[sales.amount:LAST]

LENGTHLength of text in fieldDisplay number of characters in field after trimming leading and trailing spaces.LENGTH[name:LENGTH]
LIVEOutput field for live editingOutput html code compatible with the “ub-live-edit” custom elementLIVE[name:LIVE]
LOWERConvert field text to lower caseField as lower caseLOWER[name:LOWER]
MTrailing minusFor negative numbers, the minus sign is printed after the number.M

[amount:M]
” -123″ will be displayed as ” 123-“

MAXMaximum valuePrint the maximum value from an association or array. Applies to numbers, expressions, and dates.MIN

[lines.amount:MIN]
will display the maximum value of “amount” in the table “lines”.

MEANMean valueMean value of attribute in associated records or mean value of an arrayMEAN

[sales.amount:MEAN]

MINMinimum valuePrint the minimum value from an association or array. Applies to numbers, expressions, and dates.MIN

[lines.amount:MIN]
will display the minimum value of “amount” in the table “lines”.

NNo sumIf the attribute is a number it won’t be summed at subtotals.N

[amount:N]

PPOS inputPOS (Point of sale) data entry for numbers. The attribute fills from the right (rather than to the left of the decimal point).P

[amount:P]

RRight justifyRight justify test. Normally text is left justified.R

[comment:R]
“Hello ” will be displayed as ” Hello”.

REMOVERemove string for fieldRemove all occurrences of a string from a field. String is terminated by ‘:’ or end of field.REMOVE<string>:[mobile:REMOVE ]
[address:REMOVEStreet]
SScript safeCharacters known to reserved in scripts are escaped with ‘\’. The current set is: “‘&;\(){}[]S

[text:S]
“hello; world” will be displayed as “hello\; world”

SDEVStandard DeviationStandard deviation of attribute in associated records or standard deviation of an array.SDEV

[sales.amount:SDEV]

TTrim valueTrailing spaces (text), leading spaces (numbers), leading 0 (counters and sequences) are removed. This can be used in conjunction with most other modifiers.T

[name:T]
“Fred ” will be displayed as “Fred”

UURL formatAll spaces are replaced by ‘+’.U

[web:U]
“http://www.x.com/abc def” will be displayed as “http://www.x.com/abc+def”

UPDATE ubtransaction update format XML output used for updating a value in ubtransactionUPDATE[description:UPDATE] 
UPPERUpper caseConvert field text to upper caseUPPER[name:UPPER]
WChange attribute widthDisplay the attribute in a smaller or wider field.W<width>

[name:W5]
“Maximillian” will be displayed as “Maxim”

[name:W10]
“Maxim” will be displayed as “Maxim_____” where “_” are spaces

XXML safe& is replaced by &amp; and < is replaced by &lt;X

[name:X]
“A&B” will be displayed as “A&amp;B”

ZZero suppressNumber fields with a value of 0 are printed as spaces.Z

[amount:Z]
” 0.00″ will be displayed as ” “

+prefixAdd a prefix to a field. The prefix can be several characters and can be terminated by a ‘:’ if other modifiers are being used.+<prefix>{:}

[amount:+AUD]
” 100.00″ will be displayed as ” AUD100.00″
Note the prefix is added to the field width.

suffixAdd a suffix to a field. The suffix can be several characters and can be terminated by a ‘:’ if other modifiers are being used.
,attributeDisplay field in attribute format – <name>,<value><line feed>.,

[description:,]
“widget” will be displayed as
description,widget

To use in ubdump to get attribute formats: ubdump -a ‘[description:,]>’ stock

Number rangeDisplay a subfieldThe part of the field specified by the subrange is displayed.<start>-<end>

[name:5-10]
“Maximillian” will be displayed as “milli”

SEE ALSO

dictionary (4) type (4)