Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.6k

Application v 6.6a

  

 

Chapter ElevenSGML Functions (continued)

SGMLTWIPSToValue Function

Overview

The SGMLTWIPSToValue function converts a integer value of TWIPS to a pvalue.

Syntax/Parameters

Syntax

PVALUE = SGMLTWIPSToValue ( int value, PVALUE units, [boolean round] );

Parameters

value

An int specifying measurement in TWIPS (twentieth of points).

units

A PVALUE (dword) to use as a base for the units. The value portion is ignored.

round

A boolean to indicate whether to round the value to whole units. The default is FALSE.

Return Value

A PVALUE (dword) as the result of the translation or PT_UNTRANSLATED on error. The GetLastError function will return ERROR_SYNTAX.

Remarks

A TWIP, or twentieth of a point, is 1/20 of a printer's point, or equivalently 1/1440 of an inch. It is the standard unit of measure for positional and spacing values in SGML/XML-based document layout for applications such as Microsoft Word or Open Office (.docx).

SGMLTWIPSToValue converts a length expressed in twips into its equivalent CSS supported units, as such, the unit parameter must be a unit measurement such as PT_IN or PT_MM.

Units can also be expressed in border keywords using the PT_KEYWORD:

PT_KEYWORD | PK_BORDER_THIN       Thin

PT_KEYWORD | PK_BORDER_MEDIUM     Medium

PT_KEYWORD | PK_BORDER_THICK      Thick

The function assumes the keyword ordinal values are for border-width group of CSS properties. Since the context is not checked, other property ordinal values will return unpredictable results.

Related Functions

Platform Support

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

Legato IDE, Legato Basic

Page revised 2026-09-14