A5_SAVE_SETTINGS()

Syntax

A5_SAVE_SETTINGS( Setting_Name as C, Dot_Variable as P [, Dictionary as C ] )

Argument

Description

Setting_Name

The name of the setting that you wish to create.

Dot_Variable

A dot variable containing values to be saved.

Dictionary

Optional. Default = dictionary (.ALB file) for current database. Path and filename of any Alpha Five library file (i.e. a .ALB, .DDD or .SET file), or a text file.

Description

The A5_SAVE_SETTINGS() function replaces the SAVE_SETTINGS() method and saves the values in Dot_Variable to a data dictionary.

Supported By

Alpha Five Version 5 and Above

Examples

The following script defines a dot variable called family then saves the variable using a parent key name of MyFamily.

dim family as P

dim family.kids as P

family.mom = "Irene"

family.dad = "David"

family.kids.first = "Sam"

family.kids.second = "Pam"

a5_save_settings("MyFamily",family, "c:\A5\settings1.txt")

The resulting data looks like this:

<MyFamily<mom = "Irene">

<dad = "David">

<kids<first = "Sam">

<second = "Pam">

>

>

It is easier to understand the structure of the resulting data, if you imagine it formatted as an outline. For example:

<MyFamily

  <mom = "Irene">

<dad = "David">

<kids

<first = "Sam">

<second = "Pam">

>

>

If you want to save settings to a text file, this is how to do it.

dim family as P

dim family.kids as P

family.mom = "Irene"

family.dad = "David"

family.kids.first = "Sam"

family.kids.second = "Pam"

'convert the dot variable to a string

txt = property_to_string(family)

'save the string to a text file

save_to_file(txt,"c:\settings.txt")

delete family

dim family as P

'read the settings from the text file into a variable

txt = get_from_file("c:\settings.txt")

family.mom = ""

property_from_string(family,txt)

? family.mom

= "Irene"

See Also

Variable Functions and Methods