EditINI 

(VTS Library)

Description:              This module draws an edit field from which a value for a variable in the Config.ini file may be set.

Returns:                    Nothing

Usage:                       Steady State

Format:                      \Library\EditINI(Section, VarName [, Title, DataType, FocusID, View, DrawBevel, VertAlign, AlignTitle, UpdateVar, LowLimit, HighLimit])

Parameters:             Section     { text }  { required }  { no default: }

                                              Any text expression giving the name of the section in the file; this should not include the square brackets delimiting the section.

                                    VarName     { text }  { required }  { no default: }

                                              Any text expression giving the name of the variable for which the value is to be set.

                                    Title     { numeric }  { optional }  { no default: }

                                              An optional parameter that is any text expression to be used as a title for the field.

                                    DataType     { numeric }  { optional }  { no default: }

                                              An optional parameter that is any numeric expression giving the type of data accepted by the editfield as follows:

DataType

Type

0

Byte (unsigned)

1

Short (2 byte signed)

2

Long (4 byte signed)

3

Double precision floating point (8 byte signed)

4

Text

 

                             Note that for types 1 and 2, if the number entered into the field is prefaced by a "0x", the value is taken to be a hexadecimal value and is converted to a decimal value when return is pressed. The default value is 4.

                                    FocusID     { numeric }  { optional }  { default: 1 }

                                              An optional parameter that is any numeric expression for the focus number of this graphic. If this value is 0, the editfield will display its current setting, but its value will not be able to be changed and it will appear grayed out. The default value is 1.

                                    View     { numeric }  { optional }  { default: varies – see notes}

                                              An optional parameter indicating how to display the editfield , as follows:

View

Display

0

Invisible

1

Normal (color scheme - no graying)

2

Grayed out (only if FocusID is 0)

 

                             This parameter may be used to force an editfield with a FocusID of 0 to be displayed normally, rather than allowing it to default to its grayed color. Note that if the FocusID is not 0, setting this value as 2 will not force the field to gray out. The default value is 2 if FocusID is 0 and 1 otherwise.

                                    DrawBevel     { numeric }  { optional }  { default: true }

                                              An optional parameter that is any logical expression; if true (non-0) a bevel is drawn around the editfield, if false (0) no bevel is drawn. If the editfield is beveled, its size will become fixed and will be the same as that for a droplist. The default value is true.

                                    VertAlign     { numeric }  { optional }  { default: 0 }

                                              An optional parameter that is any numeric expression that sets the vertical alignment of the editfield according to one of the following options:

VertAlign

Vertical Alignment

0

Top

1

Center

2

Bottom 

 

                             Whether or not the title is included when the vertical alignment is calculated is determined by the value of AlignTitle. The default value is 0.

                                    AlignTitle     { Boolean }  { optional }  { default: true }

                                              An optional parameter that is any logical expression; if true (non-0) the title is included in the calculation for vertical alignment, if false (0) it is added to the editfield after it (and its bevel if one exists) has been vertically aligned. The default is true.

                                    UpdateVar     { Boolean }  { optional }  { default: false }

                                              An optional parameter that is any logical expression; if true (non-0) the variable is updated in memory as well as in the .INI file, if false (0) the value of the variable in memory remains the same, even though the .INI file has been updated. The default is false.

                                    LowLimit     { numeric }  { optional }  { no default: }

                                              An optional parameter that is any expression giving the minimum value or minimum number of characters to be accepted by the editfield (depending on the data type). This value may be a decimal, octal or hexadecimal value. If this parameter is valid and a value less than LowLimit is entered in the field (or there are too few characters, in the case of text value), the variable set by the field will revert to the previous value.

                                    HighLimit     { numeric }  { required }  { no default: }

                                              An optional parameter that is any numeric expression giving the maximum value or maximum number of characters to be accepted by the editfield (depending on the data type). This value may be a decimal, octal or hexadecimal value. If this parameter is valid and a value greater than HighLimit is entered in the field (or there are too many characters, in the case of text value), the variable set by the field will revert to the previous value.

Comments:               This module is a member of the VTS Library and must therefore be called from within a GUITransform and prefaced by \Library\.

                             The height of the editfield is constant, with the horizontal boundaries of its calling transform defining its width, and the vertical boundaries of its calling transform defining its height (to a minimum size). The height will include the height of the bevel, but may or may not include the title, depending on the alignment used.

                             For any optional parameter that is to be set, all optional parameters preceding the desired one must be present, although they may be invalid.

Example:

If 1 Main;

[

  Vals[0][0] = "AutoLogoff"; 

  Vals[1][0] = 5; 

  Vals[0][1] = "AutoLogoffMin"; 

  Vals[1][1] = 3; 

  System\WriteSectINI("Config.INI" { Name of file }, 

                      "SecMgr-Admin" { Name of section }, 

                      Vals { Arrays of data }, 

                      0 { Write file format }); 

]

This causes the variables AutoLogOff and AutoLogoffMin in the SecMgr-Admin section of the Config.INI file to have their values set to 5 and 3 respectively.

See Also:

ReadINI | ReadSectINI | WriteSectINI