BBjTemplatedString::fattr

Description

In BBj 7.0 and higher, this method returns the template used to create this BBjTemplatedString.

Syntax

Return Value

Method

string

fattr()

Parameters

None.

Return Value

Returns the template used to create this BBjTemplatedString.

Remarks

None.

Example

template$ = "name[5]:c(32*),context:u(2),code:u(1),id:u(2),objtype:i(2)"

dim A$:template$
B!=BBjAPI().makeTemplatedString(template$)

?"template for A$: ", FATTR(A$)
?"template for B!: ", B!.fattr()

A.name$[1]="aaa"
A.name$[5] = "eee"
A.context = 22
A.code = 3
A.id = 44
A.objType = 55

B!.setString(A$)

?B!.getFieldAsString("name",1)," = ", A.name$[1]
?B!.getFieldAsString("name",5)," = ", A.name$[5]
?B!.getFieldAsNumber("context")," = ", A.context
?B!.getFieldAsNumber("code"),   " = ", A.code
?B!.getFieldAsNumber("id"),     " = ", A.id
?B!.getFieldAsNumber("objType")," = ", A.objType

B!.setFieldValue("name",1,"XXX")
B!.setFieldValue("name",5,"ZZZ")
B!.setFieldValue("context",66)
B!.setFieldValue("code",7)
B!.setFieldValue("id",88)
B!.setFieldValue("objType",9)

A$=B!.getString()

?
?B!.getFieldAsString("name",1)," = ", A.name$[1]
?B!.getFieldAsString("name",5)," = ", A.name$[5]
?B!.getFieldAsNumber("context")," = ", A.context
?B!.getFieldAsNumber("code"),   " = ", A.code
?B!.getFieldAsNumber("id"),     " = ", A.id
?B!.getFieldAsNumber("objType")," = ", A.objType

See Also

String Templates

FATTR Function - Get Field Attribute Information

BBjAPI

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