EditINI

(VTScada Library)

Description: Draws an edit field from which a value of an application property in Settings.Dynamic may be set.
Returns: Nothing
Usage: Steady State only.
Function Groups: Graphics
Related to: EditINICheckBox | ReadINI | ReadSectINI | WriteSectINI
Format: \Library.EditINI(Section, VarName [, Title, DataType, FocusID, View, DrawBevel, VertAlign, AlignTitle, UpdateVar, LowLimit, HighLimit])
Parameters:  
Section   
Required. Any text expression giving the name of the section in the file. This should not include the square brackets delimiting the section.
VarName   
Required. Any text expression giving the name of the variable for which the value is to be set.
Title   
Optional. Any text expression to be used as a title for the field. No default.
DataType   
Optional. Any numeric expression giving the type of data accepted by the edit field as follows. No default.

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   
Optional. Any numeric expression from 0 to 32767 for the focus number of this graphic. If this value is 0, the edit field 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   
Optional. Indicates how to display the edit field, 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 display 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   
Optional. 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   
Optional. 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 the title is included when the vertical alignment is calculated is determined by the value of AlignTitle. The default value is 0.

AlignTitle   
Optional. 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   
Obsolete. The running system is always updated.
LowLimit   
Optional. 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. no default:
HighLimit   
Optional. 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 edit field 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:

GUITransform(180, 172, 280, 142,
             1, 1, 1, 1, 1 { Scaling              },
             0, 0          { Movement             },
             1, 0          { Visibility, Reserved },
             0, 0, 0       { Selectability        },
             Variable("Code\Library")\EditIni("System", GiveUpCallTimeout", 
                                              "Give up", 2, 1, 2, 1, 1, 1,
                                               Invalid, 0, 2000));

This causes an edit box to display with the title "Give up". The operator may use it to change the value of GiveUpCallTimeout between the range of 0 and 2000.