Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter ElevenSGML Functions (continued)

SGMLSetParameter Function

Overview

The SGMLSetParameter function sets a parameter into the element class of an SGML object by name or token. The data can be a raw string or a pvalue.

Syntax/Parameters

Syntax

int = SGMLSetParameter ( handle hSGML, TOKEN token | string property,
                                   string data | PVALUE data );

Parameters

hSGML

A handle to an SGML object.

token

An optional TOKEN (dword) as a token value for an attribute or CSS property. The token must be defined in the DTD. Or,

property

An optional string specifying a text version of the attribute or CSS property. The property is tested as an attribute and then as a CSS property name. If not found in the DTD, an error is returned. Either the token or property parameter must be provided.

data

A string or PVALUE (dword) containing the data to be set, The suitability of the data is not tested and if improperly formatted may result in errors being written. It is the responsibility of the programmer to insure proper values are written. pvalue content is not checked and if invalid may result in an error during tag write process.

Return Value

An int as the parameter position or a formatted error code.

If the property name cannot be translated, the value 0x1002 will be ORed bitwise with the error code.

Remarks

For CSS properties, certain parameters may be combined as shorthand during the write process. For example, font-family and font-size might be combined. It is advisable not to write shorthand properties directly. The function does not test the DTD for applicability of the attribute/property for the element.

For standard W3C defined attributes and properties, SDK defined token values can be referenced with the following standard prefixes:

HA_ — HTML attribute. for example, HA_ALIGN or HA_SIZE for “ALIGN=” or “SIZE=”

CP_ — CSS property, for example, CP_TEXT_ALIGN or CP_MARGIN_TOP for “text-align” or “margin-top”

Note that any where a dash ‘-’ is used in a name, it is replaced with an underbar ‘_’. See Appendix A — Legato SDK Standard Definitions. for a complete list of definitions.

When writing a numeric value, it will be interpreted as a pvalue. Therefore, placing the number 2 in the field is the equivalent of added PT_INT | 2, the result will be .02 since the values are measured in 100ths.

The overall element data heap size limits the size of strings to no more that 4,096 total characters.

The parameter slot used may be a deleted position, overwrite an existing name or be appended to the end of the parameters.

Avoid writing PT_IMPLIED, this will result in the parameter translating to “(default)” if the element is written.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic