BBjTemplatedString::getFieldAttribute

Description

In BBj 11.0 and higher, this method returns the value of a user-defined attribute associated with a specified field of aBBjTemplatedString.

Syntax

Return Value

Method

byte[]

getFieldAttribute(string fieldname, string attributename)

Parameters

Variable

Description

fieldname

The name of the field defined in this template.

attributename

The name of a user-defined attribute associated with the specified field.

Return Value

Returns the value of the specified user-defined field attribute, or throws !ERROR=47 if there is no such attribute.

Remarks

Methods that return byte[] can usually be treated as if they returned string, because BBj automatically handles the conversion. However, when that byte[] value is directly assigned to an object variable or passed to a Java method, BBj skips the conversion and the raw internal byte[] format is used. You can always use the STR() function to explicitly convert the byte[] value to a string.

Example

t$ = "NAME:C(32*),CONTEXT:U(2),CODE:U(1),ID:U(2):mask=000:,OBJTYPE:I(2)"
t! = bbjapi().makeTemplatedString(t$)
print "Template: ",
print t!.fattr()
print "MASK: ",
print t!.getFieldAttribute("id","mask")
print "NADA: ",
print t!.getFieldAttribute("id","nada")

See Also

String Templates

BBjAPI

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.