docs

Home Getting Started Browse by Category Class Methods Low-Level API

Create Your First TOML Document

After adding the ProTOML global template, the generated Toml object is ready to use.

Clarion data

AppName        STRING(80)
RefreshMinutes LONG
AutoSave       BYTE

CODE
AppName = 'PageSnip'
RefreshMinutes = 15
AutoSave = TRUE

Create and populate the document

Toml.StartDocument()
Toml.SetString('application.name',AppName)
Toml.SetLong('application.refresh_minutes',RefreshMinutes)
Toml.SetBool('application.auto_save',AutoSave)

The resulting TOML is:

[application]
name = "PageSnip"
refresh_minutes = 15
auto_save = true

Read the values later

CLEAR(AppName)
RefreshMinutes = 0
AutoSave = FALSE

Toml.GetString('application.name','',AppName)
Toml.GetLong('application.refresh_minutes',5,RefreshMinutes)
Toml.GetBool('application.auto_save',FALSE,AutoSave)

The Clarion variables again contain PageSnip, 15, and TRUE.

Continue with Store and Restore Clarion Data when you are ready to map complete Clarion structures.

Home Getting Started Browse by Category Class Methods Low-Level API