Download as pdf or txt
Download as pdf or txt
You are on page 1of 347

2006 © Elipse Software Ltda. All rights reserved.

2006.08.05- Version 2.5


1. INTRODUCTION .......................................................................................................................................................... 7

1.1. OBJECTS ................................................................................................................................................................ 7


1.2. SCRIPTS ................................................................................................................................................................. 8
1.2.1. Adding a script ...................................................................................................................................... 10
1.3. PICKS ................................................................................................................................................................... 12
1.4. USER-CUSTOMIZED EVENTS.................................................................................................................................. 19

2. INTRODUCING VBSCRIPT ....................................................................................................................................... 21

2.1. PROGRAMMING ENVIRONMENT.............................................................................................................................. 21


2.2. DATATYPES .......................................................................................................................................................... 22
2.3. VARIABLES ........................................................................................................................................................... 23
2.4. CONSTANTS.......................................................................................................................................................... 25
2.5. OPERATORS ......................................................................................................................................................... 26
2.6. COMMENTS........................................................................................................................................................... 28
2.7. FLOW CONTROL.................................................................................................................................................... 28
2.7.1. If...Then... Else ...................................................................................................................................... 28
2.7.2. Select Case........................................................................................................................................... 30
2.7.3. While... Wend........................................................................................................................................ 31
2.7.4. Do... Loop.............................................................................................................................................. 31
2.7.5. For... Next ............................................................................................................................................. 34
2.7.6. For Each... Next .................................................................................................................................... 35
2.8. CODE CONVENTIONS ............................................................................................................................................ 36
2.9. VBSCRIPTS METHODS USED AT E3 ....................................................................................................................... 38

3. PROGRAMMING WITH E3 ........................................................................................................................................ 43

3.1. OBTAINING REFERENCES TO OBJECTS .................................................................................................................. 43


3.1.1. Accessing server properties .................................................................................................................. 44
3.1.2. Accessing server properties from inside the server............................................................................... 45
3.1.3. Accessing objects of a Screen from a script in the Screen ................................................................... 46
3.1.4. Accessing Screen objects from a script in another Screen object......................................................... 47
3.1.5. Modifying the Screen or Screen objects from the server....................................................................... 47
3.1.6. Accessing objects of an ElipseX from ElipseX itself .............................................................................. 48
3.1.7. Accessing objects from an ElipseX externally ....................................................................................... 49
3.2. ACCESSING OBJECTS ........................................................................................................................................... 54
3.3. W ORKING WITH COLLECTIONS............................................................................................................................... 55
3.3.1. Accessing objects with the Item method ............................................................................................... 56
3.4. SET COMMAND ..................................................................................................................................................... 56

4. EVENTS ..................................................................................................................................................................... 59

4.1. EVENT VARIABLES ................................................................................................................................................ 59


4.2. COMMON EVENTS ................................................................................................................................................. 60
4.3. I/O DRIVER EVENTS .............................................................................................................................................. 61
4.3.1. I/O Tag Events ...................................................................................................................................... 64
4.3.2. I/O Block Events.................................................................................................................................... 64
4.4. SCREEN EVENTS .................................................................................................................................................. 65
4.5. SCREEN OBJECTS EVENTS ................................................................................................................................... 68
4.5.1. Text, Display and SetPoint Events ........................................................................................................ 70
4.6. ACTIVEX EVENTS .................................................................................................................................................. 71
4.6.1. Combo Box and Text Box Events ......................................................................................................... 75
4.6.2. Command Button and Toggle Button Events ........................................................................................ 75
4.6.3. Scroll Bar Events................................................................................................................................... 75
4.6.4. Spin Button Events................................................................................................................................ 75
4.7. VIEWER EVENTS ................................................................................................................................................... 76
4.7.1. User Events........................................................................................................................................... 76
4.8. E3QUERY EVENTS ................................................................................................................................................ 77
4.9. E3BROWSER EVENTS ........................................................................................................................................... 77
4.10. E3CHART EVENTS ......................................................................................................................................... 78
4.11. XCONTROLS AND XOBJECTS EVENTS ............................................................................................................ 78
4.12. REPORT EVENTS ........................................................................................................................................... 79

5. METHODS ................................................................................................................................................................. 81

5.1. METHOD CALL ...................................................................................................................................................... 81


5.2. DEFAULT METHODS .............................................................................................................................................. 81
5.3. I/O DRIVER METHODS........................................................................................................................................... 85
5.3.1. I/O Tag, I/O Block and Block Element Methods .................................................................................... 86
5.4. OPC CLIENT OBJECTS METHOD ........................................................................................................................... 87
5.5. SERVER METHODS ............................................................................................................................................... 88
5.6. DEMO TAG METHOD ............................................................................................................................................. 89
5.7. INTERNAL TAG METHOD ........................................................................................................................................ 89
5.8. SCREEN METHODS ............................................................................................................................................... 90
5.9. FRAME METHODS ................................................................................................................................................. 91
5.10. SCREEN OBJECTS METHODS ......................................................................................................................... 95
5.11. ACTIVEX METHODS ....................................................................................................................................... 96
5.11.1. Common Methods................................................................................................................................. 96
5.11.2. ComboBox Methods.............................................................................................................................. 97
5.11.3. List Box Methods .................................................................................................................................. 99
5.11.4. Text Box Methods ............................................................................................................................... 100
5.12. LINKS METHODS .......................................................................................................................................... 100
5.12.1. Table Links Methods........................................................................................................................... 104
5.13. VIEWER METHODS....................................................................................................................................... 105
5.14. DATABASE METHODS................................................................................................................................... 122
5.15. ALARM METHODS ........................................................................................................................................ 122
5.15.1. Alarm Source Methods........................................................................................................................ 122
5.15.2. AlarmServer Methods ......................................................................................................................... 125
5.16. HISTORIC METHODS .................................................................................................................................... 128
5.17. STORAGE METHODS .................................................................................................................................... 129
5.18. E3BROWSER METHODS............................................................................................................................... 130
5.19. E3QUERY METHODS ................................................................................................................................... 132
5.20. E3CHART METHODS .................................................................................................................................... 135
5.20.1. Axis Methods ...................................................................................................................................... 137
5.20.2. Axis Collection Methods...................................................................................................................... 141
5.20.3. Pen Methods....................................................................................................................................... 142
5.20.4. Pen Collection Methods ...................................................................................................................... 143
5.20.5. Legend Methods ................................................................................................................................. 145
5.20.6. Queries Collection Methods ................................................................................................................ 146
5.21. FORMULA METHODS .................................................................................................................................... 147
5.22. REPORT METHODS ...................................................................................................................................... 152

6. PROPERTIES .......................................................................................................................................................... 157

6.1. COMMON PROPERTIES ....................................................................................................................................... 158


6.2. DRIVER PROPERTIES .......................................................................................................................................... 159
6.2.1. I/O Driver Properties ........................................................................................................................... 159
6.2.2. I/O Tag Properties............................................................................................................................... 164
6.2.3. I/O Block Properties ............................................................................................................................ 173
6.2.4. Block Element Properties.................................................................................................................... 176
6.3. OPC SERVER PROPERTIES................................................................................................................................. 181
6.3.1. OPC Driver Properties ........................................................................................................................ 181
6.3.2. OPC Group Properties ........................................................................................................................ 184
6.3.3. OPC Tag Properties............................................................................................................................ 186
6.3.4. OPC Block Properties ......................................................................................................................... 194
6.3.5. OPC Block Element Properties ........................................................................................................... 197
6.4. DEMO TAG PROPERTIES ..................................................................................................................................... 205
6.5. INTERNAL TAG PROPERTIES................................................................................................................................ 207
6.6. SCREEN PROPERTIES ......................................................................................................................................... 209
6.7. FRAME AND SPLITTER PROPERTIES .................................................................................................................... 213
6.7.1. Frame Property ................................................................................................................................... 213
6.7.2. Splitter Properties................................................................................................................................ 213
6.8. SCREEN OBJECTS PROPERTIES .......................................................................................................................... 214
6.8.1. Screen Objects Common Properties................................................................................................... 215
6.8.2. Draw and Text Screen Objects Common Properties........................................................................... 216
6.8.3. Round Rectangle Properties ............................................................................................................... 222
6.8.4. Arc Properties ..................................................................................................................................... 222
6.8.5. Text, Display, and SetPoint Properties................................................................................................ 223
6.8.6. Picture Properties................................................................................................................................ 226
6.8.7. Scale Properties.................................................................................................................................. 232
6.8.8. Object Group Properties...................................................................................................................... 237
6.8.9. Slide Properties (Linear and Rotation Sliders) .................................................................................... 239
6.8.10. Rotation Slider Properties ................................................................................................................... 243
6.9. ACTIVEX PROPERTIES ........................................................................................................................................ 243
6.9.1. Common Properties ............................................................................................................................ 243
6.9.2. Check Box and Option Button Properties............................................................................................ 247
6.9.3. Combo Box Properties ........................................................................................................................ 250
6.9.4. Command Button Properties ............................................................................................................... 257
6.9.5. Label Properties .................................................................................................................................. 259
6.9.6. List Box Properties .............................................................................................................................. 261
6.9.7. Scroll Bar Properties ........................................................................................................................... 265
6.9.8. Spin Button Properties ........................................................................................................................ 266
6.9.9. Text Box Properties............................................................................................................................. 267
6.9.10. Toggle Button Properties..................................................................................................................... 272
6.10. LINK PROPERTIES ........................................................................................................................................ 275
6.10.1. Links Common Properties ................................................................................................................... 275
6.10.2. Simple, Bidirectional, and Reverse Link Properties............................................................................. 276
6.10.3. Analog Link Properties ........................................................................................................................ 277
6.10.4. Digital Link Properties ......................................................................................................................... 280
6.10.5. Table Link Properties .......................................................................................................................... 285
6.11. VIEWER PROPERTIES................................................................................................................................... 290
6.12. DATABASE PROPERTIES .............................................................................................................................. 293
6.13. ALARMS PROPERTIES .................................................................................................................................. 294
6.13.1. Alarms Area Properties ....................................................................................................................... 294
6.13.2. AlarmSource Properties ...................................................................................................................... 295
6.13.3. Alarm Server Properties...................................................................................................................... 297
6.14. E3ALARM PROPERTIES ................................................................................................................................ 299
6.15. HISTORIC PROPERTIES ................................................................................................................................ 302
6.16. STORAGE PROPERTIES ................................................................................................................................ 304
6.17. E3QUERY PROPERTIES ............................................................................................................................... 305
6.18. E3BROWSER PROPERTIES........................................................................................................................... 309
6.19. E3CHART PROPERTIES ................................................................................................................................ 313
6.19.1. Pen Properties .................................................................................................................................... 320
6.19.2. Pen Collection Property....................................................................................................................... 324
6.19.3. Query Collection Property ................................................................................................................... 324
6.19.4. Column Properties .............................................................................................................................. 324
6.19.5. Legend Properties............................................................................................................................... 325
6.19.6. Axis Properties .................................................................................................................................... 325
6.19.7. Axis Collection Properties ................................................................................................................... 327
6.20. FORMULA PROPERTIES ................................................................................................................................ 328
6.21. XCONTROLS AND XOBJECTS PROPERTIES ................................................................................................... 328
6.22. REPORT PROPERTIES .................................................................................................................................. 328
6.22.1. Report Layout Properties .................................................................................................................... 329
6.22.2. Report Sections Properties ................................................................................................................. 332
6.22.3. Group Header Properties .................................................................................................................... 333
6.22.4. Page Detail Properties ........................................................................................................................ 335
6.22.5. Group Footer Properties...................................................................................................................... 335
6.22.6. Report Object Default Properties ........................................................................................................ 336
6.22.7. Bar Code Properties............................................................................................................................ 337
6.22.8. Elipse, Rectangle and Round Rectangle Properties ........................................................................... 339
6.22.9. Figure Property ................................................................................................................................... 340
6.22.10. SetPoint properties.............................................................................................................................. 342
6.22.11. Text Properties.................................................................................................................................... 344
6.22.12. Line Properties .................................................................................................................................... 345
6.22.13. Page Break Properties ........................................................................................................................ 346
6.22.14. Table Properties.................................................................................................................................. 347
These are the conventions for this manual:

EXAMPLE DESCRIPTION
Filenames and other terms in operational system level are
typed in font Tahoma, upper case.
Field names and options shown in the Screen, menus or
object tabs are typed in font Tahoma.
“Chart” Characters between quotation marks should be typed where
mentioned, with no quotation marks.
Screen1.Show() Excerpts of programs (scripts) are indicated by Courier font.
They must be typed in the appropriated places and then
compiled, for error verification.
DriverLocation Italic font characters indicate either E3’s methods or
properties. Methods are followed by parenthesis.
Expressions between the symbols < > must be replaced by
the name of the object being mentioned.
Optional parameters are indicated between brackets in
method calls.
! Expressions between brackets and typed in Tahoma font
indicate key name. When followed by the + symbol, it
indicates you must press the second key while you press the
first key.
Scripts are programming language modules that allow you to create procedures
associated to specific events, providing you with higher flexibility in the
development of applications. Each object (item of an application) from E3 has a list
of previously defined events, but it is also possible to define new events created by
the user.

Objects are reusable software components that allow you to maximize use, and
increase quality and productivity of applications.
Each object from E3 encapsulates three different parts (properties, methods, and
events) that you can manipulate to obtain the advantages of its functionality in your
application.
Properties define the object’s attributes, such as the appearance of a Screen control,
or an object’s initial value when you start the application.
Methods are functions that perform a specific action with or within an object.
Events are notifications generated by an object as a response to some particular
occurrence, such as a mouse click or a change in tag value, among others.
One of the main characteristics of objects and object-oriented languages is their
ability of inheritance among each other, i.e., they can inherit characteristics of one or
more objects, having the same specific functionalities. So, you can have different
objects working together to provide characteristics of another derived object.
For example, take the object E3Chart. It consists internally of many objects, such as
titles, subtitles, scales, divisions, queries, and pens. Notice how each object
contributes for the functionality of E3Chart as a whole: scales help locate point
values, subtitles help identify pens and their values, and pens draw values in the
E3Chart.
By handling objects within the E3Chart, you can create two instances of this object
that are very different from one another. To handle a specific object, you have to
access it through a hierarchy. If both E3Charts are on the same Screen, you should
first access the Screen, then the preferred E3Chart, and then one of its properties or
child-objects. When there are many objects of the same type, usually they can be
accessed through a collection. A collection is a special object that manages a set of
similar objects. An example in the E3Chart is the collection Pens, which allows
access to all E3Chart pens.
Introduction 7
E3 - Scripts - Reference Manual

The language used for E3 Studio scripts is VBScript, a subset of the Visual Basic®
language developed by Microsoft. VBScript has a quick, light, and portable
interpreter, developed for the use in Internet browsers and other applications using
ActiveX Controls, Automation Servers, and Java Applets.
As seen before, scripts are associated to object’s events. However, to facilitate and
increase the development speed, E3 has already incorporated some of the most
common actions that can be made with scripts through wizards called Picks. You
can therefore define that a given event will either run a script, a pick, or a
combination of both, in a sequence that is also pre-defined.
Each view at E3 Studio displays at least two tabs on its lower side: Design and
Scripts, with the exception of the objects Database and Alarm Server, which do not
present the tab Design. The objects and its child-objects can be manipulated in the
tab Design; to manipulate their scripts, use the script Scripts. The buttons available
in the latter are:

8 Introduction
E3 - Scripts - Reference Manual

Available options for Scripts tab


FIELD ICON ACTION/FUNCTION
"#$ " % Selects the object whose script will be
manipulated.
!& " % Selects the event to be applied to the object.

$' Adds scripts associated to the event.

$
() ' $ * Adds the pick “Open Screen”.

$() ' + Adds the pick “Open Modal Screen”.


$ *
$() , Adds the pick “Run Application”.
''$ *
$() + & ,* Adds the pick “Load Value”.

$
()- .. & , * Adds the pick “Toggle Value”.

$
() ' * Adds the pick “Print Report”.

& $+ Removes the selected script or pick from the


$ '/'$
( Actions List.
& $+ Moves the selected action up, in the order of
$ '/'$
(,' the Actions List for the event.
& $+ Moves the selected action down, in the order
$ '/'$
(+ of the Actions List for the event.
0'' Opens AppBrowser’s window.

1+ Finds instances of a given text.

1+' &, Selects the previous instance of text in the


results list.
1+ % Selects the next instance of text in the results
list.
'$ Replaces the instances in the results list with
another text sample.
, & Creates a user-customized event.

&, & Removes the user-customized event.

!+ , & Edits the user-customized event.

' $+ Compiles the selected script, and shows its


$' errors in the panel Messages.
' $' Compiles all scripts associated to the event.
2 &
' & Compiles all events associated to the object.
2 "#$

Introduction 9
E3 - Scripts - Reference Manual

The execution order is top-down. To alter the order, just use the buttons and .
Use the button to check for errors in the specified script. The error messages of
the compiler are presented in the panel Messages, in the lower part of the tab Scripts.
Double-click the error in case you want to it to be selected in the script.

Picture 1: Compiler’s message

!
To add a script to an object, follow these steps:
Select the object for which you want to create the script and click on the
Scripts tab.

Picture 2: Scripts tab

10 Introduction
E3 - Scripts - Reference Manual

Click on the icon Script. The scripts editor is then opened, according to
the picture below.

Picture 3: Adding a new script to the object

Input the VBScript commands in the text editing box.

NOTE: use the character _ (underline) whenever you wish to add a line break to
make the code more legible. The underline character indicates that the line continues
on the next line.
For example:
If intBoilerTemperature3 > 120 and _
intBoilerTemperature4 > 120
Then
bSendAlarm = True
bAlarmOn = True
End If
Each event can have several scripts and several picks associated to it. These are
called actions. The list of actions can be seen on the upper side of the Scripts. Each
object can have any number of events with scripts or picks associated.

NOTE: By right-clicking any of these actions described above, a menu will open to
allow you cut, copy and paste scripts and picks among events.
Introduction 11
E3 - Scripts - Reference Manual

" #
Picks implement a friendlier way of achieving the most common procedures, saving
configuration time. Among them there are actions such as switching Screens or
values assignment, which are very common in the creation of a project.
Next, there is a description of the picks available through the tab Scripts.

Open Screen
Opens a Screen or a specific Frame.

Picture 4: Open Screen pick settings

12 Introduction
E3 - Scripts - Reference Manual

Available options for Open Screen pick


OPTION DESCRIPTION
' $ Selects the Screen to be opened.
Selects the Frame where the Screen will be viewed. If it is
blank, it will be the current Frame.
3 Defines Screen zoom, when shown.
Determines the existence (or not) of configuration parameter
for the Screen.
! " $ " Allows using scrolling bars on the Screen.
' $4 $ Indicates Screen position, in pixels.

' $4 $ 3 Indicates Screen size, in pixels.


5 + 4 Calls window style dialog (see below).

Window Style Dialog Box


This dialog box allows you to set the window style to be displayed, by defining title
and availability of edges, and closing, maximizing and minimizing buttons, among
others. If the option 6 + , + . is selected, the system disables
this window options and assumes the Viewer default style, as seen in the Viewer tab
under the Viewer object properties.

Picture 5: Window Style dialog box

Introduction 13
E3 - Scripts - Reference Manual

Open Modal Screen


Opens a Modal Screen, i.e., a Screen that does not allow the user to interact with
other Screens while it is active.

Picture 6: Open Modal Screen pick settings

Available options for Open Modal Screen pick


OPTION DESCRIPTION
' $ Selects the Screen to be opened.
- Defines the window title. This text will be concatenated to
the Screen name.
3 Defines Screen zoom, when shown.
Determines the existence (or not) of configuration
parameter for the Screen.
! " $ " Allows the use of scrolling bars on the Screen.
' $4 $ Determines the position (in pixels) of the frame on the
' Screen, from the upper left side of the Screen.
' $4 $ 3 Determines width and height of the Screen (in pixels).
5 + 4 Allows configuring the window style to be shown, by
defining title, close, maximize and minimize buttons,
among others (see Open Window pick above).

14 Introduction
E3 - Scripts - Reference Manual

Run Application
Runs a specific application program.

Picture 7: Run Application pick settings

Available options for Run Application pick


OPTION DESCRIPTION
+ By clicking the button [ ] it is possible to browse the disk to
select the application file to be run.
Allows specifying arguments for application calling.
Determines the working directory of the application to be
executed.
5 + Determines the type of window for the application’s execution:
normal, minimized, or maximized.

Introduction 15
E3 - Scripts - Reference Manual

Load Value
Loads a value into a tag.

Picture 8: Load Value pick settings

Available options for Load Value pick


OPTION DESCRIPTION
-. Specifies the tag name in which the value will be loaded. It is possible
to select the tag in the AppBrowser by pushing the button [7].
8, Determines the value to be loaded in the tag. It is possible to select the
data type by pushing down the arrow key.

16 Introduction
E3 - Scripts - Reference Manual

Toggle Value
Allows toggling the value of a tag. If tag value is equal to 8 , 9, then the tag gets
8 , :. If tag value is equal to 8 , :, then the tag gets 8 , 9. If tag value is
different from either 8 , 9 or 8 , :, the tag gets 8 , 9.
It is possible to put as many Toggle Value picks as necessary. It allows checking
multiple values for the same tag or even for several tags in the same event.

Picture 9: Toggle Value pick settings

Available options for Toggle Value pick


OPTION DESCRIPTION
-. By pushing the button [ ], E3 opens the AppBrowser to select the
preferred tag.
8,9 Determines the first value to be compared. If tag value is equal to
8 , 9, the tag gets 8 , :.
8,: Determines the second value to be compared. If tag value is equal to
8 , :, then tag gets 8 , 9.

Introduction 17
E3 - Scripts - Reference Manual

Print Report
Allows printing a report on Screen or in the printer.

Picture 10: Print Report pick settings

Available options for Print Report pick


OPTION DESCRIPTION
' Selects the report to be printed.
,', Determines the type of report output:
: Sends the report to the printer. Corresponds to
Print() method.
$ : Previews report printing on Screen. Corresponds
to PrintPreview() method.

18 Introduction
E3 - Scripts - Reference Manual

$ % & ' ( )
Although E3 comes with a wide range of events, there are many times when the user
may wish to create a specific event for their own application.
An example of use of user-customized events would be a calculation, or a more
complex task in an object, when the generating event comes from another tag or
property.
Although you can create and execute this type of work from the tag or property
generating the event, there are several advantages in keeping the script next to the
object that will suffer the action of the script. Among these is the additional work
needed to make an object point to another, not to mention the small amount of work
needed in maintenance, because if by any reason it is necessary to modify or delete a
tag or property generating the event, it will not be necessary to modify a second
object.
Another advantage comes from the fact that if you erase the tag generating the event,
the object does not lose its script, so long as you indicate another event generating
source.
Internal events generation also makes the creation of libraries easier, for each time a
library component is inserted in an application it also brings scripts and calculations
that may be necessary, reducing configuration work.
To generate a new internal event in an object, follow these procedures:

Click on the button Create user event, or then on [


& ], in the Events Combo Box. E3 then opens a window for setting the
event’s properties.

.
Picture 11: Window for adding user-customized events

Introduction 19
E3 - Scripts - Reference Manual

Available options for Event window


OPTION DESCRIPTION
!& ; Name identifying the event.
' ' 4/ %
' Expression generating the event. Can be copied through
AppBrowser, by clicking the button .
,$ + Indicates whether the event is an !& (the event
occurs whenever the expression is true) or an
52 !& (the event occurs cyclically, at pre-defined
intervals).
' & & 47 When filled, indicates that the event is an 52 !& .
Indicate the event repetition cycle (i.e., its periodicity
while the generating expression is true) in milliseconds.
2 . &, Indicates that the event is an 8 , 2 . +, i.e.,
the event occurs whenever the expression value changes.
- + $ $ Indicates that the connection of the event generating
$
2 . expression must be considered as a change or not.

Click on < to finish the process and insert the event. It will now be a
part of the Events Combo.
To alter this event, select it and click on Edit user event. The previous
window is then opened again to edit the information on the event.
To erase this event, select it and click on Remove user event.
IMPORTANT: when you click on this option, the event’s scripts are lost.

20 Introduction
! *+

VBScript is a language based on Visual Basic® that brings the capacity of scripting
to applications that run on Windows.
VBScript exchanges information with applications using the ActiveX Scripting
technology. With ActiveX Scripting, browsers and other client-applications like E3
Viewers are able to compile scripts and call functions, among other procedures. This
enables scripts developed for an application or library (that should be executed in the
graphical interface) to run either in the E3 Viewer or an Internet browser, with no
need of adaptation on the application.
Further information about VBScript can be obtained on the online manual
"VBScript Reference Guide”, in the E3 Program Group.

! '' !) '
The script-programming environment in the E3 Studio can be accessed by right
clicking any object, and selecting the option Properties. On Scripts tab you can see a
combo box where you can define which event will be the script generator. As seen
in the previous chapter, there are two types of events in an E3 object: predefined
events, and user-customized events.
Predefined events vary from object to object, depending on its use and functionality.
A Screen object, for example, has graphical interface related events, like OnClick
(called whenever clicking the object) or OnDbClick (called whenever double
clicking it); an object like an IODriver, on the other hand, has communication
related events, like OnCommError (called whenever there is a communication
error). You can also define other events for the object, as seen before.
When you associate a script to an event in an object, the typing field presents a
procedure declaration whose definition is automatic and formed by the following
text:
Sub ObjectName_EventName()
End Sub
where "#$; is the name of the associated object, and !& ; is the
name of the aforementioned event. Script commands should come between these
two lines.
To help typing the script, you can use AppBrowser. When choosing the preferred
method or property, you can activate the Copy button. The chosen tag, property, or

Introducing VBScript 21
E3 - Scripts - Reference Manual

method will be inserted in the cursor position on the editing board of the script. The
cursor position is shown by an animated blinking arrow.

, -
VBScript has only one datatype called Variant. A Variant is a special datatype that
can contain different types of information, depending on how it is being used.
Because the variant is the only datatype in VBScript, it is also the type of return data
of all functions in VBScript.
In practice, a variant may contain either numbers or text. A Variant behaves as a
number when used in numerical expressions, and as a string in text expressions. It
means that if you are working with data that resemble numbers, VBScript assumes
that these are really numbers, and performs appropriately to this type of data.
Likewise, if you are working with data that look like text, VBScript treats them as if
they were text. You can also force numbers to behave like text by putting them
between quotation marks (" ").

Variant Subtypes
Beyond simple classifications of number or text, a variant can make distinctions on
the specific nature of the numerical information. For example, you can have
numerical information representing date/time. When used with other date/time data,
the result is always expressed in a date/time format. You can also have a variety of
numerical type information of different sizes, from logical types (Boolean) to big
floating-point numbers. These different categories of information that can be
contained in a variant are called subtypes. In most cases, you simply attribute the
preferred type of data to a variant and it behaves in the most appropriated way.

Variant Subtypes
SUBTYPES DESCRIPTION
! '4 Empty (non initialized variant). The value is 0 for numerical variables, or a
string of zero length ("") for text variables.
;, Null. The variant does not contain valid data intentionally.
Logical. Contains true (True or 1) or false (False or 0).
4 Contains integers ranging from 0 to 255 (8 bits).
. Contains integers ranging from -32768 to 32767 (16 bits).
, $ 4 Monetary values, ranging from -922.337.203.685.477,5808 to
922.337.203.685.477,5807.
. Contains integers varying from -2,147,483,648 to 2,147,483,647 (22 bits).
. Contains a floating-point number of single precision ranging from
3,402823E38 to -1,401298E-45 (for negative values), and from 1,401298E-
45 to 3,402823E38 (for positive values).
= ," Contains a floating-point number of double precision ranging from
1,79769313486232E38 to -4,94065645841247E-324 (for negative values),
and from 4,94065645841247E-324 to 1,79769313486232E38 (for positive
values).
22 Introducing VBScript
E3 - Scripts - Reference Manual

= - Contains a number representing a date from January, 1st, 100 to December,


31st, 9999.
. Contains a text of variable length that can have about 2 billion characters of
length.
"#$ Contains any object whatever.
! Contains an error code.

" *
A variable is a memory location in the computer where you can store information
that may change during script execution. For example, you can create a variable
called ClickCount to save the number of times the user clicked an object. The place
where the variable is stored in the computer memory is not important. Actually, it is
only necessary to know the name of the variable to see or modify its value. On
VBScript, the variables are always of base-type Variant.

Declaring variables
You can declare variables in two different manners: implicitly, or explicitly.
To declare a variable implicitly, simply use its name on the script. The variable will
automatically be created and initialized with the attribution value, or it will remain
Empty, in case it does not receive any value before being used.
This a quick practice, but if the script is very extensive this can cause confusion and
the creation of more than one variable with the same name, generating bugs in the
script.
To declare variables explicitly, use the command Dim, as in the example below:
Dim Temperature
You can declare multiple variables separating each variable name by a comma. For
example:
Dim Left, Right, Top, Bottom
Because all scripts in E3 are associated to a specific object, variables are always
local, valid only for the script scope. To have public or global variables, you must
create an internal tag and use it to store the preferred value.

Restrictions on variables names


Names of variables must obey VBScript rules for nomination:
• Must start with an alphabetic character.
• Cannot contain dots.
• Must not exceed 255 characters.
• Must be unique in the scope where they are declared, i.e., inside the
script.

Introducing VBScript 23
E3 - Scripts - Reference Manual

• Special characters (&, %, @, etc) can be used, so long as typed between


brackets [ ].
Attributing values to variables
Values are attributed to variables through the symbol (=), similarly to other
programming languages. For example:
Dim Width, Height
Width = 20
Height = 12
In the example above, the variables Width and Height will receive the values 20 and
12, respectively.

Scalar and array variables


In most cases, you may wish to assign only a simple value to a declared variable. In
this case, the variable containing a single value is called scalar variable. However, in
other cases it is convenient to attribute more than one value to a single variable. To
do so, you can create a variable that contains a series of values, the array variable.
Scalar and array variables are declared in the same way, but the declaration of an
array uses parentheses containing its dimension (the amount of value the variable
will store). In the following example, an 11-element-long array is declared:
Dim A(10)
Although the number between the parentheses is 10, all arrays in VBScript are zero-
based. In a zero-based array the number of elements is always the number shown
between the parentheses plus one. An array variable is called fixed-size, because
once its size is declared, it cannot be modified.
You can attribute data to each element of an array by using an index. Starting from
zero and finishing in 10, you can attribute data to the elements of an array as
follows:
A(0) = 256
A(1) = 324
A(2) = 100
.
A(10) = 55
Similarly, by using an index, you can copy data from any element of the array. For
example:
MyVariable = A(8)
Arrays are not limited to a simple dimension. Some arrays can have more than 60
dimensions. To declare multiple dimensions, you should specify them in the
parentheses, and separate them by commas.

24 Introducing VBScript
E3 - Scripts - Reference Manual

In this example, the variable 4- " is a two-dimensional array consisting of 6


lines and 11 columns:
Dim MyTable(5,10)
In a two-dimensional array, the first number is always the number of lines; the
second number is the number of columns.
You can also declare an array whose size changes during script execution. This is
called a dynamic array. A dynamic array is declared through the command Dim, like
a regular array, but the dimensions between parentheses are not specified. For
example:
Dim MyArray()
To modify a dynamic array you should use the command ReDim, indicating the new
dimensions. If it is necessary to keep the data previously attributed to the array, you
should use the Preserve key.
In the following example, the initial size of the array is 25. Next, the command
ReDim augments the array dimension to 30, but it uses the key word Preserve to
preserve previous data.
Sub ModifyArray
Dim MyArray(25)
MyArray(1) = "Position 1"
MyArray(14) = "Position 14"
MyArray(23) = "Position 23"
'Remeasure the MyArray dimension keeping its data
ReDim Preserve MyArray(30)
Msgbox MyArray(23) ' will show "Position 23"
End Sub
There is no limit for the number of times you can modify the dimension of a
dynamic array; however, whenever you diminish the size of an array, the data from
the eliminated positions are lost.

$
A constant is a special type of variable that never changes its value. VBScript
already has a set of predefined constants. See the language reference at Microsoft®
website for further details.

Creating constants
You can create user-customized constants by using Const command. Using Const
command you can create text or numerical constants as names with meaning and
attribute literal values. For example:

Introducing VBScript 25
E3 - Scripts - Reference Manual

Const MyText = "This is a text."


Const MyAge = 36
Notice that the literal text is placed between quotes (" "). The quotes are the most
obvious method to differentiate text values from numerical values. You can
represent literal dates and times inserting them between +/- signs or number signs
(#). For example:
Const CutoffDate = #1997-01-06#
It is of good practice to adopt a scheme of names to differentiate constants from
variables. It will prevent you from trying to reattribute constant values while the
script is being executed. For example, you can wish to use a prefix "vb" or "con" in
the constants names or write the constants in upper case. Differentiate constants of
variables eliminates confusions which can rise when developing complex scripts.
Examples:
Const TEMP_LIMIT = 112
Const vbBlack = 0 'vbBlack is predefined in VBScript
Const conFullLegalAge = 18

.
VBScript has a vast range of operators as we can next see.

Arithmetical operators
(addition)
> (subtraction or unary negation)
? (multiplication)
/ (decimal division, returns a fixed-point number)
@ (integer division, returns an integer number)
+ (remainder of the division)
A (exponent)

Comparison operators
(lesser than)
(greater than)
B (lesser or equal to )
B (greater or equal to)
B (equal to )
(different from)

Strings operators
C (concatenation)

26 Introducing VBScript
E3 - Scripts - Reference Manual

Logical operators
0+ (AND)
(OR)
; (Negation, unary operator)
D (exclusive OR)

Precedence of operators
When many operations occur in an expression each part is evaluated and solved in a
predetermined order called precedence of operators.
You can use parentheses to redefine the precedence order and force some parts of an
expression to be always executed before those, which are out of the parentheses.
Meanwhile, within the parentheses are kept the standard precedence of operators .
When expressions contain operators of more than one category, the arithmetical
operators are evaluated first, followed by the comparison operators and the logical
operators are the last ones.
Arithmetical operators are evaluated in the following order:
1. - (unary negation)
2. ^
3. *, /
4. \
5. Mod
6. +, -
7. & (Concatenation of strings)
When multiplication and division are together in the same expression, each
operation is evaluated as they appear, from the left to the right. In the same way,
when addition and subtraction are together in the same expression, each operation is
evaluated in the order they appear, from the left to the right. The operator of strings
concatenation (&) is not an arithmetical operator, but in precedence it occurs after
all arithmetical operators and before all comparison operators.
All comparison operators have the same precedence, i.e., they are evaluated from the
left to the right, in the order they appear.
Logical operators are evaluated in the following order: Not, And, Or and Xor.

Introducing VBScript 27
E3 - Scripts - Reference Manual

/ ''
Comments lines and notes in the code can be added using the character '
(apostrophe) in the beginning of the line.
Example:
Sub Example()
Dim X
' This is an example of comment
X = 1 ' commenting that the variable X received 1
End Sub

0 1 2
You can control the script execution flow with condition and loop commands. With
conditional commands you can write a VBScript code that take decisions and repeat
actions.

0 )
The If...Then...Else command is used to evaluate if a condition is true or false and
depending on the result, to specify one or more commands to be executed. Usually
condition is an expression that uses a comparison operator to compare one value or
variable with another.
The If...Then...Else commands can be nested in as many levels as you need.
However, you should respect the block syntax : if the Then has only one command
you can put it in the same line. If it has more than one command you should put the
Then marking the beginning of the block followed by the desired commands in
separated lines, and finalize it with one of these commands: Else, ElseIf or End If
(see next examples).

Executing commands if a condition is true


In order to execute only one command when a condition is true, use the syntax of a
line for the If...Then...Else command. The following example shows the syntax of a
line. Notice that this example omits the key word Else.

28 Introducing VBScript
E3 - Scripts - Reference Manual

Sub FixDate()
' Declare the variable myDate
Dim myDate
' Attribute February, 13rd, 1995 to myDate variable
myData = #1995/02/13#
' If myDate is prior
' to today (Now system variable)
' then make myDate be equal to today
If myDate < Now Then myDate = Now
End Sub
In order to execute more than one code line you should use block syntax or multiple
lines. This syntax includes the End If command as showed below:
If value = 0 Then
AlertLabel.ForeColor = vbRed
AlertLabel.Font.Bold = True
AlertLabel.Font.Italic = True
End If

Executing commands if a condition is true and other commands


if the condition is false
You can use an If...Then...Else in order to define two blocks of code: one to be
executed if the condition is true and another one to be executed if the condition is
false.
For example:
Sub Alert(value)
If value = 0 Then
AlertLabel.ForeColor = vbRed
AlertLabel.Font.Bold = True
Else
AlertLabel.Forecolor = vbBlack
AlertLabel.Font.Bold = False
AlertLabel.Font.Italic = False
End If
End Sub

ElseIf clause
A variation in the If...Then...Else command allows you to choose among many
alternatives. Adding ElseIf clauses we expand the command functionality making
possible the control of the execution flow based on distinct possibilities. For
example:

Introducing VBScript 29
E3 - Scripts - Reference Manual

Sub InformValue(value)
If value = 0 Then
MsgBox value
ElseIf value = 1 Then
MsgBox value
ElseIf value = 2 then
Msgbox value
Else
Msgbox "Invalid value!"
End If
It is possible to add as many ElseIf clauses as necessary, but the extensive use of
ElseIf clauses can be replaced by the Select Case command making the script
clearer and more optimized.

0
The Select Case structure is a more effective alternative to the If...Then...ElseIf to
select one among multiple blocks of instructions conditioned to a variable.
The Select Case command works with a simple expression of test that is evaluated
one time, in the beginning of the structure. The result of the expression is then
compared to the values for each desired Case. If there is a true comparison the block
of instructions associated to that case is executed. For example:
Select Case WarningType
Case 1
Msgbox "Warning: tag with critical low value!!!"
Case 2
Msgbox "Warning: tag with low value!"
Case 3
Msgbox "Warning: tag with high value!"
Case 4
Msgbox "Warning: tag with critical high value!!!"
Case Else ' if any case is selected
Msgbox "Normal situation."
End Select
Notice that the Select Case command evaluates the expression only one time in the
beginning of the structure. In opposition, the If...Then...ElseIf structure will
evaluate a different expression for each ElseIf instruction, making the code less
optimized. In these cases, always prefer the Select Case structure.

30 Introducing VBScript
E3 - Scripts - Reference Manual

0" 3 3
The While... Wend command allows repeating one block of commands while a
condition is true. This command is provided in VBScript for those who are familiar
to its use. Meantime, the lack of flexibility recommends the use of the Do... Loop
instruction.

0$ , 4
You can use Do... Loop commands in order to execute a block of code indefinite
number of times. The commands are repeated while the condition is true or until the
condition become true.

While keyword
The While key word should be used in a Do... Loop instruction in order to indicate
the loop will be executed while its condition is true. It is possible to evaluate the
condition before entering in the loop or after the loop have been executed at least
one time.
In the following example, in the !& , 52 procedure, if we attribute 9
to myNum instead of 20, the code within the loop will never be executed.
In the !& , 0 52 procedure, the code within the loop will be execute only
one time within the loop due to the condition already be false.
Examples:

Introducing VBScript 31
E3 - Scripts - Reference Manual

Sub EvaluateBeforeWhile()
Dim counter, myNum
counter = 0
myNum = 20
Do While myNum > 10
myNum = myNum – 1
counter = counter + 1
Loop
MsgBox "The loop had " & counter & " repetitions."
End Sub

Sub EvaluateAfterWhile()
Dim counter, myNum
counter = 0
myNum = 9
Do
myNum = myNum – 1
counter = counter + 1
Loop While myNum > 10
MsgBox "The loop had " & counter & " repetitions."
End Sub

Until keyword
The Until key word indicates the loop will be executed until its condition be true.
There are two methods of using the Until key word in order to evaluate a condition
in a Do... Loop loop. You can evaluate a condition before entering in the loop (as
showed in the example !& , 6 ) or after the loop have been ran at least
one time (as showed in the example !& , 0 6 ). While the condition is
false, the loop occurs.

32 Introducing VBScript
E3 - Scripts - Reference Manual

Examples:
Sub EvaluateBeforeUntil()
Dim counter, myNum
Counter = 0
myNum = 20
Do Until myNum = 10
myNum = myNum – 1
counter = counter + 1
Loop
MsgBox "The loop had " & counter & " repetitions."
End Sub

Sub EvaluateAfterUntil()
Dim counter, myNum
Counter = 0
myNum = 1
Do
myNum = myNum + 1
counter = counter + 1
Loop Until myNum = 10
MsgBox "The loop had " & counter & " repetitions."
End Sub

Exit Do command
It is possible to force the exit of a Do... Loop loop by the Exit Do command. This
command ignores the condition specified in the loop and closes it unconditionally.
Due to the fact of desiring to exit only in special situations (like avoiding an infinite
loop) you should use the Exit Do command in the true condition of an
If... Then... Else command. If the condition is false the loop runs normally.
In the following example, myNum receives a value that creates an infinite loop. The
If... Then... Else command verifies this condition, preventing an infinite execution.

Introducing VBScript 33
E3 - Scripts - Reference Manual

Example:
Sub ExampleExitDo()
Dim counter, myNum
counter= 0
myNum = 9
Do Until myNum = 10
myNum = myNum - 1
counter = counter + 1
If myNum < 10 Then Exit Do
Loop
MsgBox "The loop had " & counter & " repetitions."
End Sub

0. 1 5
You can use the For... Next command in order to execute a block of instructions a
specific number of times. For loops, use a variable as counter which value is
increased or decreased in each repetition of the loop.
The following example makes the tag example receives the value of the expression
for 50 times. The For command specifies the counter X variable and its initial and
final values. The Next command increases the counter and verifies if it reached the
limit. If not it executes the loop one more time. If yes, the script continues.
Sub Execute50Times()
Dim X, example
For X = 1 To 50
example = X * 2 ' receives 2, 4, 6, 8, 10 etc.
Next
End Sub
Using Step key word you can increase or decrease the counter variable for the value
you specify. In the following example the counter is increased by 2 each time the
loop repeats. When the loop is over the total is the sum of 2, 4, 6, 8 and 10.
Sub TotalOfTwo()
Dim j, total
For j = 2 To 10 Step 2 ' count by 2
total = total + j
Next
MsgBox "The total is " & total
End Sub
In order to decrease the counter, use a negative value for Step. You should specify a
final value lesser than the initial value. In the following example myNum is

34 Introducing VBScript
E3 - Scripts - Reference Manual

decreased by 2 each time the loop repeats. When the loop is over the total is the sum
of 16, 14, 12, 10, 8, 6, 4 and 2.
Sub OtherTotal()
Dim myNum, total
For myNum = 16 To 2 Step –2
total = total + myNum
Next
MsgBox "The total is " & total
End Sub
You can exit from any For... Next command before the counter reaches its final
value using the Exit For command. This command behaves similarly to the Exit Do
command finalizing the loop unconditionally.

0/ 1 ) 5
A For Each... Next loop is similar to a For... Next loop. Instead of repeating the
instructions of a block a specific number of times, a For Each... Next loop repeats a
group of command for each item in a collection of objects or for each element in an
array. This is very useful when you do not know how many elements a collection
contains.
Example:
Sub cmdChange_OnClick
Dim d 'Declare a variable
' d will be an object of type Scripting.Dictionary
Set d = CreateObject("Scripting.Dictionary")
' Add items to collection d
d.Add "0", "Athens"
d.Add "1", "Belgrade"
d.Add "2", "Cairo"
For Each I in d ' I é implicitly declared
Document.frmForm.Elements(I).Value = D.Item(I)
Next
End Sub

Introducing VBScript 35
E3 - Scripts - Reference Manual

6
The main reason for using a consistent set of codification conventions is to
standardize the codification structure and style of a script or a set of scripts so that
you and other people can read and understand the code.
The use of good codification conventions results in a precise, legible and non-
doubtful font-code that is consistent with the convention of other languages and
makes it as intuitive as possible.

Nomination of procedures, constants, variables and objects


The nomination of constants, variables, procedures and objects is an important issue:
the names should always state its purpose.

Procedures
A good technique is using the pair verb-noun for the nomination. Meanwhile, do not
use vague, doubtful or generic words, like “do”, “thing” or “this”. If you find
difficulties nominating a procedure using these suggestions, maybe it has no reason
of existing or its purpose is wrong.
Examples: ClassifyMatrixNames, CalculateInterestRate.

Constants
Use the prefix “con” followed by the constant name. Start the constant name with
upper case. For constants names with two or more words separate them by using
only upper cases to define the beginning of the new word.
Example: conMyConstant.

Variables
Although a reasonable extensive name be recommended, names using more than 32
characters are difficult to read and to type. In this case it is good to use abbreviated
names, mainly for variables, which are largely used like counters in loops.
Meanwhile you should use the same standard of abbreviation in all of the code (do
not define, for example, a counter variable using "cnt" in a procedure and using
"cont" in another one).
In addition it is recommended to use prefixes of the variable nomination, which
indicate its subtype. This is very useful when using variables in functions or loops,
which work with a specific subtype.
Examples:
Dim strMyName ' string
Dim dblNumberCalls ' double
Dim intCodScreen ' integer

36 Introducing VBScript
E3 - Scripts - Reference Manual

Recommended prefixes for the Variant subtypes


SUBTYPE PREFIX
bin
4 byt
= - dtm
= ," dbl
! err
. int
. lng
"#$ obj
. sng
. str

Objects
It is recommended to use the following prefixes:

OBJECT PREFIX
E 3 $ ." hsb
8 $ $ ." vsb
0 + ", ani
+ ", cmd
' .", spn
" " % " % cbo
= . % dlg
" % lst
-%" % txt
2$ (" % chk
. img
+ . +$ sld
lin
1 fra
F= pnl
" lbl

Introducing VBScript 37
E3 - Scripts - Reference Manual

Comments
All of procedures should begin with a short comment about what it does.
Nevertheless, this comment should not describe the implementation in details
because oftentimes it spends a lot of time and results in a maintenance work of
unnecessary comments. The code itself or the comments at the end of the lines will
describe how the procedure executes the task it is proposed to.
By the way, a very important recommendation that may cause the opposition of
great majority of programmers is: comment each code line of your program.
Although it is excessively difficult this will save you from having a hard time
mainly when you try to read what yourself have written some time after you had
done the code.
A good tip for those who do not like commenting their code is to use the following
technique: first, write down all of the code; then, comment all of the lines. This will
be very useful when reviewing the code and finding syntactic or semantic errors. In
addition, sometimes it can be useful to include in the beginning of a code a small
pseudo-code describing the algorithm.
For each procedure you should include the following information before its
definition:
• purpose (what the procedure does and not how it does);
• suppositions (which other parts of the program affect such procedure);
• effects (which other parts of the program such procedure affects);
• parameters (explanation of the purpose of each parameter).

Formatting and indentation of the code


Use indentations (i.e., tabulations and alignments) to indicate the hierarchy of the
code blocks. In case of constructions with a well-defined beginning and end - for
loops, for example, use a retrocession in its content, one time for each level of nest.
In addition, the initial comments of the procedures should be indented in one space.
It is also interesting to leave one blank line between the definition and body of the
procedures, and the many parts of the body (declarations, initializations, processes).

7 *+ )"
In this section, you will see a brief description of the VBScript methods most
commonly used in E3. For further information on VBScripts methods, see
documentation available at E3 program group, under the item “Documents”.

38 Introducing VBScript
E3 - Scripts - Reference Manual

Abs(number)
Returns the absolute value of a number. , " parameter can be any valid
numeric expression. The absolute value of a number is its unsigned magnitude. Ex:
Both Abs(-1) and Abs(1) return 1.

Array(arglist)
Returns a Variant containing an array. . parameter is a comma-delimited list of
values that are assigned to the elements of an array contained with the Variant. If no
arguments are specified, an array of zero length is created.
Example:
Sub CommandButton1_Click()
Dim A
A = Array(10,20,30)
B = A(2)
MsgBox "value is "& b
End Sub

LoadPicture(picturename)
Returns a picture object. Available only on 32-bit platforms. '$,
parameter is a string expression that indicates the name of the picture file to be
loaded. Graphics formats recognized by LoadPicture include bitmap (.bmp) files,
icon (.ico) files, run-length encoded (.rle) files, metafile (.wmf) files, enhanced
metafiles (.emf), GIF (.gif) files, and JPEG (.jpg) files.
Examples: See MouseIcon and Picture properties.

MsgBox(prompt [, buttons] [, title][, helpfile, context])


Displays a message in a dialog box, waits for the user to click a button, and returns a
value indicating which button the user clicked. This method’s parameters are:

Introducing VBScript 39
E3 - Scripts - Reference Manual

MsgBox method parameters


NAME DESCRIPTION
' String expression displayed as the message in the dialog box.
The maximum length of prompt is approximately 1024
characters, depending on the width of the characters used. If
prompt consists of more than one line, you can separate the lines
using a carriage return character (Chr(13)), a linefeed character
(Chr(10)), or carriage return–linefeed character combination
(Chr(13) & Chr(10)) between each line.
, Numeric expression that is the sum of values specifying the
number and type of buttons to display, the icon style to use, the
identity of the default button, and the modality of the message
box. See Settings section for values. If omitted, the default value
for buttons is 0.
- String expression displayed in the title bar of the dialog box. If
you omit title, the application name is placed in the title bar.
E '1 String expression that identifies the Help file to use to provide
context-sensitive Help for the dialog box. If helpfile is provided,
context must also be provided. Not available on 16-bit platforms.
% Numeric expression that identifies the Help context number
assigned by the Help author to the appropriate Help topic. If
context is provided, helpfile must also be provided. Not available
on 16-bit platforms.

", parameter settings are:

40 Introducing VBScript
E3 - Scripts - Reference Manual

Available options for buttons parameter


NAME VALUE DESCRIPTION
&" < 4 0 Displays OK button only.
&" < $ 1 Displays OK and Cancel buttons.
&
" <0" 4. 2 Displays Abort, Retry, and Ignore
buttons.
&
"G ; $ 3 Displays Yes, No, and Cancel buttons.
& "G ; 4 Displays Yes and No buttons.
&" 4 $ 5 Displays Retry and Cancel buttons.
&" $ 16 Displays Critical Message icon .
&
"H, 32 Displays Warning Query icon .
&
"!%
$ 48 Displays Warning Message icon .
&
" 64 Displays Information Message icon .
&"= , , 9 0 First button is default.
&"= , , : 256 Second button is default.
&"= , , F 512 Third button is default.
&"= , , I 768 Fourth button is default.
&
"0''$ + 0 Application modal; the user must respond
to the message box before continuing
work in the current application.
&
" 4 + 4096 System modal; all applications are
suspended until the user responds to the
message box.

The first group of values (0–5) describes the number and type of buttons displayed
in the dialog box; the second group (16, 32, 48, 64) describes the icon style; the third
group (0, 256, 512, 768) determines which button is the default; and the fourth group
(0, 4096) determines the modality of the message box. When adding numbers to
create a final value for the argument buttons, use only one number from each group.
MsgBox method has the following return values:

Available options for MessageBox method


NAME VALUE BUTTON
&" ( 1 OK
&" $ 2 Cancel
&"0" 3 Abort.
& " 4 4 Retry
&". 5 Ignore
&"G 6 Yes
&"; 7 No

Introducing VBScript 41
E3 - Scripts - Reference Manual

Example:
Sub CommandButton1_Click()
Dim MyVariable
MyVariable = MsgBox ("Hello!", 65, "Example of Msgbox")
' MyVariable can contain 1 or 2, depending on the clicked
'button.
End Sub

Now
Returns the current date and time according to the setting of your computer'
s system
date and time.

RGB(red, green, blue)


Returns a whole number representing an RGB color value. This method’s
parameters are: +: Number in the range 0-255 representing the red component of
the color; . : Number in the range 0-255 representing the green component of
the color; and " , : Number in the range 0-255 representing the blue component of
the color. All parameters are required.
Example:
Sub Line1_Click()
Effect3DColorBase= RGB (0,150,200)
End Sub

42 Introducing VBScript
" " ! '' !2 )"

Although the majority of VBScript aspects apply to scripts programming with E3,
some particularities should be emphasized regarding the implementation of object
orientation concept in the system.

" !
One of the most important things to consider when you work with scripts inside E3
is the separation between processes executed in the server and those executed in the
client's interface (E3 Viewer). In order to work with scripts, you can manipulate:
• Server objects via server
• Server objects via E3 Viewer(s)
• E3 Viewer objects via the same E3 Viewer
However, you cannot manipulate directly:
• E3 Viewer objects via server (it is only possible by creating events at
E3 Viewer, which are connected to variables in the server)
• E3 Viewer objects via another E3 Viewer (it is only possible by
creating events connected to variables that are in the server)
Such limitations come from the fact that, by definition, there is independence
between what the E3 Viewer station is doing or visualizing and the server, and vice-
versa. So, all activities, both in the server and in E3 Viewer, need to be coordinated
either in an asynchronous way or through events in order to operate harmoniously.
Thus, due to this independence, when creating a script, first you should obtain a
correct reference to the objects you want to manipulate, i.e., it is necessary that the
object be found in several E3 modules first.
Remember that when you edit a script, you can use AppBrowser, which allows the
path of a method or property to be copied to the script completely, then helping you
create scripts.
Therefore, to access external objects being manipulated in a script, some basic
guidelines are used. For example, if you want to manipulate the value of an I/O Tag,
the path is: Server – Driver – Folder (if existing) – Tag. But if your goal is to
manipulate a button in the Screen, the path is:Viewer – Frame (if existing) – Screen
– Button.

Programming in E3 43
E3 - Scripts - Reference Manual

There are basically three scripts source locations according to the methodology for
accessing objects:
• Server (E3 Server)
• Screens and Frames (E3 Viewer)
• ElipseX (libraries): they can be XObjects (running in the server) and
XControls (running in E3 Viewer).

" !
To access an object running in the server from a Screen Object or an ElipseX, use
the directive Application.GetObject.
The word Application stands for the application as whole, and the method
GetObject()searches for an object with the given name within Application, in the
server. Example:
Sub Button1_Click()
Application.GetObject("Driver1")._
Item("tag001").AllowRead = False
End Sub
or
Sub Button1_Click()
Application.GetObject("Driver1.tag001").AllowRead = False
End Sub
Item() method has been used to locate “tag001” from the reference of “Driver1”,
because the Driver is a Tag collection. After the object has been located, its
properties and functions can be freely accessed.
In case you need to accomplish another operation with “Driver1” or “tag001”,
another alternative for this script is:
Sub Rectangle1_Click()
Set obj = Application.GetObject("Driver1")
obj.Item("tag001").AllowRead = False
obj.Item("tag002").AllowRead = False
End Sub
In this case, the variable “obj” is pointing to the object “Driver1”, and the next time
you want to access some object descending from “Driver1” inside the script, you can
use the variable “obj” directly. This brings performance enhancement, since each
call from GetObject() method accesses the server once. With this technique, you
avoid unnecessary calls to the server. This example uses the command Set,
explained later. Notice that the use of variables also makes the code clearer and
more easily modifiable. In case it is necessary to change the object where you want
to execute commands, just change the attribution line of this variable.
The word Application in scripts can indicate either functions executed at E3 Viewer
or in the Server. In this case, the Application object senses beforehand which
44 Programming in E3
E3 - Scripts - Reference Manual

functions should be executed in each case. Nevertheless, you cannot execute E3


Viewer functions inside the server, and it is not possible to execute server functions
inside the E3 Viewer.

" ! '
Take the example of accessing the tag properties from another one. In this case,
origin and destination are in the server, even though connected via a Driver1
“parent” module.
In this case, the Parent declaration should be used. This allows the “parent” of the
object where the script is, to be firstly accessed; and then, we descend in the
hierarchy to look for another element. For example:
Sub Tag1_OnRead()
Parent.Item("tag002").AllowRead = False
End Sub

Picture 12: The picture above shows it is necessary to use Parent declaration

If we are inside a group and we want to access the same tag002, we can nest various
Parent commands.
For example:
Sub Tag1_OnRead()
Parent.Parent.Item("tag002").AllowRead = False
End Sub

Programming with E3 45
E3 - Scripts - Reference Manual

Picture 13: The picture above shows it is necessary to use Parent declaration

" " ! '

In this case, we should only use the Item() method, as the objects are “children” of
the Screen.
For example:
Sub Tela1_OnPreShow(vArg)
Item("Retangulo1").Enabled = True
End Sub

Picture 14: The picture above shows it is necessary to use Parent declaration

46 Programming in E3
E3 - Scripts - Reference Manual

" $ ! '

In this case, we should use the Parent() method.


For example:
Sub Retangulo1_Click()
Parent.Item("Retangulo2").Enabled = True
End Sub

Picture 15: The picture above shows it is necessary to use Parent declaration

" . - ! '

This is not possible via scripts, for each data client is a different Screen copy. The
modification of any behavior in the Screen can be done only due to a concept
question, from associations (the server automatically reports all changes in variables
chosen for E3 Viewers), or via explicit information search in the server. The whole
graphic interface association operation is accomplished from client to server and not
from server to client.
Let's see a practical example: either to change the color of a text in the Screen into
green when a tag is “turned on” (value 1) or into red when it is “turned off”
(value 0).
How to do it: simply create a digital association between Text1’s TextColor property
and Tag1. This way, you do not need to create a script, which is preferable, due to
the execution speed and maintenance and construction simplicity.

Programming with E3 47
E3 - Scripts - Reference Manual

Picture 16: Associating the text color to the value of Tag1.

People experienced in other supervisors might want to create scripts in order to solve
this problem. For example: create an event through a script when the Value property
changes the value, during tag change, and then obtain a reference for the Screen
object, finally changing the TextColor property. Nevertheless, there is no means of
calling the Screen from the server. Therefore, it is not adequate. Another way would
be to create a script in the E3 Viewer, which is constantly verifying if the value of
Tag1 has changed or not, then change the text color. This type of script is possible to
be accomplished, but it would be extremely perverse, because it would strongly
affect the application performance. Thus, this practice is not recommended.

" / ! ) 8 ' ) 8
When creating an ElipseX, we can assign properties (XProperties) and insert objects,
which can be Screen objects (XControl) as well as server objects (XObject). In order
to access XProperties via scripts, just access directly the property name.

48 Programming in E3
E3 - Scripts - Reference Manual

Picture 17: Accessing ElipseX objects from an ElipseX itself

For example, in the picture above there is an XControl1 with Property1 property,
and the objects Text1 and Rectangle1. This property is Boolean, and can be accessed
like this:
Sub XControl1_OnStartRunning()
XControl1.Property1 = True
End Sub
or even:
Sub XControl1_OnStartRunning()
Property1 = True
End Sub
If ElipseX has any internal objects, it is possible to use Item() method to get
references from these objects. For example:
Sub XControl1_OnStartRunning()
Item("Text1").Value = "motor"
Item("Rectangle1").BackgroundColor = RGB (212,208,20)
End Sub

" 0 ! ' ) 8 -
An ElipseX object can only be accessed externally via its properties, by using the
created instances. It is not possible to access internal objects directly.

Programming with E3 49
E3 - Scripts - Reference Manual

If the ElipseX is an XControl, it will behave as a Screen object. For example, in this
application:

Picture 18: XControl (example)

To alter XControl’s Property1 property, you can write the following script in the
button:
Sub CommandButton1_Click()
Screen.Item("XControl11").Property1 = True
End Sub
Or, alternatively
Sub CommandButton1_Click()
Parent.Item("XControl11").Property1 = True
End Sub
In case of an XObject, insert it into a Data Server.

Picture 19: XObject (example)

A possible script to alter XObject’s Value property is:


Sub CommandButton1_Click()
Application.GetObject("Data.XObject11").Value=123
End Sub
50 Programming in E3
E3 - Scripts - Reference Manual

Or, alternatively:
Sub CommandButton1_Click()
Application.GetObject("Data").Item("XObject11").Value=123
End Sub
You can also have an XControl accessing an XObject through an XProperty. For
example, the picture below shows an XControl called “XControl1” with an XValue
property. This property’s type is XObject1, which is also the name of the XObject
created.

Picture 20: XControl accessing an XObject (example)

For example, you can link the value of the object “Text1” with Value property of
“XObject1”. This is done via XValue property, created at “XControl1”. Thus, the
value of Value property of “XObject1” will be shown in the object “Text1” of
“XControl1”.

Picture 21: Value property

Programming with E3 51
E3 - Scripts - Reference Manual

In the project, the instance “XObject11” can be entailed to the instance


“XControl11” via a link at XValue property.

Picture 22: XValue (link)

Creating an ElipseX (Example)


Suppose a given application needs to supervise and command 10 engines. Each
engine must be represented by a drawing on Screen, displayed in green when
operating, and in red when off. It must also be displayed the engine command on
Screen, sending instructions for turning it on and off. Its speed must also be
displayed.
One possibility is the creation of an XControl called EngineA, whose properties are
set State = Boolean and Speed = Double, as seen below:

Picture 23: XControls definition

52 Programming in E3
E3 - Scripts - Reference Manual

To indicate color, engine’s OverrideFillColor property must be digitally


linked to XControl’s State property. Set OverrideFillMode property to :>
+1
To display speed, Display’s Value property must be linked to XControl’s
Speed property.
The Toggle Button switches State property value via a simple link.

Notice that:
• The links within the library are internal, and its format is
Control_Name.Property_Name.
• The object, after being inserted into Screen, must have these properties
liked to real tags, for each engine.
• Each EngineA will have a tag linked to State property.

Picture 24: Viewer

Another broader possibility is to use an XObject for the engine. Thus, all
information regarding engines remains in objects in the server. Hence, it is possible
to create several types of interface for the engine (XControls), which bring only
relevant information from the server, via XObject.
Then, the object EngineA would have to be modified to “point” to an XObject,
instead of declaring all properties on itself.

Create an XObject called EngineAData, and declare State and Speed


properties in it.

Programming with E3 53
E3 - Scripts - Reference Manual

Create an XControl (EngineA) with just one property, called MyData,


EngineAData type.
EngineAData must be inserted into a data folder in the server,
corresponding to each engine. EngineA, by its turn, will “point” to the
EngineAData needed, making it unnecessary to create new tags.

Picture 25: Configuration on XObject’s view

State property, linked to engine’s OverrideFillCollor property, is then


EngineA.MyData.State.
Speed property, linked to Display, is then EngineA.MyData.Speed.

" !
Following the object oriented programming encapsulation concept, the methods and
properties become associated to their original objects. This means that we always
have to indicate the object, method or property we are accessing.

54 Programming in E3
E3 - Scripts - Reference Manual

Properties
In order to refer the object properties, we should use the GetObject() method of E3.
The syntax is the following:
Application.GetObject("<object>").<property>
where <object> is the name of the object, and <property> is the property desired.
Example:
Application.GetObject("Dados.TempTanque2").Type
In order to ease typing, it is always advisable to use AppBrowser, which already
brings the correct syntax, avoiding mistakes.

Value Property
In E3, many objects have a standard property called Value. In this specific case, you
can access this property by using the very name of the object:
Button1 = False
That is equivalent to:
Button1.Value = False
Some objects are formed by other objects, and one can access the other through a
property, as follows:
Application.GetObject("Dados.Temeperatures.Tanque2").Type
In this example, Tanque2 is part of another object called Temperatures.

Methods
The syntax below exemplifies the call of a method that doesn'
t need parameters:
Application.GetObject("<object>").<method>
where <object> is the specific object, and <method> is the method desired.
If the method accepts parameters, use the syntax below:
Application.GetObject("<object>").<method>(<parameter>)
where <parameter> is the parameter needed to be passed to the method. When there
is more than a parameter, use commas to separate them.
If the method returns to a result that you want to keep, then the parameters should be
placed between parentheses:
<V> =Application.GetObject("<object>").<method>(<parameter>)
where <V> is the variable that will receive the method'
s result.

"" 3 # !2
As previously seen, a collection is an object that manages a set of similar objects.
The objects contained in a collection are referred to by indexes, similarly to arrays
reference.

Programming with E3 55
E3 - Scripts - Reference Manual

You can add or remove individual objects from a collection, as we see in the
example below:
'Add a pen to an E3Chart object
E3Chart.Pens.Add "Pen"
'Removes the second pen
E3Chart.Pens.Remove 2
Note: the first object in a collection has index 1.
All collections have a standard property called Count, which is the number of
existing objects (or children). Example:
'Shows a dialog box with the number of pens
MsgBox E3Chart.Pens.Count

"" ! 2 ' '


Every collection has an Item() method, which can be used in order to access any
object within the collection. The Item() method accepts an Item parameter, which
can be a number (positive integer) or the name of the object we want to access
within the collection.
In the above examples, we have adjusted the E3Chart object second pen color:
E3Chart.Pens.Item(2).Color = RGB (212,208,20)
E3Chart.Pens.Item("Pen2").Color = RGB (212,208,20)
Commands above are equivalent, the first one indicating the pen index within the
collection, and the second, indicating the name.

"$ ''
VBScript implements the concept of object oriented language polymorphism,
allowing a Variant type variable to assume the form of any object through the Set
command. In this way, the variable will work as a “pointer” of the object wanted,
allowing the access to its methods and properties.
Example:
Set E3Chart = Screen.Item("E3Chart1")
E3Chart.Pens.Item(2).Color = RGB (212,208,20)
In the above example, the same task of the previous example has been
accomplished, but the part related to getting the specific object has been forgotten.
Without the Set command, the same call should be:
Screen.Item("E3Chart1").Pens.Item(2).Color = RGB(212,208,20)
Apparently, there is no advantage in this case, for we are able to do everything with
a single code line. But, if we want to do other operations in the same script right
below, it would be simpler and faster if we avoided placing the call for the Item
method in all lines.

56 Programming in E3
E3 - Scripts - Reference Manual

'
Bad example:
Screen.Item("E3Chart1").Pens.Item(1).Color = RGB(212,208,20)
Screen.Item("E3Chart1").Pens.Item(2).Color = RGB(200,208,20)
Screen.Item("E3Chart1").Pens.Item(3).Color = RGB(100,208,20)
Better example:
Set Pens = Screen.Item("E3Chart1").Pens
Pens.Item(1).Color = RGB (212,208,20)
Pens.Item(2).Color = RGB (200,208,20)
Pens.Item(3).Color = RGB (100,208,20)

Programming with E3 57
$ $ )

The Events are occurrences related to an object, which allow triggering scheduled
actions. Basically, there are two types of events: physical (or external) and internal.
Physical events are, e.g., user actions. In case the user types something on the
keyboard, the relevant information can be the pressed key or, if the user points and
clicks the mouse, the relevant information can be the arrow position and buttons
status. Internal events are, e.g., changes of value on a variable (tag) in the system.
Since the tag can be associated to an external device, it is possible to say that
internal events can have physical associations, such as temperature changes in a
chamber, for example.
In this chapter we have a list of E3’s available events classified by object, beginning
with the standard events, present in all objects. Each entry describes the name of the
event and its occurrence, and exemplifies its use through scripts, including the event
variables.

$ ) *
Event Variables are created when the event is started. To be used, they should be
associated to parameters in the script call of the event.
The following example is the call from a procedure associated to the event Key
Down from "#$.
Sub SomeObject_KeyDown(KeyCode, Shift)
Notice that in the call we have two variables: < 4 + and 2 . E3 will
automatically assign values to these variables at the moment of the occurrence of the
event. In this case, < 4 + will receive the code of the pressed key and [Shift] will
be true or false, according to the key [ 2 ] being pressed or not.

Eventos 59
E3 - Scripts - Reference Manual

$ '' )

OnStartRunning( )
Occurs as soon as an object is started.
Example:
Sub Months_OnStartRunning()
' Months is a tag of InternalTag type
' Here it uses the event OnStartRunning in order to
' start the vector up
Value = Array ("January", "February", "March", "April",_
"May", "June", "July", "August", "September", "October",_
"November", "December")
End Sub

NOTE: To access this array, it is necessary to copy the property Value to a local
variable.

OnStopRunning( )
Occurs when the execution of an instance of this object finishes. Use the event
OnStopRunning to make termination operations for the object.
Example:
Sub Tag_OnStopRunning()
' When the tag object finishes
' it assigns False to tag2
set tag2 = Application.GetObject("DataServer1.tag2")
tag2.Value = False
End Sub

60 Events
E3 - Scripts - Reference Manual

$" 9 , )

AfterStart( )
Occurs after the communication driver has started the communication. It is common
to make a script for this event using Write() method to perform equipment set up.
Example:
Sub Driver1_AfterStart()
' After started, communication sends/write values
' to the equipment/device
Write 0, 2, 55, 2, 33.4
Write 0, 3, 55, 20, "Metal"
End Sub

AfterStop( )
Occurs after the driver has finished communication. Use the event AfterStop to
perform any necessary actions after driver communication has finished.

BeforeStart( )
Occurs when the driver is about to start communication. Use the event BeforeStart
to perform any necessary actions before starting communication, such as the setup of
driver parameters.
Example:
Sub Driver1_BeforeStart()
' It performs the startup of driver parameters before
' starting the communication
P1 = 0
P2 = 20
P3 = 80
P4 = 0
End Sub

BeforeStop( )
Occurs when the driver is about to finish communication. Use the event BeforeStop
to perform any necessary actions before finishing communication, such as writing or
reading values of the equipment/device, before communication is no longer
available.

OnCommError(EvtType, Size, Element, N1, N2, N3, N4)


Occurs when the communication driver detects some writing or reading error. Use
the event OnCommError to check when writing and/or reading failure occurred in
Events 61
E3 - Scripts - Reference Manual

the driver. Event variables receive information about this error. With these values, it
is possible to track back which tags have communication problems.

OnCommError event variables


NAME DESCRIPTION
!&-4
' Informs which type of operation the driver was performing when
the error occurred, according to the options below:
Single element reading error (Size = 1). Param1 is N1, Param2 is
N2, Param3 is N3 and Param4 is N4.
Single element writing error ( Size = 1). Param1 is N1, Param2
is N2, Param3 is N3 and Param4 is N4.
(Communication) Block reading error (Size: determined by the
number of elements in the block). Param1 is N1, Param2 is N2,
Param3 is N3 and Param4 is N4.
(Communication) Block writing error (Size: determined by the
number of elements in the block). Param1 is N1, Param2 is N2,
Param3 is N3 and Param4 is N4.
3 Number of values being written or read.
! Element rate within the block that being written or read.
;9 Parameter 1 from the reading/writing operation that generated the
error.
;: Parameter 2 from the reading/writing operation that generated the
error.
;F Parameter 3 from the reading/writing operation that generated the
error.
;I Parameter 4 from the reading/writing operation that generated the
error.

62 Events
E3 - Scripts - Reference Manual

Example:
Sub Driver1_OnCommError(Type,Size,Element,N1,N2,N3,N4)
Application.GetObject("Dados.TagInterno1").Value=_
Application.GetObject("Dados.TagInterno1").Value+1
Application.GetObject("Data.EvtType").Value=EvtType
Application.GetObject("Data.Size").Value=Size
Application.GetObject("Data.Element").Value=Element
Application.GetObject("Data.N1").Value=N1
Application.GetObject("Data.N2").Value=N2
Application.GetObject("Data.N3").Value=N3
Application.GetObject("Data.N4").Value=N4
End Sub

OnCommErrorEx(ErrorInfo)
Occurs soon after the execution of OnCommError() method.

ErrorInfo parameter information


NAME DESCRIPTION
! Informs the type of operation that caused the error: 0 =
!&-4
'
tag read; 1 = tag write; 2 = block read; 3 = block write.
! 3 Size of the block that caused the error (if it is a tag, Size
is 1).
! ! Index of the block element that caused the error.
! ;% Nx or Bx (x = 1, 2, 3, 4) parameters of the operation that
caused the error.
! = &$ ParamDevice (string) parameter of the operation that
caused the error.
! ParamItem (string) parameter of the operation that
caused the error.

OnTagRead(Tag)
This event only occurs when a tag is read and at least, one of these conditions is
True: the tag value or the tag quantity change, or the property EnableDeadBand of
the tag is True. The parameter - .contains the event generator tag. This event can
be generated by the I/O tag, the Block tag or the I/O Block Element. It will be
generated every time a new value or a reading error comes from I/O Driver (on the
I/O Server).
Example:
Sub Tags_OnTagRead(Tag)
Set Obj = Application.GetObject("Data1.TagName")
Obj.Value = Tag.Name
Events 63
E3 - Scripts - Reference Manual

Set Obj = Application.GetObject("Data1.TagRead")


Obj.Value = True
Set Obj = Application.GetObject("Data1.TagType")
Obj.Value = TypeName(Tag)
End Sub

OnTagWrite(Tag, Succeeded, User)


Occurs when a write operation is fired in any tag in the driver.

OnTagWrite event variables


NAME DESCRIPTION
- . A reference to the Tag being written. The DocString can be read
using the syntax “Tag.DocString”, for example
$ + + A Boolean value set to True if the value was written successfully, or
,$
False if there was an error
6 A string value with the user'
s name..

$" 9 !)

OnRead( )
Occurs when a tag reading is performed by the driver. Use the event OnRead when
it is necessary to perform some operation soon after some data has been modified in
the tag, such as the properties Value, Quality or TimeStamp. This event is generated
by a background reading.
Example:
Sub CommTag1_OnRead()
' When reading the tag, assign its value
' to the InternalTag1 tag.
Set obj=Application.GetObject("DataServer1.InternalTag1")
obj = Value 'CommTag1 Value
End Sub

$" 9 + #)

OnRead( )
Occurs when the driver performs a communication block reading. Use the event
OnRead when it is necessary to perform some operation soon after some data has
been modified in the communication block object, such as the properties Quality,
TimeStamp or even Value of some of the block’s element.
Example:
64 Events
E3 - Scripts - Reference Manual

Sub IOBlock1_OnRead()
' When reading a block, assign to the InternalTag1 tag
' the value of the block element elm1.
Set obj=Application.GetObject("DataServer1.InternalTag1")
Set elm = Application.GetObject("Driver1.IOBlock1.elm1")
obj.Value = elm.Value
End Sub

$$ )

KeyDown(KeyCode, Shift)
Occurs whenever a key is pressed, regardless of Screen focus.

KeyDown event variables


NAME DESCRIPTION
<4 + Integer identifying the ASCII character of the pressed key.
2 Displays [ ] and [ 2 ] keys status:
4 – [ 2 ] key
8–[ ] key
12 – [ ]+[ 2 ] keys

Example:
Sub Screen1_KeyDown(KeyCode, Shift)
' It shows a message box whenever
' the user presses a key
MsgBox "Key code: " & KeyCode
End Sub

KeyUp(KeyCode, Shift)
Occurs whenever a key is released, regardless of Screen focus.

KeyUp event variables


NAME DESCRIPTION
<4 + Integer identifying the ASCII character of the pressed key.
2 Displays [Control] and [Shift] keys status:
4 – 2 key
8– key
12 – + 2 keys

Example:
Sub Screen1_KeyUp(KeyCode, Shift)
Events 65
E3 - Scripts - Reference Manual

' It shows a message box whenever the user


' releases a key
MsgBox "Screen code: " & KeyCode
End Sub

MouseDown(Button, ShiftState, MouseX, MouseY)


Occurs when any button is pressed on the Screen. Use this event to determine
specific actions for when the user clicks the Screen.

MouseDown event variables


NAME DESCRIPTION
, Shows the mouse button that was pressed:
1 - Mouse button pressed was the left one.
2 - Mouse button pressed was the right one.
2 Shows the key pressed together with the mouse button:
4 – [ 2 Key
8– Key
12 – + 2 Keys
, D Shows the position X on the Screen where the mouse was clicked.
, G Shows the position Y on the Screen where the mouse was clicked.

Example:
Sub InitialScreen_MouseDown(Button, ShiftState, MouseX,
MouseY)
' Closes the application when the mouse is clicked
' on the object InitialScreen.
Application.Exit()
End Sub

MouseUp(Button, ShiftState, MouseX, MouseY)


Occurs when any button previously clicked is released. Use this event to specify the
actions to be triggered only when the mouse button is released.

MouseUp event variables


NAME DESCRIPTION
, Shows the mouse button that was pressed:
1 - Mouse button pressed was the left one.
2 - Mouse button pressed was the right one.
2 Shows the key pressed together with the mouse button:
4 – [Shift] Key
8– Key
12 – + 2 Keys
, D Shows the position X on the Screen where the mouse was

66 Events
E3 - Scripts - Reference Manual

clicked.
, G Shows the position Y on the Screen where the mouse was
clicked.

Example:
Sub InitialScreen_MouseUp(Button, ShiftState, MouseX, MouseY)
' Closes the application only when the user
' releases the button.
Application.Exit()
End Sub

OnHide( )
Occurs when a Screen is about to be closed. Use the event OnHide when it is
necessary to carry out some operation before the object Screen is closed. This event
can happen in different ways:
• When the Screen can be replaced by another through the method
OpenScreen();
• When the user clicked on the closing window icon where the Screen is;
• When the method Close() was called from Screen;
• When the viewer was closed/finished.
Example:
Sub InitialScreen_OnHide()
Application.exit
End Sub

OnPreShow(Arg)
Occurs before the Screen is shown. The variable from the event 0.receives the
content of the parameter 0.of the method OpenScreen(), which generates this
event. Soon after, the event OnShow is generated. Example:
Sub Screen1_OnPreShow(Arg)
' Screen1 window title to be shown
' was passed as a parameter at the OpenScreen method call
' that generated the event.
Caption = vArg
End Sub

OnShow( )
Occurs at the exact moment a Screen is shown. Use the event OnPreShow to carry
out any operation before it is displayed. Example:
Sub MainScreen_OnShow()
MsgBox "Welcome to the system!"
Events 67
E3 - Scripts - Reference Manual

End Sub

$. )

Click( )
Occurs when the left button clicks the object. This event will not occur if the object
is not visible or the property Enabled is set to False. The object’s visibility depends
on three factors: property Visible set to True; parent object visible; and object’s
Layer property on the Screen layer.
Example:
Sub Button_Click()
' It shows a message box when
' the user clicks the object
MsgBox "You have clicked the object."
End Sub

DbClick( )
Occurs when the left button double-clicks the object. This event will not occur if the
object is not visible or the property Enabled is set to False. The object’s visibility
depends on three factors: property Visible set to True; parent object visible; and
object’s Layer property on the Screen layer.
Example:
Sub Button_DbClick()
' It shows a message box when
'the user double click the object
MsgBox "You have double clicked the object."
End Sub

KeyDown(KeyCode, Shift)
Occurs when a key is pressed and the object has the keyboard focus. Notice that this
event will not be generated if the object is not enabled (Enabled = False) or if this
object does not have the keyboard focus.

KeyDown event variables


NAME DESCRIPTION
<4 + Integer identifying the ASCII character of the pressed key.
2 Shows the key pressed together with the mouse button:
4= 2 Key; 8= Key; 12= + 2 Keys

68 Events
E3 - Scripts - Reference Manual

Example:
Sub Button_KeyDown(KeyCode, Shift)
' It shows a message box when
' the user press a key
MsgBox "Screen code: " & KeyCode
End Sub

KeyUp(KeyCode, Shift)
Occurs when a key is released and the object has the keyboard focus. Notice that this
event will not be generated if the object is not enabled (Enabled = False) or if this
object does not have the keyboard focus.

KeyUp event variables


NAME DESCRIPTION
<4 + Integer identifying the ASCII character of the pressed key.
2 Shows the key pressed together with the mouse button:
4= 2 Key; 8= Key; 12= + 2 Keys

Example:
Sub Button_KeyUp(KeyCode, Shift)
' It shows message box when the user
' releases a key
MsgBox "Screen code: " & KeyCode
End Sub

MouseDown(Button, ShiftState, MouseX, MouseY)


It occurs when any mouse button is pressed on the object.

MouseDown event variables


NAME DESCRIPTION
, Shows the mouse button that was pressed:
1 - Mouse button pressed was the left one.
2 - Mouse button pressed was the right one.
2 Shows the key pressed together with the mouse button:
4 – 2 Key
8– Key
12 – ] + 2 Keys
, D Shows the position X on the Screen where the mouse was
clicked.
, G Shows the position Y on the Screen where the mouse was
clicked.

Events 69
E3 - Scripts - Reference Manual

Example:
Sub InitialScreen_MouseDown(Button, ShiftState, MouseX,
MouseY)
' Closes the application when the mouse is clicked
' in the object InitialScreen.
Application.Exit
End Sub

MouseUp(Button, ShiftState, MouseX, MouseY)


Occurs when any mouse button previously clicked the object is released. Use this
event to specify the actions to be triggered only when the mouse button is released.

MouseUp event variables


NAME DESCRIPTION
, Shows the mouse button that was pressed:
1 - Mouse button pressed was the left one.
2 - Mouse button pressed was the right one.
2 Shows the key pressed together with the mouse button:
4 – 2 Key
8– Key
12 – [ + 2 Keys
, D Shows the position X on the Screen where the mouse was
clicked.
, G Shows the position Y on the Screen where the mouse was
clicked.

Example:
Sub Rectangle1_MouseUp(Button, ShiftState, MouseX, MouseY)
' Closes the application only when the user releases the
' button after clicking the Rectangle1 object.
Application.Exit
End Sub

$. :, - )

Validate (Cancel, NewValue)


Occurs after the test for SetPoint limits (see Min, Max, and EnableLimits properties)
and before SetPoint value is sent to tag. This event allows the user to validate
SetPoint value.
If $ is True, the attribution operation must be cancelled. Otherwise, the value
will be sent to the tag. ; 8 , is the value to be validated. The old value can be
accessed through the property Value of the SetPoint.
70 Events
E3 - Scripts - Reference Manual

Example:
Sub Text1_Validate(Cancel, NewValue)
' Ask user if the new value is acceptable
message = "Current value: " & value & vbnewline & _
"New value: " & NewValue & vbnewline & vbnewline &_
"Accept the new value?"
If MsgBox (message , vbQuestion + vbYesNo,_
"Validate event") = vbNo Then
Cancel = True
End If
End Sub

$/ 8

BeforeDragOver (Index, Cancel , Data, X, Y, DragState, Effect, Shift)


It occurs when there is a drag-and-drop action on the object. Use this event in order
to monitor if the mouse entered, left or stood over a target-object. The event is
triggered when user moves the mouse or presses/releases some button. Mouse
pointer position will indicate which object will generate the event. You can specify
the mouse pointer status by verifying = . variable.
Many controls (objects) do not support drag-and-drop operations while $
variable is False, which is the default. This means that the control rejects any
attempt of dragging-and-dropping something on itself and therefore, it does not
trigger BeforeDropOrPaste event. The TextBox and the ComboBox are exemptions;
they accept drag-and-drop operations even when $ is False.

Events 71
E3 - Scripts - Reference Manual

BeforeDragOver event variables


NAME DESCRIPTION
+ % Indicate, in a multi-pages object, the index of the page which will be affected
by the operation that generated the event. Not used for other objects.
$ Event status. By default it is False and indicates that the target-object that will
be addressing the event and not the main application.
= Data that are being dragged to the target-object.
DJG Mouse position in points within the target-object. X is measured from the left
side of the object; Y is measured from the top.
= . Indicates mouse condition when the event is generated:
0 = fmDragStateEnter: Mouse is within the object range;
1 = fmDragStateLeave: Mouse is out of the object range;
2 = fmDragStateOver: Mouse is at a new position, but it still being within the
object range.
! $ Indicates the actions the target-object does not support, that is, the drag
“effect” on the mentioned object :
0= fmDropEffectNone: target-object does not accept receiving a copy or move
command from any origin.
1= fmDropEffectCopy: target-object allows copying from some origin to itself.
2= fmDropEffectMove: target-object allows moving from some origin to itself.
3= fmDropEffectCopyOrMove: target-object allows copying or moving from
some origin to itself.
2 Integer whose sum of factors indicates 2 , ] and 0 keys'status: 1=
2 key pressed; 2= key pressed; 4= 0 key pressed. For example:
a value equal to 5 indicates that 2 and 0 keys were pressed (1 + 4 = 5).

BeforeDropOrPaste(Index, Cancel, Ctrl, Action, Data, X, Y, Effect, Shift)


This event is triggered at the moment immediately previous to a drag-and-drop
operation. Usually, this occurs thereupon BeforeDragOver event occurrence.

72 Events
E3 - Scripts - Reference Manual

BeforeDropOrPaste event variables


NAME DESCRIPTION
+ % Indicate, in a multi-pages object, the index of the page which will be
affected by the operation that generated the event. Not used for other
objects.
$ Event status. By default it is False and indicates that the target-object that
will be addressing the event and not the main application.
$ Target-object.
= Data that are being dragged to the target-object itself.
0$ Indicates the result, based on the keyboard configurations, of a pending
drag-and drop operation:
2 = fmActionPaste: paste the object selected in the target-object;
3 = fmActionDragDrop: indicates the user drags the object selected from its
origin and dropped on the target-object.
DJG Mouse position in points within the target-object. X is measured from the
left side of the object; Y is measured from the top.
! $ Indicates the actions the target-object does not support, that is, the drag
“effect” on the mentioned object:
0 = fmDropEffectNone: target-object does not accept receiving a copying or
moving command from any origin to itself.
1 = fmDropEffectCopy: target-object allows copying from some origin to
itself.
2 = fmDropEffectMove: target-object allows moving from some origin to
itself.
3 = fmDropEffectCopyOrMove: target-object allows copying or moving
from some origin to itself.

2 Integer whose sum of factors indicates [ 2 ], and 0 keys'status:


1 = 2 key pressed; 2 = key pressed; 4 = [0 ] key pressed; For
example: a value equal to 5 indicates that 2 and 0 keys were
pressed (1 + 4 = 5).

Change( )
It occurs when the value of the property Value of the object is modified. Here are
some examples of actions, which trigger Change event:
• Clicking a check box, an option button or an increase-decrease button.
• Clicking or selecting words in a selection list or text editor.
• Selecting different tabs in a dialog.
• Moving the scrolling bar in a scrolling bar object.
• Clicking the arrows of an increase-decrease button.
• Selecting different pages in a multi-pages object.

Events 73
E3 - Scripts - Reference Manual

Error(Number, Description, SCode, Source, HelpFile, HelpContext,


CancelDisplay)
This event is generated by an internal error in the object. If this event is not treated,
E3 will show a generic error message.

OnError event variables


NAME DESCRIPTION
;, " Integer identifying the error.
= $' String with the error description.
+ Integer carrying the OLE subsystem (not used) error code.
,$ String with the object that originated the error.
E '1 String with the help file name and path.
E ' % Help topic context number (integer) referring to the error.
$= ' 4 Boolean; indicates if the error should be showed in a
MessageBox.

KeyPress(KeyAscii)
This event occurs when the object has the keyboard focus and user presses a key
corresponding to a character that can be showed on Screen (an ANSI key, of a code
indicated in the < 4 0 $ variable). That is, the event occurs when some of the
following keys are pressed:
• any keyboard character that can be printed;
• [ ] key combined with any standard alphabet character;
• [ ] key combined with any special character;
• [ $ ('$];
• [!$ ].
This event does not occur in the following conditions:
• by pressing [- "];
• by pressing [! ];
• by pressing [= ] (this is not an ANSI key);
• by pressing keyboard arrow keys
• when a key change the focus from an object to another.
While a user presses a key that produces an ANSI code, the object repeatedly
receives the KeyDown and the KeyPress events. When the user releases the key, the
KeyUp event occurs.
In order to monitor keyboard physical status or handle keys which are not recognizes
by the KeyPress event (such as function keys, browsing keys, etc.), use the
KeyDown and KeyUp events.

74 Events
E3 - Scripts - Reference Manual

$/ ' + + )

DropButtonClick()
Occurs whenever the drop-down list appears or disappears.

$/ '' + !! + )

MouseMove()
Occurs when the mouse pointer is moved over the control.

$/" + )

Scroll( )
Scroll event is generated when scrolling bar pointer is moved to any direction.

$/$ + )

SpinUp( )
It occurs whenever the user presses up arrow key. This event increases the object
Value property.

SpinDown( )
It occurs whenever the user presses down arrow key. This event decreases the object
Value property .

Events 75
E3 - Scripts - Reference Manual

$0 * 2 )

OnInactive( )
This event occurs when the Viewer is inactive, and the property EnableInactivity is
True. It starts when it is verified the user has not been using Viewer for a period of
time equal or superior to the InactivityTime property value.
In a script for this event, the user can schedule what he wants to do when the Viewer
is inactive for a specific period. For example, it is possible to specify that after 20
minutes without using the Viewer, the logout will be performed.
Example:
Sub Viewer_OnInactive()
Application.GetObject("Data.TagDemo1").Enabled = FALSE
MsgBox "Testing the OnInactive script call"
Application.GetObject("Data.TagInterno1").Value = 334
End Sub

$0 % )

IMPORTANT: The following events are accessed through the object Viewer.

OnLogin( )
Occurs when the user successfully performs a system login (user authentication).
The system login can be performed through the execution of the method Login(), or
when an object that can only be accessed by users with a specific authorization level
requires authentication.
Example:
Sub Viewer_OnLogin()
MsgBox "Authorized user. Welcome to the system!"
End Sub

OnLogout( )
It occurs when a “logout” is performed, that is, the user exits from the system.
Logout is performed by calling the Logout() method.
Example:
Sub Viewer_OnLogout()
MsgBox "User came out the system."
End Sub

76 Events
E3 - Scripts - Reference Manual

$ 6 )"; -)

OnAsyncQueryFinish(Recordset, Error)
Occurs when GetAsyncADORecordset() method return. $ + parameter is the
ADO recordset generated by the query, and ! parameter is a Boolean that, when
True, says the object could not be generated.
Example:
Sub query1_OnAsyncQueryFinish(Recordset, Error)
MsgBox "Returned " + CStr(Recordset.RecordCount) +
"registry"
End Sub

$ 7 )"+ 2 )
OnDrawRow (bSelected, nLine, cTextColor, cBackColor)
This method passes four parameters. " $ + indicates whether the row is
selected; indicates the number of the row being drawn; $ -% indicates
the row’s text color; and $ $ ( indicates the text’s background color. If the
color is modified within this event, this change will be used by E3Browser when
drawing the row. Another important new feature is that if GetColumnValue()
method is called within the event, returned values are the drawn row’s ones, and not
the selected row’s.

Events 77
E3 - Scripts - Reference Manual

$ < )" )

OnChangeCursor( )
This event occurs whenever E3Chart cursor changes position. For example, you can
create a script for this event when you need to show cursor position values on
Screen:
Sub E3Chart1_OnCursorChange()
Set Chart = _
Application.GetFrame("").Screen.Item("E3Chart1")
Set Pen = Chart.Pens.Item(0)
' Text1 object shall show current cursor position
Set Text = Application.GetFrame("").Screen.Item("Text1")
If Pen.GetCursorPos(aa,bb) Then
Text.Value= "Position X=" & aa & "; position Y=" & bb
End If
End Sub

OnLegendClick(Row, col, RowData)


Occurs whenever the user clicks in one the legend’s row. and parameters
indicate, respectively, the clicked row and the clicked column. = parameter
is the legend’s pen index where the click has occurred.
Example:
Sub E3Chart1_OnLegendClick(Row, col, RowData)
Set text = Screen.Item("Text1")
text.Value = Legend.Item(col).Name & " " &_
Pens.Item(RowData).name
End Sub

$ 8 8 )

Constructor( )
This event is triggered when an ElipseX object is initialized. It is possible to use this
event in order to run a script that set up the internal values of an ElipseX, for
example.

OnPropertyChanged( )
It occurs when a property of an ElipseX is modified. Use this event in order to
trigger scripts that perform actions according to an ElipseX specific status.

78 Events
E3 - Scripts - Reference Manual

$ )

OnAfterPrint( )
It starts after a section is set in the report. You can use this event to update any
counter that needs to be used after report is completed..

OnBeforePrint( )
It starts before a section is set in the report. You can use this event to change the
value of an object in the report before it is printed. It is recommended that report
query fields are not accessed when this event is being used.

OnDataInitialize( )
It occurs before the OnReportStart event. This event allows adding and setting up
fields to the Fields collection of a report before its generation.
Example:
Sub OnDataInitialize()
Fields.Add "Name"
Fields.Add "Sector"
Fields.Add "Code"
End Sub

OnError(Number, Description, SCode, Source, HelpFile, HelpContext,


CancelDisplay)
This event is generated by an internal error in the report. If this event is not treated,
E3 will show a generic error message.

OnError event variables


NAME DESCRIPTION
;, " Integer identifying the error.
= $' String with the error description.
+ Integer carrying the OLE subsystem (not used) error code.
,$ String with the error origin object.
E '1 String with the help file name and path.
E ' % Help topic context number (integer) referring to the error.
$= ' 4 Boolean; indicates if the error should be showed in a
MessageBox.

OnFetchData(eof)
OnFetchData event is triggered every time a new register is processed. Use this
event to run a script in order to change the value of the fields added in the
Events 79
E3 - Scripts - Reference Manual

OnDataInitialize event. variable has the standard value True and indicates that
after the script, the current register processing of the report.

OnFormat( )
It starts after the data are read and loaded in the report, but before section is set for
printing. This event can be used to change report’s (or any other object’s) section
layout.

OnHyperlink(Button, Link)
Hyperlink event occurs when a link in the report is clicked. You can use this event
either to run a script that redirect a hyperlink or to configure a hyperlink in the
report. Button variable indicates which button was clicked (usually 1) and the Link
variable specifies to which address it will be directed.

OnNoData( )
This event occurs when there are no data to be printed in the report. You can use this
event in order to run a script that shows an error message on Screen informing lack
of data to print and cancel the report.

OnPageEnd( )
It occurs at the end of printing of each report page.

OnPageStart( )
It occurs at the beginning of printing of each report page.

OnPrintProgress(PageNumber)
It occurs while a report page is being printed. . ;, " variable indicates the
current page number.

OnReportEnd( )
This event is triggered at the end of the report generation, after finishing its printing.

OnReportStart( )
This event is triggered at the beginning of the report generation, before printing.

80 Events
. .

Methods are procedures that can be executed by objects. For example, the object
Screen opens via a method, and closes via another one.
Because they are encapsulated (i.e., “stored” inside the objects), you must always
state the object to which you are referring in a method call. Many E3’s methods are
encapsulated in the object Application, which represents the application itself.

.
Many predefined methods have parameters, which can (or should) be passed at
method call. For this, VBScript has a rule that must be followed: If the method is
used in an assignment, their parameters should be put in brackets. For example, look
at this GetObject() method's call:
obj = Application.GetObject("data.tag001")
If the method is called the brackets should be taken out. For example, look at this
SetVariableValue() method call:
Screen.Item("Query").SetVariableValue Value,12
Brackets used in the methods'citations in this manual work only as an indicator to
differentiate them from the properties. In the scripts, the rule should be followed.

. ,
In this chapter we listed many methods predefined in the E3, grouping them by
object types, and beginning with the default methods of all application objects.
Each entry presents the method name, with its respective parameters and correct
syntax, and an example of method use.

Methods 81
E3 - Scripts - Reference Manual

Activate()
Activates a currently inactive object.
Example:
Dim obj, new
Set obj = Application.GetObject("Data")
' Create a new object and let it disabled (False).
Set new = obj.AddObject("DemoTag", False)
' Setup the new object parameters.
new.Name = "tag001"
new.Type = 3
' Enable the object (startup).
new.Enable()

AddObject(strClassName, bActivate)
AddObject() method add a new object in the application via script. This method has
the ; parameter, which is mandatory, and indicates the type of object
that will be created.
For example, in order to create a rectangle on the Screen the ;
parameter should be the “DrawRect”. Created object is located in the object that
called the AddObject() method and can be accessed by the Item() method.
The "0$& parameter is optional and indicates whether the object will be enabled
after its creation or not. When the object is enabled the links and scripts remain
enabled. If the object is created with "0$& in False condition, it can be lately
enabled by the enable method.
The object will be created only if it is of a type compatible to the object that contains
it. In order to be sure that the object was created, IsObject() method can be used.
In order to use this method along with other objects on Screen, just type
“addObject("ObjectName", True)”. In order to use it with an XControl, just type on
the script “addObject("Libname.XControlName",True)”.
Example:
...
Set rc = Screen.AddObject("DrawRect", True)
rc.X = 1000
rc.Y = 1000
rc.width = 10000
rc.height= 10000
rc.Visible = True
...

82 Methods
E3 - Scripts - Reference Manual

NOTE: Only objects having the option “Insert” in the menu, can access this method.
Such objects are the following: Viewer, Screen, Data Server, Folders,
Communication Driver and Blocks, Alarms Area, OPC Communication Driver and
Blocks, Alarms Settings, Reports, E3Chart and E3Browser.

Deactivate()
Deactivates a created object, or an object previously activated by Activate() method.
You can deactivate an object when it is necessary to perform a previous
configuration (property initialization, for example), or when you want to perform
tests in which it is necessary that the object is neither present nor activated.
Example:
Dim obj, new
Set obj = Application.GetObject("Data")
obj.AddObject("DemoTag", True)
' Disable the object.
new.Disable()

DeleteObject(strChildName)
Erases from the project the specified object. 2+; parameter is a string
(ignores capital and lower cases) and indicates the child-object one desire to delete.
Method returns True in the event it has accomplished deleting the object, or False, if
child-object does not exist.
In order to delete an object from a reference to an element, parent-object' s
DeleteObject() method is used.
Example:
Dim obj
obj = Application.GetObject("data.tag001")
If obj.Parent.DeleteObject(obj.Name) Then
MsgBox("Tag successfully deleted!")
Else
MsgBox("Deleting failed: tag does not exist.")
Endif

NOTE: Only objects having the option “Insert” in the menu, can access this method.
Such objects are the following: Viewer, Screen, Data Server, Folders,
Communication Driver and Blocks, Alarms Area, OPC Communication Driver and
Blocks, Alarms Settings, Reports, E3Chart and E3Browser.

Methods 83
E3 - Scripts - Reference Manual

GetObject(Link)
GetObject() method searches for an object from the specified project path in (,
and recovers its reference. This allows accessing all object properties and/or
methods.
This is a common practice in scripts programming in E3. It facilitates handling
objects and makes the code more intelligible.
Example:
Sub Button1_Click()
' Assign the value 20 to the object Value property
' InternalTag1 that is in DataServer1.
Set tag = Application.GetObject("DataServer1.InternalTag1")
tag.Value = 20
End Sub

Item(itemid)
Returns the reference to the + child-object of the method calling the object.
Item() method can search for an object either by its name or index (integer, from 1
up to that specified in the Count property). If specified index or name is valid, Item()
method returns the object reference, otherwise it will return an invalid parameter
error.
Example:
Sub Screen1_Click()
' Assign to obj the reference to the Screen1 Button1
' child-object.
Set obj = Item("Button1")
' Set the obj BackgroundColor property, that is,
' of Button1.
obj.BackgroundColor = RGB(255,0,0)
End Sub

Save()
This method saves the specified object that was modified in runtime. Children-
objects will also be saved, as parent-object specifications. This method is not valid
for Screen and viewer objects.
Example:
Sub CommandButton1_Click()
Set area = Application.GetObject("ConfigAlarms")._
AddObject("Area", true)
Application.GetObject("ConfigAlarms").Save()
End Sub

84 Methods
E3 - Scripts - Reference Manual

." 9 ,
Write(N1, N2, N3, N4, Value)
Writes data in the equipment synchronously. This method returns a Boolean
indicating whether the operation has been successful or not.
;9 to ;I parameters correspond to driver’s [;] parameters. 8 , parameter defines
the value to be written in the driver. For further information on these parameters, see
driver’s documentation.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, write into the driver
Set driver = Application.GetObject("Driver1")
'Takes the driver
driver.Write 4, 5, 1, 0, 55.5
'Write value 55.5
End Sub

WriteEx(N1, N2, N3, N4, Value, vTimestamp, vQuality,


[vWriteStatus])
Writes data in the equipment. This method returns a Boolean indicating whether the
operation has been successful or not.
;9 to ;I parameters correspond to driver’s [;] parameters. 8 , parameter defines
the value to be written in the driver. For further information on these parameters, see
driver’s documentation.
&- ', & H, 4 , and &
5 , parameters are optional. When omitted,
method’s behavior is similar to Write()’s. & - 'specifies the timestamp to
be written in the tag (if supported by the equipment). If omitted, the timestamp from
the moment of the write operation is assumed. & H, 4indicates quality (from 0 to
255). If omitted, quality Good (192) is assumed. & 5 , receives a value
returned by the driver, indicating write status (if supported by the driver, according
to its own documentation).
Example:
Dim status
If tag001.WriteEx(100,...,status) Then
MsgBox "Successful writing, status = "& status
Else
MsgBox "Writing failed, status = "& status
Endif

Methods 85
E3 - Scripts - Reference Manual

." 9 !: 9 + # + #) '

Write()
Writes I/O Tag’s, I/O Block’s or Block Element’s current value in the equipment.
Usually, this script command is used only when the object’s AllowWrite property is
False. For further information, see driver’s documentation. This method returns a
Boolean indicating whether the operation has been successful or not.

WriteEx(vValue, vTimestamp, vQuality, [vWriteStatus])


Writes values in the equipment. All its parameters are optional; if omitted, method’s
behavior is the same as Write()’s. This method returns a Boolean indicating whether
the operation has been successful or not.
& 8 , parameter defines the value to be written in the driver. Datatype depends on
the driver; if omitted, tag’s current value is assumed. & - 'specifies the
timestamp to be written in the tag (if supported by the equipment). If omitted, the
timestamp from the moment of the write operation is assumed. & H, 4indicates
quality (from 0 to 255). If omitted, quality Good (192) is assumed. & 5 ,
receives a value returned by the driver, indicating write status (if supported by the
driver, according to its own documentation).
Example:
Sub Tag1_OnRead()
' Use WriteEx to transfer values from a driver to another
Application.GetObject("Driver2.Tag")._
WriteEx Value, TimeStamp, Quality
End Sub

86 Methods
E3 - Scripts - Reference Manual

.$
Refresh(Source)
Forces the server to re-send values from all tags in the group whose write is enabled,
whether they have changed their values or not.
,$ parameter determines driver’s data source argument. If the input value is 1
( 21 $2 ), sent values are server’s cache value; otherwise, if the input
value is 2 ( 21 = &$), values are updated in server’s cache before they
are sent.
To make sure this method works, group’s Enabled property must be True, as well as
at least one tag read. For further information on Advise mechanism, see AllowRead
and AdviseType properties.
Example:
Sub CommandButton1_Click()
Application.GetObject("DriverOPC1.Group1").Refresh(2)
End Sub

Write()
Writes OPC Tag’s, OPC Block’s or OPC Block Element’s current value in the
equipment. For further information, see driver’s documentation. This method returns
a Boolean indicating whether the operation has been successful or not.

WriteEx([vValue], [vSyncWrite])
Writes values in the equipment. All its parameters are optional; if omitted, method’s
behavior is the same as Write()’s. This method returns a Boolean indicating whether
the operation has been successful or not.
&8 , parameter defines the value to be written in the driver. Datatype depends on
the driver; if omitted, tag’s current value is assumed. & 4 $ 5 parameter is a
Boolean that specifies whether the operation is synchronous (True) or asynchronous
(False). If omitted, the value specified in SyncWrite property is used.

NOTE: just as for Write() method, the write is performed whether the value is
different or not from tag’s current value, as well as whether tag’s AllowWrite
property is True or False. Also, if the write works but the tag is not in scan (either
because AllowRead property is False, or because it uses the option
0+& 52 (+ when not linked), the written value is immediately assumed as
having good quality, and with the timestamp of the write moment.

Methods 87
E3 - Scripts - Reference Manual

..
ClearFailure(strName)
Called to indicate that a failure reported by ReportFailure() becomes inactive. The
parameter ; specifies the failure name (defined by user) and must be passed
to ReportFailure() when the method is called.

ReportFailure(strName, strDescription, nWeight)


Allows the application to report failures to E3 Server. The reported failures are
usually conditions that keep the application from working partially, such as errors or
malfunctions, and normally cannot be detected by E3 Server. Thus, this method can
be used in these situations:
• To advise the system operator about problems in the server;
• To help hot-standby manager to elect the best server to take control of
the application.
ReportFailure method parameters
NAME DESCRIPTION
; Failure name (defined by the user). This
parameter must be passed to ClearFailure()
method whenever the failure becomes inactive.
Example: “FaultCOM1”.
= $' Fault description (defined by the user).
Example: “Communication fault at COM1”.
5 .2 Defines the failure’s severity (or “weight”). Zero
value indicates no gravity. Higher values indicate
more severe faults.

Example:
Sub TagSerialStatus_OnValueChanged()
If Value then
'The tag value is True, application is on error
Application.ReportFailure "FAULT_COM1",_
"Communication fault at COM1", 100
Else
'The tag value is False, clear the failure
Application.ClearFailure "FAULT_COM1"
End If
End Sub

88 Methods
E3 - Scripts - Reference Manual

Trace(MessageText [,LogTimeStamp [,BreakLine]])


Allows recording messages in a text file. Messages will be recorded in a file with the
same name and path as the domain file, but as a .txt file. Each new message is
always inserted at the end of the file. In case there is some failure in file record (like
access denied, for example), there will be a script error.
This method can be used, for example, to record script depuration messages not
executed at Viewer (because in this case it is not possible to use MsgBox() method).

Trace method parameters


NAME DESCRIPTION
. - % Message defined by the user.
.- ' If True, each record must indicate timestamp.
Otherwise, timestamp is not shown. Default value is
True. (Optional).
( If True, indicates the presence of a line break at the
end of each message. Otherwise, all records in the file
are displayed in one line. Default value is True.
(Optional).

./ , ' !
Reset()
Resets the phase (movement in time) of the tag’s wave format. This phase must not
be reset unless the tag is enabled. This method, when the tag is enabled, has no
effect on CurrentTime and Random tags, which are not periodic. When the tag is
disabled, its value is simply reset, regardless of tag type.
Example:
Sub CommandButton1_Click()
Application.GetObject("Data.Sine").Reset()
End Sub

.0 !
WriteEx(NewValue, NewTimestamp, NewQuality)
Allows you to modify an Internal Tag’s value, timestamp, and quality in just one
operation. This method returns a Boolean indicating whether the operation has been
successful or not.
; 8 , parameter specifies tag’s new value; if omitted, tag value does not
change. ; - 'parameter specifies tag’s new timestamp; if omitted, the
timestamp from the moment of method call is used. ; H, 4parameter specifies
Methods 89
E3 - Scripts - Reference Manual

tag’s new quality; if omitted, Good quality (192) is assumed. All these parameters
can be omitted.
Example:
Sub CommandButton12_Click()
dim Ret
Ret = Application.GetObject("Dados.TagInterno1")._
WriteEx(123.456,"1/1/2001", 193)
if Ret Then
MsgBox "It works!"
Else
MsgBox "It failed!"
End if
End Sub

.6
Close(Code)
Use Close() method to close the Screen. This method generates the OnHide event
before being effectively performed. The parameter + indicates the returned value
for DoModal() method, if the Screen was called by this method.
Example:
Sub CloseButton_Click()
' When click CloseButton, closes the window
Screen.Close(0)
End Sub

SetFocus()
Use SetFocus() method to move the mouse or keyboard focus to a specific object.
Example:
Sub Screen1_OnShow()
'When opening the window, move focus to Button1
Item("Button1").SetFocus()
End Sub

90 Methods
E3 - Scripts - Reference Manual

.7 1 '
BringToFront()
Bring to front a frame object that is hidden or under another one.
Example:
Sub Button1_Click()
Application.GetFrame("Test").BringToFront()
End Sub

CaptureScreen(Filename)
Capture the content of a chart frame, saving it into a file of a 1 name and
path, in BMP format.
Example:
Sub CommandButton1_Click()
' When clicking the button, save frame
'content to FRAME.BMP file.
Screen.Frame.CaptureScreen ("c:\temp\frame.bmp")
End Sub

Close(Code)
Use Close() method to close the frame’s window. The parameter + indicates the
returned value for DoModal() method, if the window was called by this method.
Example:
Sub CloseButton_Click()
' When click CloseButton, closes the window
Screen.Close(0)
End Sub

FlashWindow(Number, Time)
This method makes viewer icon begins to blink on Windows taskbar. ;, "
parameter determines the number of times the task must blink and - determines
the time (in milliseconds) between the blinks.
Example:
Sub Text1_Click()
set frame = Application.GetFrame("_top")
frame.FlashWindow 50, 500
End Sub

Methods 91
E3 - Scripts - Reference Manual

MaximizeFrame()
Use this method in order to maximize a frame or modal Screen.
Example:
Sub CommandButton4_Click()
Application.GetFrame("Other").MaximizeFrame()
End Sub

MinimizeFrame()
Use MinimizeFrame() method in order to minimize a frame or modal Screen.
Example:
Sub CommandButton4_Click()
Application.GetFrame("Other").MinimizeFrame()
End Sub

MoveFrame([PosX], [PosY], [SizeX], [SizeY])


Moves and resizes a Frame for a specific coordinate and size. The parameter D
informs the new X position, and G informs the new Y position, in pixels; 3D
informs the new width and 3G the new height, in pixels. All parameters are
optional.
Example:
Sub Screen2_OnPreShow(vArg)
'When Screen2 opens in Test frame, it alters the position
'and the size of this frame
Application.GetFrame("Test").MoveFrame 100,100,200,200
End Sub

OpenScreen(ScreenName, Arg)
OpenScreen() method opens a Screen inside a frame. The parameter $ ;
determines the name of the Screen to be opened. It is also possible to specify
Screen’s zoom percentage and to enable scrollbar through the key “?”, as seen the
model below:
<Screen-name>?<zoom>?<enable-scroll>
where <Screen-name> is the name of the Screen to be opened; <zoom> stands for
Screen’s zoom percentage, and <enable scroll> enables or disables scroll.
Screen’s zoom percentage can assume the following values: 1= the whole page; 2 =
Screen width occupies 100% of frame’s width, with proportional height; 3 = Screen
height occupies 100% of frame’s height, with proportional width; 4 = Screen fills
the frame completely; 5 to 100 = is equivalent to actual Screen’s zoom percentage.
Scroll enabling can assume the following values: 1 = enables scroll; 0 = disables
scroll.

92 Methods
E3 - Scripts - Reference Manual

The parameter 0.enables you to pass the specified value to the Screen through the
event OnPreShow.
Example:
Sub Button1_Click()
'When clicking the button, Screen2 opens in Test Frame
'and passes the value 1 that will be used in the PreShow
event
Application.GetFrame("Test")._
OpenScreen "Screen2?100?0","This is a test."
End Sub

Sub Screen2_OnPreShow(vArg)
'The message will show the
'sentence "This is a Test."
MsgBox vArg
End Sub

Refresh(Force)
Refresh() method allows forcing a frame content redraw within a script. It must be
used in Viewer massive processing scripts (i.e. loops), or in method calls that
demands long time and needs to show the user the task progress.
Due to redrawing to be a heavy operation, the Refresh() default method call (with no
parameters) is optimized, and ignore successive redraw requests that are too close,
including the E3 normal redraw. This default behavior is indicated to show loop
progress. The parameter 1 $ disables this optimization, and forces the redraw on
every Refresh() method’s call. Using this option, Refresh() must not be called
successively (i.e. inside a loop).

Methods 93
E3 - Scripts - Reference Manual

Example:
Sub CommandButton1_Click()
' Draw a progress bar of an operation
While i < 31
Screen.Item("Rectangle2")
.HorizontalPercentFill = (i/30)*100
Frame.Refresh()
<-- some time-consuming operation -->
i=i+1
Wend
End Sub

RestoreFrame()
RestoreFrame() method allows restoring the chart windows to its original size.
Example:
Sub CommandButton1_Click()
Application.GetFrame("Other").RestoreFrame()
End Sub

SetForegroundWnd()
SetForegroundWnd() method enable and focus the Viewer window. This method is
useful when one desires to call operator'
s attention to some event occurred and
Viewer window is found hidden or minimized. Example:
Sub CommandButton1_Click()
Application.GetFrame("Other").SetForegroundWnd()
End Sub

SetFrameOptions(Title, Flags)
Used to setup frame title on the window and window style. - parameter contains
the window title. This text will be shown in case Screen'
s Caption property is empty.
1 . parameter specifies the window style. A special value (-1) can be used in
order to keep the same settings, while only Caption is changed. If this parameter is
omitted, default will be -1. When the value specified is not -1, it is possible to
obtain modifications in window style with the sum of the following combinations:

94 Methods
E3 - Scripts - Reference Manual

Possible combinations for Flags parameter


VALUE DESCRIPTION
9 Enable title bar on the window.
: Enable "Close" button on the window
I Enable "Minimize" button on the window
K Enable "Maximize" button on the window
9 Enable window border.
F: Specifies that the window can be dimensioned. For this, the window
must have a border.
I Specifies that the window can be moved.
:L Specifies that the window will be on the top of the window.
L9: Specifies that the window will be setup in the “Tools Bar” style.
9M:I Disable control buttons.

Examples:
Sub Screen_OnPreShow()
Frame.SetFrameOptions("Alarm Screen", 114)
End Sub
In the example, the value 114 (2+16+32+64) indicates that the window will have the
following style: button enabled (2), border on (16), can be resized (32) and
can be moved (64). The window title will be “Alarm Screen”.
In Open Screen and Open modal Screen picks are possible to set up the window
style through the 5 + 4 dialog. For more information, see the topic
“Picks”, in chapter “Introduction”.

. <
BringToFront()
Makes object be positioned in front of all other objects on Screen.
Example:
Sub Button1_Click()
' When clicking Button1, the system
' brings Rectangle1 object to front
Screen.Item("Rectangle1").BringToFront()
End Sub

Methods 95
E3 - Scripts - Reference Manual

SendToBack()
Makes object be positioned behind of all other objects on Screen.
Example:
Sub Button2_Click()
' When clicking Button2, the system
' takes Rectangle1 object to back
Screen.Item("Rectangle1").SendToBack()
End Sub

. 8

. ''

BringToFront()
Brings object to the uppermost layer on Screen, in front of all others.
Example:
Sub Button1_Click()
' When clicking Button1, the system
' brings Rectangle1 object to front
Screen.Item("Rectangle1").BringToFront()
End Sub

SendToBack()
Sends object to the lowermost layer on Screen, at the back of all others.
Example:
Sub Button2_Click()
' When clicking Button2, the system
' takes Rectangle1 object to back
Screen.Item("Rectangle1").SendToBack()
End Sub

SetFocus()
Use SetFocus() method to move mouse or keyboard focus to a specific object.
Example:
Sub Screen1_OnShow()
'When opening the window, move focus to Button1
Item("Button1").SetFocus()
End Sub

96 Methods
E3 - Scripts - Reference Manual

. ' +

AddItem([pvargItem], [pvargIndex])
Adds items to a ComboBox or to a ListBox. '& . is a string containing the text
to be added to the box; if omitted, a blank string will be added. '& . + %is the
combo’s text index; if omitted, '& . is added as the last item on the box.
Example:
Sub CommandButton1_Click()
EntryCount = EntryCount + 1
ComboBox1.AddItem (EntryCount & " - Selection")
End Sub

Clear()
Clears the text from the object.
Example:
Sub ClearTextButton_Click()
ComboBox1.Clear()
End Sub

Copy()
Copies the previously selected content to the clipboard. Use Paste() method to paste
the content into the place indicated.
Example:
Sub CommandButton1_Click()
Screen.Item("ComboBox1").Copy()
End Sub

Cut()
Cuts the previously selected content to the clipboard. Use Paste() method to paste
the content into the place indicated.
Example:
Sub CommandButton1_Click()
Screen.Item("ComboBox1").Cut()
End Sub

Methods 97
E3 - Scripts - Reference Manual

DropDown()
The method opens the ComboBox object item list. This method does the same as the
button clicking in the button on the right side of the object.
Example:
Sub CommandButton1_Click()
Dim ComboBox1
ComboBox1.AddItem "Pineapple"
ComboBox1.AddItem "Strawberry"
ComboBox1.AddItem "Grape"
ComboBox1.AddItem "Orange"
ComboBox1.DropDown()
End Sub

Paste()
Inserts the content of the clipboard into the object.
Example:
Sub CommandButton1_Click()
Screen.Item("ComboBox1").Paste()
End Sub

RemoveItem(pvargIndex)
Removes a line from a List Box or a Combo Box. This method has the '& . + %
parameter specifying the line to be excluded. The first line number is 0, the second
line number is 1, and so on. Example:
Example:
Sub CommandButton2_Click()
ComboBox1.SetFocus
'Check if the list contains the selected data
If ComboBox1.ListCount >= 1 Then
'If there is no selection, choose the last item.
If ComboBox1.ListIndex = -1 Then
ComboBox1.ListIndex = ComboBox1.ListCount – 1
End If
ComboBox1.RemoveItem (ComboBox1.ListIndex)
End If
End Sub

98 Methods
E3 - Scripts - Reference Manual

. " 4 +

AddItem([pvargItem], [pvargIndex])
Adds items to a ComboBox or to a ListBox. '& . is a string containing the text
to be added to the box; if omitted, a blank string will be added. '& . + %is the
combo’s text index; if omitted, '& . is added as the last item on the box.
Example:
Sub CommandButton1_Click()
EntryCount = EntryCount + 1
ListBox1.AddItem (EntryCount & " - Selection")
End Sub

Clear()
Removes the text from the list box. Example:
Sub ClearTextButton_Click()
ListBox1.Clear()
End Sub

RemoveItem(pvargIndex)
Removes a line from the List Box. This method has the parameter '& . + %that
specifies the line to be excluded. The first line number is 0, the second line number
is 1, and so on. Example:
Sub CommandButton2_Click()
ListBox1.SetFocus
'Check if the list contains the selected data
If ListBox1.ListCount >= 1 Then
'If there is no selection, choose the last item.
If ListBox1.ListIndex = -1 Then
ListBox1.ListIndex = ListBox1.ListCount – 1
End If
ListBox1.RemoveItem (ListBox1.ListIndex)
End If
End Sub

Methods 99
E3 - Scripts - Reference Manual

. $ +

Copy()
Copies to clipboard the content selected. Use Paste() method to paste the content
into another place indicated.
Example:
Sub CommandButton1_Click()
Screen.Item("TextBox1").Copy()
End Sub

Cut()
Cuts to clipboard the content selected. Use Paste() method to paste the content into
another place indicated.
Example:
Sub CommandButton1_Click()
Screen.Item("TextBox1").Cut()
End Sub

Paste()
Inserts the object content from the clipboard into the designated place.
Example:
Sub CommandButton1_Click()
Screen.Item("TextBox1").Paste()
End Sub

. 4 #
Links, Connections or Associations are links among objects applications and their
modules. Links property is a collection of object links. For further information, see
User Manual, chapter “Links”.

CreateLink(Property,Source[,Type])
This method allows creating a connection of a type specified with an object
property. In case of success, the method returns the created object. Otherwise, a
script error shall occur and the method will return “nothing”.

NOTE: Returned object not necessarily must be used.


This method has the following parameters: ' 4specifies the property name to
which the connection will be created. ,$ specifies the name of the connection
origin-object. The number specifying the connection type to be created is

100 Methods
E3 - Scripts - Reference Manual

determined by -4' . By being an optional parameter, when omitted it implies the


creation of a simple connection.

IMPORTANT: Not all properties existing in an object allow the creation of


connections. In order to verify which properties allow the use of this feature, access
tab “Associations”. If the property is invalid to connect, does not exist or it has
already a connection, a script error shall occur.

Available options for Type parameter


OPTION DESCRIPTION
M> ' $ In a simple connection, origin-value is copied
into the property every time it is modified.
9> >+ $ In a bi-directional connection works as the simple
$ connection, however, in the event there is a
variation in the properties, its value will be
copied to the origin, thus generating a two-
direction connection.
:> 0 . $ Analog connection specifies a conversion scale
between the origin-value and the property.
F> =. $ In a digital connection, fixed or alternating
values, which are assigned according to source be
true or false, are assigned to the property.
I> $ "4- " In a connection by table we can specify
conditions among variable, values and
destination. In the table are specified minimum
and maximum values and other configurations.
L> & $ Reverse connection is a unidirectional association
from the property to the source.

Methods 101
E3 - Scripts - Reference Manual

Example:
Sub CommandButton1_Click()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Text1").Links.Item("Value")
If Bind Is Nothing Then
MsgBox "Text1 is not associated to any object."
Dim Source
Source = "Data.InternalTag1.Value"
MsgBox "Creating a connection in '" & Source & "'..."
Set Bind = Screen.Item("Text1").Links._
CreateLink("Value", Source, 0)
Bind.BiDirectional = Screen.Item("BiDirectional").Value
Bind.Reverse = Screen.Item("Reverse").Value
MsgBox "Type: " & TypeName(Bind)
Else
MsgBox "Text1 is already linked to '" &Bind.Source& "'."
End if
End Sub

Item(Property, Index)
This method returns a connection-object from a specific property of an object. If it is
a text, ' 4specifies the property name whose connection one desires to access.
The connection can also be numerically accessed by + %index. This index should
be from 1 up to Count(). In the case the connection to the property or the index is
invalid, a script error shall occur. Like other collections, Links allow using
VBScript' s “For Each” command.
Example:
Sub Text1_Click()
For Each Link In Links
MsgBox "Link origin:” “ & Link.Source
Next
End Sub

102 Methods
E3 - Scripts - Reference Manual

RemoveLink(Property)
This method removes a connection to the property specified by ' 4 , in the case
it exists. In the case a connection to the specified property does not exist, the
function does nothing.
Example:
Sub CommandButton2_Click()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("ScrollBar1").Links.Item("Value")
If Bind Is Nothing Then
'If the connection does not exist
MsgBox "ScrollBar1 is not connected."
Else
MsgBox "ScrollBar1 is linked to '" & Bind.Source & "'"
MsgBox "Removing link..."
Screen.Item("ScrollBar1").Links.RemoveLink("Value")
End if
End Sub

Methods 103
E3 - Scripts - Reference Manual

. 4 #

InsertRow([Row])
Inserts a new line on the table. parameter is optional and specifies in which
table position the line should be inserted. When omitted, it assumes the standard
behavior of inserting a line at the end of the table, which is the same as using
equal to -1. When it is informed and is not equal to -1, it must be a value between 1
and RowCount, and the new line created displace lines of greater or equal index
towards index ascendant direction. A new line always assumes the following
standard values to the properties:
Min:0.0 Max:1.0 Blink:False BlinkValue:0.0 Value:0.0
Example:
Sub InsertRow_Click()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Rectangle1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
MsgBox "Rectangle1 have no association."
Else
Dim row
row = Screen.Item("Row").Value
If (row < 1 Or row > Bind.RowCount) And row <> - 1 Then
MsgBox "Invalid line number " & row
Else
MsgBox "Adding a line in " & row
Bind.InsertRow(row)
If -1 = row Then
row = Bind.RowCount
Bind.Value(row) = _
Screen.Item("Value2").ForegroundColor
Bind.BlinkValue(row) =_
Screen.Item("BlinkValue").ForegroundColor
Bind.Max(row) = Screen.Item("Max").Value
Bind.Min(row) = Screen.Item("Min").Value
Bind.Blink(row) = Screen.Item("Blink").Value
End If
End If
End Sub

104 Methods
E3 - Scripts - Reference Manual

RemoveRow(Row)
Removes the line in a specified index. parameter determines table line to be
removed (it must be from 1 to RowCount).
Example:
Sub RemoveRow_Click()
On Error Resume Next
Dim Bind
Set Bind =_
Screen.Item("Rectangle1").Links.Item("ForegroundColor")
If Bind Is Nothing Then
MsgBox "Rectangle1 have no association!"
Else
MsgBox "Rectangle1 is linked to '" & Bind.Source & "'"
Dim row
row = Screen.Item("Row").Value
MsgBox "Removing line " & row
Bind.RemoveRow row
End if
End Sub

. " * 2
CaptureScreen(Filename)
This method captures the current Screen and saves to a file. The effect is similar to
Windows $ key. The parameter 1 specifies the name of the file
that will receive the captured Screen.

NOTE: The final file format will be always Windows Bitmap (.bmp); any extension
specified in parameter 1 will be ignored.
Example:
Sub CommandButton1_Click()
' When clicking the button, save Screen
' content to SCREEN.BMP file.
Screen.Frame.CaptureScreen ("c:\temp\Screen.bmp")
End Sub

Methods 105
E3 - Scripts - Reference Manual

ChangePassword()
This method opens a dialog box in order to allow changing the current user
password. The method returns True if current user has a permission to change
password. Otherwise, it returns False, indicating there was an operation failure or
that it is not possible to change the password because the user is not authorized.
Example:
Sub Text1_Click()
If Application.ChangePassword(True) Then
MsgBox "The password can be changed."
Else
MsgBox "It was not possible to change password."
End If
End Sub

DoModal(Screen, Title, Left, Top, Width, Height, Arg)


This method opens a modal window. A modal window is a window where it is not
possible to click on other Screens/windows as long as it is not closed. The title
parameter passed in this method will only be used if Caption property is empty;
otherwise, this method’s parameter will be ignored.
This method has the following parameters: $ determines the window Screen,
and the string that will serve as modal window title is defined by - . J- '
defines an integer that will be used for modal window X and Y positions, in pixels.
Modal window width in pixels is set by 5 + 2and the height by E .2. 0.
parameter determines the variable to be used in the Screen OnPreShow event.
Example:
Sub Button1_Click()
'When clicking the Button, another modal Screen opens
Application.DoModal "Screen1", "Title", 0, 0, 400, 200, 0
End Sub

DoModalOP(Screen, Arg, Title, Flags)


Allow opening and setting up a modal window. $ parameter determines the
modal Screen name. Through - parameter it is possible to specify modal Screen
title. 0.parameter is the variable parameter to be passed on OnPreShow event.
1 . parameter determines the combination used on the modal Screen. Such
combination is done by adding table values corresponding to the options the user
desires. When specified value is -1, Viewer settings will be adopted for the modal
window. When this value is different of -1, it is possible to make the following
combinations:

106 Methods
E3 - Scripts - Reference Manual

Possible combinations for Flags parameter


VALUE DESCRIPTION
9 Enable title bar on the window.
: Enable "Close" button on the window
I Enable "Minimize" button on the window
K Enable "Maximize" button on the window
9 Enable window border.
F: Specifies that the window can be dimensioned.
I Specifies that the window can be moved.
:L Specifies that the window will be on the top of the window.
L9: Specifies that the window will be setup in the “Tools Bar” style.
9M:I Disable control buttons.
:MIK Places modal Screen in the center of the Frame, both horizontally and
vertically.

Example:
Sub CommandButton1_Click()
'Parameter 3 (Enable title bar and Close button)
Application.DoModalOp "InitialScreen", 1, "ModalScreen", 3
End Sub

Methods 107
E3 - Scripts - Reference Manual

ESign(ObjName, Description, Action, [From], [To], [User],


[Comment])
Validates some field alteration via electronic signature. When you use this method,
the following dialog box is displayed:

Picture 26: ESign dialog box

ESign method parameters


NAME DESCRIPTION
"#
; Text containing the name of the tag, or of another object.
= $' Text containing the description of "# ; . This is an optional
parameter and, if omitted, the dialog box searches for the data of
"#; NDocString property.
0$ Text with the action to be executed (e.g., “value change”). This
parameter is optional, and its default value is “ ”.
1 Variant with either the original value or the status to be altered. This
is an optional parameter.
- Variant with either new tag value or the value to be applied in
0$ . This is an optional parameter.
6 Return text. Receives the login name typed in the dialog box. This
is an optional parameter.
Return text. Receives the comment typed in the dialog box. This is
an optional parameter.

108 Methods
E3 - Scripts - Reference Manual

This method returns True if the user presses <, and if the fields 6 and
+ are valid. Otherwise, if the dialog box is cancelled, or if login or
password fails after three attempts, the method returns False. In case of failure, 6
and are configured for “ ”.
Pre-defined comments are kept in Windows registry. Only the last 26 comments are
saved. Each time the window is created, last comments are searched in the registry
and used to fill the combo box. If a new comment is informed by the user, it will be
saved, and the oldest will be discarded, in case there is no free position. If a pre-
defined comment is used, this will be the first on the list of the most recent
comments.
Example:
Sub Button1_Click()
Dim Tag, User, Comment
Set Tag = Application.GetObject("IO.Inputs.I001")
If Application.ESign(Tag.PathName,, "Change in Value",_
Tag.Value, 1, User, Comment) Then
If Tag.WriteEx 1 Then
Application.TrackEvent
"Tag IO.Inputs.I001 changed to 1 " &_
"by the user" & User, Comment
End If
End If
End Sub

NOTE: The returned parameter $ = can be 0 (zero), in the case of any


process couldn’t be initiated. For example: if the specified document is a URL and
Internet Explorer is already running, the application will simply show the URL and
any other process won’t start. Thus, $ =will be 0 (zero).

ExecuteExternalApp(AppPath, Arguments, InitialDir, CmdShow,


[ProcessId])
This method runs an external application whose name and path is designated
0'' 2, with the 0., arguments, beginning in the work directory
= . When a document in 0'' 2is specified, application associated to this
document is executed and the document is passed as one of the application
parameters. $ = receives a number identifying the process (this number is
used in IsAppRunning() method). + 2 parameter specifies the opening mode
of the application window, such as the table below:

Methods 109
E3 - Scripts - Reference Manual

Available options for nCmdShow parameter


OPTION DESCRIPTION
M Hides the window and activates another window.
9 Activates and displays a window. If the window is
minimized or maximized, Windows restores it to its original
size and position. An application should specify this flag
when displaying the window for the first time.
: Activates the window and displays it as a minimized
window.
F Activates the window and displays it as a maximized
window.
I Displays a window in its most recent size and position. The
active window remains active.
L Activates the window and displays it in its current size and
position.
Minimizes the specified window and activates the next top-
level window.
O Displays the window as a minimized window. The active
window remains active.
K Displays the window in its current state. The active window
remains active.
P Activates and displays the window. If the window is
minimized or maximized, Windows restores it to its original
size and position. An application should specify this flag
when restoring a minimized window.

Example:
Sub CommandButton1_Click()
dim ret
Application.ExecuteExternalApp "calc.exe", "", "", 1, ret
Application.GetObject("Data.InternalTag1").Value = ret
End Sub

Exit()
This method closes Viewer window.
Example:
Sub_Button1.Click()
Application.Exit()
EndSub

110 Methods
E3 - Scripts - Reference Manual

GetFrame([FrameName])
GetFrame() method has as objective searching for a frame object which is already
opened in current Viewer. This method has the 1 ; parameter, which is
optional and determines the name of the chart to be searched for. In case the value
specified in 1 ; is empty, it will return a chart containing all frames or the
window currently active. With the return of this method, use frame methods, such
as, for example, OpenScreen() method in order to open another Screen.
Example:
Sub Button1_Click()
'When clicking the Button, it takes Menu chart
and replace this chart's current Screen to the Options
Screen
Set frame = Application.GetFrame("Menu")
'Chart has an object of frame type
.OpenScreen "Options", 0
End Sub

GetValue(TagName)
GetValue() method search for the value of an object from the path specified in
- .; parameter, that is mandatory, and specifies the object path in the server to
be searched. If the path specified in - .; parameter points to a property, this
method will return the property value. On the other hand, if - .; parameter
specifies only one single object, the method will return the value of object property
Value.
Example:
Sub Button1_Click()
When clicking the Button, it takes the value of a tag
running in a DataServer
X = Application.GetValue("DataServer1.InternalTag1")
End Sub

GetFormulaUnitDataObj(FormulaName)
This method, used in any script in the graphical interface (Viewer), obtains the
setting of existing units in a given formula. Units are the destination of data saved in
the formula (values). This method has the 1 , ; parameter, which informs
formula name.
Use GetFormulaUnitDataObj() method to obtain a collection of units of a formula.
This method returns True if achieved performing the operation, otherwise returns
False.

Methods 111
E3 - Scripts - Reference Manual

Example:
Sub Button1_Click()
Dim val
'When clicking the button, it shows a MessageBox
'with the number or Units and the name of the
'First Unit
set obj= Application.GetFormulaUnitDataObj("Formula1")
MsgBox CStr(obj.Count)
MsgBox CStr(obj.Name(1))
End Sub

GetFormulaValueDataObj(FormulaName)
This method used in some script in graphical interface (Viewer), obtains the setting
of values existing in a specific formula. Values are a set of data saved into the
formula. This method has the 1 , ; parameter that informs formula name.
Use GetFormulaValueDataObj() method to obtain a collection of values of formula.
This method returns True if achieved performing the operation, otherwise returns
False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it shows a MessageBox
'with the number of Sets
'and the name of the First Set
set obj= Application.GetFormulaValueDataObj("Formula1")
MsgBox CStr(obj.Count)
MsgBox CStr(obj.Name(1))
End Sub

IsAppRunning(ProcessId)
Indicates if an application started by ExecuteExternalApp() method is running.
Returns True if the application identified in the operational system by $ =is
running. Otherwise, it returns False.

112 Methods
E3 - Scripts - Reference Manual

Example:
Sub CommandButton1_Click()
Application.ExecuteExternalApp _
"www.elipse.com.br", "", "", 1, processID
while Application.IsAppRunning(processID)
' espera pelo final da aplicação
wend
MsgBox "The application was closed!"
End Sub

IsUserMemberOfGroup(GroupName)
This method checks whether user logged in the current Viewer belongs to a specific
group. This method has the ,'; parameter that specifies the group name
one wants to check. The method returns True if user belongs to the ,';
group, otherwise it returns False.
Example:
Sub CommandButton1_Click()
If Application.IsUserMemberOfGroup("Support") then
Msgbox ("The user" & Aplication.User & _
"is a Support group member")
Else
Msgbox ("The user" & Aplication.User & _
"is not a Support group member")
End If
End Sub

IsWebViewer()
Check if the application is viewed by E3WebControl. Checking is done by the
ActiveX control. The method returns True if the application is running under
E3WebControl; otherwise, it returns False.

NOTE: This property does not check if it is running on Internet.

LoadFormulaDlg(FormulaName, [UnitName], [ValueName])


This method, used in any script in the graphical interface (Viewer), presents a dialog
box allowing the user to choose the set of values and the destination unit by loading
a formula. This method has a 1 , ; parameter that determines formula
object name that will be operated.
Use LoadFormulaDlg() method in order to call a dialog box for loading specified
formula object data by 1 , ; . In this box is possible to specify which set of
values (6 ; ) will be sent to which set of tags (8 , ; ). In this message
box the user counts on all sets of values and units available in formula object, and
Methods 113
E3 - Scripts - Reference Manual

can freely assign one to another. When user clicks [ <, the set of values will be
loaded in the specified unit.
Example:
Sub Button1_Click()
'Calls the dialog box to operate
Dim val
Application.LoadFormulaDlg("Formula1”)
End Sub

LoadFormulaValues(FormulaName, UnitName, ValueName)


This method, used in some scripts in the graphical interface (Viewer), automatically
loads a set of values to a destination unit, presents a dialog box allowing the user to
inform values different from those defined in the Formula. This method has the
following parameters: 1 , ; determines the Formula name and 6 ;
determines the unit name. Values set name is setup in the 8 , ; parameter.
A message box will appear, allowing user to inform values different from those
defined to each formula values.

NOTE: The method returns a logic value, that is, it returns True when it is
successfully executed, and False when it fails, which does not mean there is a script
error.
Example:
Sub Button1_Click()
Application.LoadFormulaValues "Formula1", "Unit1", "Value1"
End Sub

LoadFormulaValuesQuiet(FormulaName, UnitName, ValueName)


This method loads a values set to a destination unit, without showing any message.
This method has the following parameters: 1 , ; determines the formula
name and 6 ; determines the unit name. Values set name is indicated in the
8 ,; parameter.

NOTE: This method can be accessed through the Formula object also.

114 Methods
E3 - Scripts - Reference Manual

LoadReport(ReportName)
Load a report model. ' ; parameter is the name of the report to be loaded.
Example:
Sub Rect_Click()
' Loading predefined report
Set strRep = Application.LoadReport("[Report3]")
strRep.PrintPreview ' Viewing printing
End Sub

Login([Mode])
It opens a dialog box for “login” (user authentication) in the application. Logged
user remains in memory until another login or logout (user exit from the application)
be done. This method has the optional + parameter, which is a Boolean
specifying whether a confirmation or operation failure message shall be showed (by
default it is False). When a window will be opened (through OpenScreen() method),
it is checked whether any security setting exist. In case it exists, the window only
will be opened if the logged user has permission to do it. In case he does not have
permission, it is opened a dialog for the login.
Examples:
Sub InitialScreen_OnPreShow(vArg)
Application.Login ' Use False as default
Application.Login(True)
Application.Login(False)
End Sub

Logout([Mode])
It performs the logout (current user exit from the application) from Viewer. In case
there is no logged user, this method has no effect. From this moment on, it will be
considered that an “anonymous” user is using the application. One can use
OnLogout event in order to run a script to go to the initial Screen or to finish the
application). This method has the optional + parameter, which is a Boolean
specifying whether a confirmation or operation failure message shall be showed (by
default it is False).
Example:
Sub InitialScreen_OnPreShow(vArg)
Application.Logout(True)
End Sub

Methods 115
E3 - Scripts - Reference Manual

PasswordConfirm(Mode)
This method opens a dialog asking for another confirmation of the currently logged
user password. The method returns True if the password was confirmed, otherwise
False. + Boolean parameter specifies whether a logout has to be performed in
case of confirmation failure (True) or not (False).
If the dialog is closed through [ $ ] button, the function returns False. In case
there is no logged user, the function returns a False, but without opening a dialog
box. In the case the typed password is not correct, the request is repeated up to three
times and then it closes, returning a False.
Example:
Sub Text1_Click()
If Application.PasswordConfirm(True) Then
MsgBox "ConfirmPassword returned a True"
Else
MsgBox "ConfirmPassword returned a False"
End If
End Sub

Playsound(Filename)
Plays a specific sound file whose path and name are indicated in Filename
parameter.. This method has the 1 parameter that determines the sound file
to be played. The file must meet the following specifications:
• it only accepts files with .wav extension;
• if the file is in the project (added through the option “Insert resource”),
the file must be between brackets [ ] (e.g.: [sons.wav]).
If it is created a folder in the project and "Insert resource" feature is used, the file
path must be between double quotes "" (e.g.: "c:\sound\ding.wav"). If the file is in
local directory, the name does not need quotes and it is enough to type the path (e.g.:
c:\sound\ding.wav).
Example:
Sub InitialScreen_OnAlarm()
'If exists an active alarm, play alert sound.
'When the alarm is acked, the sound stops.
Set Alarm = Application._
GetObject("AlarmConfig1.Area1.AlarmSource1")
If Alarm.ActiveNACKAlarms = True Then
Application.PlaySound("[ringin.wav]")
End If
End Sub

116 Methods
E3 - Scripts - Reference Manual

SelectMenu(Menu)
This method shows a “pop-up “ menu as specified by ,parameter. This text
consists of many options delimited by the character |, where each of these strings
will be a menu option. In case there is a set of two delimiters (||), it inserts a
separator. Use the characters { and } in order to create a submenu. A * character in
front of a string means that options will have a checkmark. While a ! character will
make the option disabled.
This method returns 0 if no option is selected, or the option number, considering that
1 would be for the first option contained in the text, 2 for the second and so on.
Example:
Sub Button1_Click()
op = Application.SelectMenu("Option 1|Option 2|Option 3")
If op = 1 Then
MsgBox "Option 1 was chosen"
ElseIf op = 2 Then
MsgBox "Option 2 was chosen"
ElseIf op = 3 Then
MsgBox "Option 3 was chosen"
ElseIf op = 0 Then
MsgBox "No option was chosen"
End If
End Sub

SetValue(TagName, NewVal)
This method setup the value of an object within the server. SetValue() method
searches for an object/property running in the server and assigns the value specified
in the parameter defined in - .; . ; 8 parameter type and value shall be
supported by the object specified in - .; .
Example:
Sub Button1_Click()
'When clicking the Button1, it sets up the value of a tag
'the DataServer and sets up the value 20 to the tag
Application.SetValue "DataServer1.InternalTag1", 20
End Sub

ShowDatePicker (DateValue, Left, Top, [DefaultDate])


Opens a dialog box to change date and time. This method returns a True if user
confirms date, and False if user cancels the edition. The new date is returned by
= 8 , parameter. Dialog box position can be set through and - '
parameters, which indicate the distance from the left and the top of the Screen in
pixels, respectively. If the parameters are not informed, the dialog box remains
Methods 117
E3 - Scripts - Reference Manual

centralized. = , = parameter' s value is the initial timestamp (date/hour) when


the dialog box is opened. If they do not inform date, the system assumes the current
date; if they do not inform hour, the system assumes 00:00:00. If neither date nor
hour are informed, it will start with current date and time.
Examples:
Sub Text2_Click()
Dim newHour
Application.ShowDatePicker newHour, 300, 300
MsgBox "The hour is: "& newHour
End Sub

ShowFilePicker(Open, FileName, [Extension], [Flags], [Filter])


Displays Windows’ Save and Open File dialog boxes. ' parameter indicates
the dialog to be opened; if True, it opens Open File; if False, it opens Save.
1 ; parameter indicates the variable where the filename will be stored or
loaded in case the method returns True. This parameter must necessarily be a
variable. !% parameter is optional, and informs the default file extension to
be attached to the file in the inbox, whenever the extension is not informed. In case
it is empty, no extension will be linked to the end of the filename.
1 . parameter is optional, and defines dialog box’s behavior. It is an integer, the
sum of the numbers in the table below. 1 parameter is optional, and defines a set
of pairs of strings that specify filters to be applied to the files. The first string
describes the filter, and the second indicates the type of extension used. Multiple
extensions can be specified by using the character ‘;’ as limit. The string must end
with ‘||’.

118 Methods
E3 - Scripts - Reference Manual

Possible combinations for Flags parameter


VALUE DESCRIPTION
9 CREATEPROMPT: If the user specifies a non-existent file, this
flag causes the dialog box to prompt them for permission to create
the file. If they choose to create the file, the dialog box closes and
the function returns the specified name; otherwise, the box remain
open.
: FILEMUSTEXIST: Specifies that the user can type only names
of existing files in the File Name entry field. Otherwise, the dialog
box displays a warning in the message box.
I NOCHANGEDIR: Restores the current directory to its original
value if the user changed the directory while searching for files. It
is ineffective for Windows NT4/2000/XP when opening files.
K NODEREFERENCELINKS: Directs the dialog box to return
the path and file name of the selected shortcut (.lnk) file. If this
value is not specified, the dialog box returns the path and file
name of the file referenced by the shortcut.
9 NOREADONLYRETURN: Specifies that the returned file does
not have the Read Only checkbox selected and is not in a write-
protected directory.
F: PATHMUSTEXIST: Specifies that the user can type only valid
path and file names, otherwise a message box displays a warning.
I READONLY: Causes the Read Only checkbox to be selected
initially when the dialog box is created.
9:K OVERWRITEPROMPT: Causes the Save As dialog box to
generate a message box informing of file existence, and asking for
confirmation to overwrite the file.

Example of filter:
"Arquivos de Chart (*.xlc)|*.xlc|Planilhas Excel
(*.xls)|*.xls|Arquivos de Dados (*.xlc;*.xls)|*.xlc;
*.xls|Todos os arquivos (*.*)|*.*||"

ShowPickColor(ColorValue, Color, Left, Top)


Open "Colors" dialog box to choose a color. The chosen color' s decimal value is
returned by 8 , parameter. parameter indicates a previously selected
color from color palette. If this parameter is not informed, it will be 0 (black). The
dialog box position can be set through the and - 'parameters, which indicate
respectively its distance to the left and the top of the Screen, in pixels. If these
parameters are not informed, the dialog box remains centralized.

Methods 119
E3 - Scripts - Reference Manual

Example:
Sub CommandButton_Click()
Dim newColor
Dim defaultColor
defaultColor = 65280 'light green
If Application.ShowPickColor(newColor,defaultColor,90,90) Then
Screen.Item("Rectangle1").ForegroundColor = newColor
Screen.Item("Text1").Value = newColor
End If
End Sub

Stopsound()
Stop a sound playing.
Example:
Sub CommandButton2_Click()
Application.Stopsound()
End Sub

ToggleValue(TagName, ValA, ValB)


ToggleValue() method searches an object/property value running in the server and
compares it with 8 0 and 8 parameters. If searched value is equal to 8 ,
object/property specified in - .; will receive 8 0value. Otherwise, it will
receive 8 value. In case TagName value is neither 8 0nor 8 , ToggleValue()
method will assigns the value specified in 8 0. Example:
Sub Button1_Click()
' When clicking the Button, it assigns the value
' of a tag running in a DataServer
' Assigns value 20 to the tag
Application.SetValue "DataServer1.InternalTag1", 20
' AS InternalTag1 value is already 20,
' ToggleValue method will turn the value to 30
Application.ToggleValue "DataServer1.InternalTag1", 30, 20
End Sub

TrackEvent(EventMessage, Comment, TimeStamp)


This event allows generating events via scripts manually. These events can be
generated either in the Viewer or in the Server, and are registered in one of the
application’s database table.

120 Methods
E3 - Scripts - Reference Manual

TrackEvent method parameters


NAME DESCRIPTION
!& . Contains the event’s message (up to 200 characters).
(Optional) Contains additional comments about the event
(up to 200 characters).
- ' (Optional) Indicates date/time the event occurred. If not
specified, E3 assumes current date/time.

TrackEvent method will only record events in case the option “Events Recording” at
Domain Options is enabled. The events are recorded in a database’s table which is
also defined in the configurations of Events Recording. For further information on
Domain Events Recording, see User’s Manual.
Example:
Sub Button1_Click()
Dim Tag, User, Comment
Set Tag = Application.GetObject("IO.Inputs.I001")
If Application.ESign(Tag.PathName,, "Value Change",_
Tag.Value, 1, User, Comment) Then
If Tag.WriteEx 1 Then
Application.TrackEvent
"Tag IO.Inputs.I001 changed to 1 " &_
"by user" & User, Comment
End If
End If
End Sub

UserAdministration()
This method opens a box that allows editing E3 Server user list. Functions available
are:
• showing the list of all users;
• deleting users (it is not possible to delete the current user);
• adding and editing users;
• editing user settings;
• changing user password;
• changing other user data (login, name etc.).
IMPORTANT: Only the Administrator can have access to the UserAdministration
method. User settings box is only accessible to the user enabled as "Administrator".
Administrator user can not exclude himself and can not set his type to " non-
administrator".

Methods 121
E3 - Scripts - Reference Manual

Example:
Sub Text1_Click()
Application.UserAdministration()
End Sub

. $ ,
SetDBParameters(ServerName, UserName, Password, DBName)
String for connection to DB in the properties of the object Database. The parameter
&; determines the name of the server. The parameter 6 ;
determines the name of the user. The parameter + determines the password
of the login to connect to the database. The parameter = ; is used only for
SQL; it is the name of the database used in the SQL server.

. . '

. . '

Ack(bstrActorID)
Acknowledges an alarm configured in the object Alarm Source. This method returns
a Boolean indicating whether the operation has been successful or not.
" 0$ = parameter informs the name of the user responsible for alarm
acknowledgement.

GetAlarm()
Returns an object that grants you access to each type of alarm’s specific settings.
This allows you to check or modify any alarm’s properties in runtime. Depending on
the type of alarm, the method will return the following properties:

122 Methods
E3 - Scripts - Reference Manual

Digital Alarm: Responsible for digital alarm settings.

Digital Alarm Properties


ITEM DESCRIPTION
=. , .- % Digital alarm returning message

=. Enable/Disable digital alarm checking

=. Digital alarm limit.

=. .- % Digital alarm message text

=. & 4 Digital alarm severity. Set of values: 0 = High,


1 = Medium; 2 = Low
=. 0$
( Q, + Acknowledgement requirement by type of alarm
(digital).

Analog Alarm: Responsible for the definition of levels alarm. Object’s properties (4
alarm levels):

Analog Alarm Properties


ITEM DESCRIPTION
&= + + Dead band for alarm level..
& , .- % AlarmReturnMessage

ITEM DESCRIPTION
Enable/Disable LoLo alarm checking.
LoLo alarm limit
.- % LoLo alarm message text
& 4 LoLo alarm severity. Set of values: 0 - High, 1 -
Medium, 2 - Low
0$
( Q, + Acknowledgement requirement by this alarm
level (LoLo).

ITEM DESCRIPTION
Enable/Disable the Lo alarm checking.
Lo alarm limit.
.- % Lo alarm message text
& 4 Lo alarm severity. Set of values: 0 - High, 1 -
Medium, 2 – Low
0$
( Q, + Acknowledgement requirement by this alarm
level (Lo).

Methods 123
E3 - Scripts - Reference Manual

ITEM DESCRIPTION
E Enable/Disable the High alarm checking.
E Hi alarm limit.
E .- % Hi alarm message text
E & 4 Hi alarm severity. Set of values: 0 - High, 1 -
Medium, 2 – Low
E0$
( Q, + Acknowledgement requirement by this alarm
level (Hi).
HIHI ALARM
ITEM DESCRIPTION
EE Enable/Disable the HiHi alarm checking.

EE HiHi alarm limit.


EE .- % HiHi alarm message text
EE & 4 HiHi alarm severity. Set of values: 0 - High, 1 -
Medium, 2 - Low
EE0$
( Q, + Acknowledgement requirement by this alarm
level (HiHi).

Rate of Change Alarm: Responsible for change rate alarm settings.

Rate of Change Alarm properties


ITEM DESCRIPTION
, .- % Rate of Change return message.
Enable/Disable Rate of Change checking.
Rate of Change alarm limit. For the alarm
to occur, it is enough that the value of the
associated tag exceed this value in one
second.
.- % Rate of Change alarm message text.

& 4 Rate of Change alarm severity. Set of


values: 0 - High, 1 - Medium, 2 – Low.
0$
( Q, + Acknowledgement requirement by type of
alarm (rate of change).

124 Methods
E3 - Scripts - Reference Manual

Dead Band Alarm: Responsible for dead band alarm settings.

Dead Band Alarm Properties


ITEM DESCRIPTION
= + + Alarm Dead Band limit. Every time the
value of the associated tag exceeds the value
of this property + or - the DeadBandLimit
value, the alarm will occur.
= + + , .- % Dead band alarm return message

= + + Enables/Disables dead band alarm checking

= + + Dead band alarm limit

= + + .- % Dead band alarm message text

= + + & 4 Severity of dead band alarm.. Set of values:


0 - High, 1 - Medium, 2 - Low
= + +0$
( Q, + Acknowledgement requirement by type of
alarm (dead band).

Example:
Sub Button1_Click()
Dim val
'When clicking the button, AlarmSource BatteryLevel
'Lo alarm level is changed
Application.GetObject("ConfigAlarms1.Area1.BatteryLevel")_
.GetAlarm().LoLimit = 10.2
End Sub

NOTE: the specific properties from each alarm source type can be accessed directly
via scripts or links, as well as visualized in the object’s Property List, making their
edition via GetAlarm() method not mandatory anymore.

. . '

AckAllAlarms(bstrActorID)
Acknowledges all alarms in the server, regardless of their area. This method returns
a Boolean indicating whether the operation has been successful or not.
" 0$ = parameter informs the name of the user responsible for alarm
acknowledgement.

Methods 125
E3 - Scripts - Reference Manual

Example:
Sub Button1_Click()
'When clicking the button, it acknowledges all alarms
Application.GetObject("AlarmServer1")._
AckAllAlarms (Application.User)
End Sub

AckArea(bstrArea, bstrActorID)
Acknowledges the alarms in a given area. This method returns a Boolean indicating
whether the operation has been successful or not.
" 0 parameters specifies the name of the area(s) whose alarms will be
acknowledged, by matching the beginning of their names. For example,
AckArea("ANA") acknowledges alarms in areas named "ANALOG",
"ANA.AREA2", etc. If this parameter is empty, the method will behave like
AckAllAlarms(). " 0$ =parameter informs the name of the user responsible for
alarm acknowledgement.
Example:
Sub Button1_Click()
'When clicking the button, it acknowledges Area1 alarms
Application.GetObject("AlarmServer1")._
AckArea "Area1", Application.User
End Sub

126 Methods
E3 - Scripts - Reference Manual

LogTrackingEvent(Message, ActorID, Area, Severity, EventTime,


Source, EventCategory, [EventType], [UserFields])
Simulates an event/alarm and sends it straight to Alarm Server’s database, with no
stops at E3Alarm. This is why this event cannot be seen at E3Alarm, nor can the
alarm be acknowledged.
The method’s parameters allow you to specify the value of the field with the same
name in the event. The parameters are:

LogTrackingEvent method parameters


NAME DESCRIPTION
Text parameter with the content of
. . field. If
omitted, it assumes “”.
0$ = Text parameter with the content of 0$ = field. If
omitted, it assumes “System”.
0 Text parameter with the content of 0 field. If omitted, it
assumes “”.
& 4 Numeric parameter informing event severity. If omitted, it
assumes 0 (high severity).
!& - Numeric parameter informing event’s timestamp. If
omitted, it assumes the timestamp of the moment of method
call.
,$ Text parameter with the content of ,$ field. If omitted,
it assumes “”.
!& . 4 Text parameter with the content of !& . 4field. If
omitted, it assumes “”.
!& -4' Text parameter with the content of !& -4 ' field. If
omitted, it assumes “Tracking”.
6 1 + Four- (or more) position array; each position specifies the
user-customized field value.

The other event fields cannot be specified and always assume the following values:
• CurrentValue = 0.0
• Quality = ""
• ConditionActive = 0 (False)
• ConditionName = ""
• SubConditionName = ""
• Acked = 1 (True)
• AckRequired = 0 (False)
• Enabled = 1 (True)
• EventTimeUTC = *Always equal to EventTime (just like in alarm
events)
• ChangeMask = 0
• Cookie = 0
Methods 127
E3 - Scripts - Reference Manual

NOTE: The method fails if the AlarmServer option & 2


+ " is False, or when the database “store” command fails.
Example:
Sub CommandButton1_Click()
'In parameter UserFields, the element value will be shown
'for each element
Application.GetObject("AlarmServer1").LogTrackingEvent_
"Button clicking", Application.User, "Operation", 2, ,_
"Button1", , , array(1, 2, "a", "b")
End Sub

. / =
StartAcquisition()
Enables the Historic to record values from its fields periodically, from the rate
specified in ScanTime property. This method can be called at any time after
StopAcquisition() method has been called. This method’s default value is “enabled”
every time the application starts; that is, this method always runs internally when
Historic starts.
Example:
Sub Button1_Click()
'When the button is clicked, Historic is enabled
Application.GetObject("Hist1").StartAcquisition()
End Sub

StopAcquisition()
Disables registers record per period at Historic, regardless of the value specified in
ScanTime property. Record per period is disabled until StartAcquisition() method is
called. Historic’s default behavior is to start the application with this record enabled.
Example:
Sub Hist1_OnStopAcquisition()
'Disable Historic as soon as it starts.
StopAcquisition()
End Sub

128 Methods
E3 - Scripts - Reference Manual

WriteRecord()
Inserts a new information line into the database. The values are obtained from the
current values of each variable specified as a data source of history fields. This
method is commonly used in two cases:
• To record a new data line before the time scheduled for the next
recording when the Historic is enabled per time.
• To record a new data set when the Historic is disabled.
Example:
Sub Tag1_OnValueChange()
'Records a new line in a Historic
'when a tag changes its value
Application.GetObject("Hist1").WriteRecord()
End Sub

. 0 !
CreateNewSession([DefaultType], [DefaultMinRecTime],
[DefaultMaxRecTime], [DefaultDeadBand], [DefaultUnit])
Creates a new session that can include data from an E3Storage regardless of the
ordinary acquisition. The optional parameters are used to configure tags in the
session, in case they are not informed when created. They are, respectively:
datatype, minimum interval between records, maximum interval with no records,
deadband, and tag’s deadband unit.
How to use it:
Creating a session:
set Session =
Application.GetObject("Storage1").CreateNewSession(0, 0, 3600,
10, 1)
Adding a tag to the session (AddField(FieldName, [Type], [MinRecTime],
[MaxRecTime], [DeadBand], [Unit]) method):
result = session.AddField("TempTag", 0, 0, 100000, 15, 1)
Adding values (AddValue(FieldName, TimeStamp, Quality, Value) method):
result = session.AddValue("TempTag", Now, 192, 10)

StartAcquisition()
Starts or resumes the generation of data going to the database. Storage is notified on
which registered tags are modified, and when it happens it checks whether the
registers will be recorded. When this method is called, both change notification and
recording generation either start or resume.
Example:
Sub Botao1_Click()
Methods 129
E3 - Scripts - Reference Manual

'when clicking the button, Storage is enabled


Application.GetObject("Storage1").StartAcquisition()
End Sub

StopAcquisition()
Stops the generation of data going to the database. Storage is notified on which
registered tags are modified, and when it happens it checks whether the registers will
be recorded. When this method is called, both change notification and recording
generation stop.
Example:
Sub Storage1_OnStopAcquisition()
'Disables Storage as soon as it starts.
StopAcquisition()
End Sub

. 6 )"+ 2
ClearFields()
Clears column and row formatting at E3Browser. Example:
Sub CommandButton1_Click()
Screen.Item("E3Browser1").ClearFields()
End Sub

GetColumnValue(iIndex)
Returns the value of a cell, in the informed column and selected line. This method
has the + %parameter, determining the index of the column desired.
Example:
Sub E3Browser1_DblClick()
Screen.Item("Text1").Value = GetColumnValue(0)
Screen.Item("Text2").Value = GetColumnValue(1)
Screen.Item("Text3").Value = GetColumnValue(2)
Screen.Item("Text4").Value = GetColumnValue(3)
End Sub

130 Methods
E3 - Scripts - Reference Manual

Requery()
Requery() method update the query by using the current query settings, returning the
data to E3Browser.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Browser1").Requery()
End Sub

RetrieveE3QueryFields()
RetrieveE3QueryFields() method reads query data structure and updated E3Browser
formatting with the fields defined in the query. If it is successful, it returns True.
Otherwise, it returns False. This method is especially useful when one must use one
single E3Browser to show data from different tables or queries.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Browser1").RetrieveE3QueryFields()
End Sub

Methods 131
E3 - Scripts - Reference Manual

. 7 )"; -
AddField(Name, [Table])
AddFields() method add a new field into the query table. ; parameter
determines new field name to be added to the query. This field will be setup with the
first table recorded into the query. This method was developed only to keep
compatibility to E3Chart old query object. - " parameter represents the name of
the table where the field belongs. This parameter searches in the table, and returns a
Boolean indicating whether the operation has been successful or not. Example:
Sub Button1_Click()
Screen.Item("E3Browser").Item("Query").AddField "Field1"
End Sub

AddStorageTag(Name, fieldType)
Adds a tag from the Storage to be queried to the query. ; parameter gets the
name of the tag to be added. +-4 ' parameter indicates the tag type (M - double,
9 - bit, : - string). Returns a Boolean indicating whether the operation has been
successful or not.

AddTable(Name)
Receives the name of the table to be included in the query list. ; parameter
determines new table name to be added to the query.

Execute(ImediateExecute)
Execute() method executes an SQL command that does not have a return (such as
DELETE, UPDATE or INSERT), setup in SQLQuery. + !%$ , parameter
indicates whether the operation will pass through DB operation rows (e3i and e3o
files) before it reaches the database (if False), or it will be sent directly to the
database (if True). The advantage of using a query to execute commands is the use
of variables, such as in a simple query. Example of SQL commands:
DELETE FORM test WHERE cod > 10
UPDATE test SET cod = 10 WHERE cod > 10
INSERT INTO test (cod) VALUES(10)
Example:
Sub CommandButton1_Click()
Screen.Item("Query1").Execute
End Sub

GetAsyncADORecordSet()

132 Methods
E3 - Scripts - Reference Manual

Creates a query and, when it finishes, generates the object’s OnAsyncQueryFinish()


event, passing the recordset generated by the query to this event.

GetADORecordSet()
GetADORecordSet() method returns a recordset of ADO (ActiveX Data Object) type
resulting from the execution of the query setup.
Example:
Sub Button1_Click()
Set rec = Screen.Item("Query1").GetADORecordset()
strDates = " "
i = 0
while (not rec.EOF and i < 10)
strDates = strData & CStr(rec("E3TimeStamp")) & _
Chr(10) & Chr(13)
i=i+1
Wend
MsgBox strDates
End Sub

GetE3QueryFields()
GetE3QueryFields() method returns a collection of the query fields. The fields have
properties that can be modified, as follows:

Query fields properties


NAME TYPE DESCRIPTION
, ; Text Column name. This name must exist in the tables
added to the query.
-" ; Text Associated table name. The table should be
added in the query settings.
0 Text Alias of the column in the query.
Text Query criteria on the column.
+ 4 Text Column ordering. The valid values are: “ASC”
(ascending order), “DESC” (descending order)
and “” (none). Any other value indicates that the
column has no order.
+ ;, " Number Column order number in the query order. Values
must be greater than 0 (zero) if the column has
an order. The value will be equal or less than the
total of query order fields.

1, $ Text Function that the column can be passed as a


parameter.
,' 4 Boolean If True, the column is an element of a group.
Methods 133
E3 - Scripts - Reference Manual

8 " Boolean If True, the column is visible.

Example:
Sub CommandButton1_Click()
Set Fields = Screen.Item("E3Browser")._
Item("Query").GetE3QueryFields()
Fields.Item(0)
End Sub

NOTE: To use this method, the query must be previously created in the
development time.

RemoveField(FieldName, [Table])
RemoveField() method removes a field previously included in a query into Query
object. 1 +; parameter determines the field name to be removed from query.
This method, just like AddField() method, was included in order to keep the
compatibility to E3Chart query old versionsThis parameter searches in the table, and
returns a Boolean indicating whether the operation has been successful or not. - "
parameter represents the name of the table where the field belongs.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Browser").Item("Query")._
RemoveField "Field1"
End Sub

RemoveStorageTag(Name)
Removes a tag previously configured in the query. ; parameter indicates tag’s
name. Returns a Boolean indicating whether the operation has been successful or
not.

RemoveTable(TableName)
Receives table name, and removes all its fields configured in this query. - " ;
parameter determines the name of the table to be removed from the query.

SetVariableValue(bstrVarName, vValue)
SetVariableValue() method adjust the value of a variable setup in the query, so that
this value can be informed as a filter or parameter before being performed. It must
be defined the variable name (" 8 ; ) and the value (&8 , ), which can be
a number, a text or a date/time.

134 Methods
E3 - Scripts - Reference Manual

Example:
Sub CommandButton_Click()
Set cons = Screen.Item("E3Browser1").Item("Query1")
InitialDate = now -1
FinalDate = now
cons.SetVariableValue "IniData",InitialDate
cons.SetVariableValue "EndDate",FinalDate
End Sub

. < )"
CopyConfig(SourceChart)
CopyConfig() method copies the settings from an E3Chart to another. ,$ 2
parameter indicates the origin E3Chart whose properties will be copied to the
E3Chart calling CopyConfig() method.
Example: Considering copy settings from an E3Chart on a Screen (in this example,
ScreenChart) to another one within a report (ReportChart). In this case, the script
must be added in the E3Report object associated to the report:
Sub OnBeforePrint
Set Chart =_
Report.Sections("PageHeader").Controls("ReportChart")
Chart.CopyConfig_
(Application.GetFrame().Screen.Item("ScreenChart"),0)
Chart.LoadData()
Chart.FitAll()
End Sub

Note: this method also has the optional parameter 1 ., which is not used, and
was only kept for purposes of compatibility with earlier versions.

Methods 135
E3 - Scripts - Reference Manual

FitAll([FitStyle])
Fit all pens into E3Chart. Optional parameter 1 4 indicates how pens will fit in
runtime: M fits both axes at the same time; 9 fits just the vertical axis; and : fits just
the horizontal axis.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").FitAll()
End Sub

FitPen(Pen, [FitStyle])
Fit a pen into the E3Chart specified by the index or name. parameter defines the
pen to be fit in the E3Chart (pen index or name). Optional parameter 1 4
indicates how pens will fit in runtime: M fits both axes at the same time; 9 fits just
the vertical axis; and : fits just the horizontal axis.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Chart.FitPen(1)
Chart.FitPen("Pen1",1)
'Fits Pen1 just vertically
End Sub

Legend()
Return an E3Chart legend object.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Legend.Showbackground = False
End Sub

LoadData()
Load data into the E3Chart. This method is specially used to load data before
printing, when used in E3Reports.
Example:
Sub CommandButton1_Click()
MsgBox Screen.Item("E3Chart1").LoadData()
End Sub

136 Methods
E3 - Scripts - Reference Manual

ResetConfig()
Remove all settings setup in an E3Chart, turning it back to its original status.
Example:
Sub E3Chart1_OnStartRunning()
' When starting E3Chart1, remove all settings
ResetConfig()
End Sub

Note: this method also has the optional parameter 1 ., which is not used, and
was only kept for purposes of compatibility with earlier versions.

ZoomIn()
ZoomIn() method increases zoom in the E3Chart, i.e., it closes pens viewing. In
runtime, this feature can be accessed by right clicking the mouse on the object and
selecting the options Zoom In from the context menu.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").ZoomIn()
End Sub

ZoomOut()
ZoomOut() method decreases zoom in the E3Chart, i.e., it separates pens viewing in
E3Chart. In runtime, this feature can be accessed by right clicking the mouse on the
E3Chart and selecting the option Zoom Out.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").ZoomOut()
End Sub

. <

Note: HorAxis and VerAxis are axes properties that access default horizontal
and vertical axis, respectively. For example, instead of typing
Chart.Axes.Item("HorizontalAxis"), you can type Chart.Item.HorAxis.
Further user-generated axes will have their own names, depending on the case.

Methods 137
E3 - Scripts - Reference Manual

GetHistoricPeriod(Begin,End)
Return the time interval shown in the historic scale. . parameter indicates the
historic scale initial date, and ! + indicates the final date.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart")
Chart.Axes.Item("AxisName").GetHistoricPeriod min, max
Value = cstr(dmin) & " "& cstr(dmax)
MsgBox "initial date = " & cstr(min) & _
vbNewLine & " final_ date =" & cstr(max)
End Sub

GetMinMax(Min,Max)
Return the numeric scale minimum and maximum values in the and %
parameters.
Example:
Sub CommandButton1_DBClick()
Set Chart = Screen.Item("E3Chart")
Chart.Axes.Item("AxisName").GetMinMax dmin, dmax
Msgbox cstr(dmin) & " " & cstr(max)
End Sub

GetRealTimePeriod(Times, TimeUnit)
Return the value and time unit setup in the real-time scale. The value is determined
by - parameter and the time unit by - 6 . Time units available in
- 6 parameter are the following:

Available options for TimeUnit parameter


OPTION DESCRIPTION
MR , $ + Unit of seconds.
9R , , Unit of minutes.
: R ,2 , Unit of hours.
F R ,+ 4 Unit of days.
IR ( Unit of weeks.
LR 2 Unit of months.
R ,4 Unit of years.

138 Methods
E3 - Scripts - Reference Manual

Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Unitvalue = _
Chart.Axes.Item("AxisName").GetRealTimePeriod(dmin)
Msgbox "value" & cstr(dmin) & "unit" & cstr(unitvalue)
End Sub

GetTickSpacing(TickSpacing, TimeUnit)
Return the spacing between ticks and the unit setup. -$ ( ' $ . parameter
determines the spacing between the ticks (scale subdivisions) and TimeUnit
determines the unit. When this parameter is in zero, it means it is automatic. The
unit is not used when scale is numeric.
Options available in - 6 parameter are the same showed in
GetRealTimePeriod() method table.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Unitvalue = _
Chart.Axes.Item("AxisName").GetTickSpacing(TickSpacing)
Msgbox "value" = " & cstr(TickSpacing) & _
"unit" & cstr(unitvalue)
End Sub

SetHistoricPeriod(Begin, End)
Setup the period for the history scale. . parameter determines the scale initial
period and ! + determines the scale final period.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart2")
Chart.Axes.Item("AxisName").ScaleType = 2
' shows the last period
Chart.Axes.Item("AxisName").SetHistoricPeriod now -1, now
End Sub

Methods 139
E3 - Scripts - Reference Manual

SetMinMax(Min, Max)
Setup the minimum and the maximum value of the numeric scale. The minimum
value is determined by parameter and the maximum value by %. Example:
Sub Circle1_Click()
Set Chart = Screen.Item("E3Chart2")
Chart.Axes.Item("AxisName").SetMinMax -10, 500
End Sub

SetRealTimePeriod(Times, TimeUnit)
Set the time period in the unit defined by TimeUnit parameter. Options available in
this - 6 parameter are the same showed in the table of the
GetRealTimePeriod() method. - parameter determines the time period and the
scale unit is specified by - 6 . In this mode (real-time) the Axis is updated all
the time.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart5")
'tuSecond = 0, tuMinutes =1, tuHours = 2, tuDays = 3,
'tuWeeks = 4, tuMonths = 5,tuYears = 6
'2 minutes
Chart.Axes.Item("AxisName").SetRealTimePeriod 2,1
Chart.Axes.Item("AxisName").SetTickSpacing 30,0
End Sub

SetTickSpacing(TickSpacing, TimeUnit)
Setup the spacing between ticks (scale subdivisions) by using the unit. Spacing
between ticks is determined by -$ ( ' $ . parameter. - 6 parameter
determines the unit. In case the scale is numeric, the unit is not considered. Options
available in - 6 parameter are the same showed in GetRealTimePeriod()
method table.
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
'10 (in case the scale is numeric,
'unit value is not considered)
Chart.Axes.Item("AxisName").SetTickSpacing 10,0
Chart.Axes.Item("AxisName").SetTickSpacing 20,0
End Sub

140 Methods
E3 - Scripts - Reference Manual

. <

AddAxis(AxisName)
Adds a new axis with the name specified in parameter 0% ; and returns the
created axis. In the case of trying to create an axis with an existing name, an error
message will be shown. To generate a name automatically, simply put a blank name
in the parameter 0% ; .
Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Set newAxis = Chart.Axes.AddAxis("")
newAxis.Color = RGB(255,0,0)
End Sub

Remove(Index)
Removes the axis by its name or index, as specified in + %parameter. Main axes
0 and 1 can not be removed. In case one try to remove them, an error message will
be shown.
Examples:
Sub CommandButton1_Click()
'This example removes all additional axes
Set Chart = Screen.Item("E3Chart")
While (Chart.Axes.Count>2)
Chart.Axes.Remove(2)
Wend
End Sub

Sub CommandButton1_Click()
'Remove an additional axis, in case it exists
set Chart=Screen.Item("E3Chart1")
Chart.Axes.Remove(2)
End Sub

Methods 141
E3 - Scripts - Reference Manual

. <"

AddPoint()
Adds a point at the end of the real-time buffer. So, the number of points that can be
added depends on this buffer’s size (pen’s BufferSize property). Buffer size is only
valid after pen’s Connect() method. This method must be used with a real-time pen,
and with UseTimeStamp property set to False.

Clear()
Erases data from real-time buffer, with no decrease in its size. This method does not
disconnect links, nor does it remove historical data.

Connect()
Connect() method connects the pen to the server in order to receive data in real-time,
associating the XField and YField properties. If the pen is already connected, the
method is not used.
Example:
Sub CommandButton1_Click()
Set Pen1 = Screen.Item("E3Chart1").Pens.Item("Pen1")
Pen1.Disconnect()
Pen1.Connect()
End Sub

Disconnect()
Disconnect() method clean up the current data and prevent pen of receiving more
real-time data from its associated tag. If the pen is already disconnected, the function
does nothing. It can be used to change a tag in execution mode. When Disconnect()
is used with a mixed pen (DataSourceType=2), the method removes the real-time
part, and keeps the historic part. In runtime, the method Connect() must be called to
show the real-time data again.
Example:
Sub CommandButton1_Click()
Set Pen1 = Screen.Item("E3Chart1").Pens.Item("Pen1")
Pen1.Disconnect()
Pen1.Connect()
End Sub

GetCursorPos(X,Y)
Return to the position the cursor intercepted the pen in the E3Chart. This method has
the D and G parameters, corresponding to x and y cursor positions. If the method is
successful, it returns True, otherwise it returns False.

142 Methods
E3 - Scripts - Reference Manual

Example:
Sub CommandButton1_Click()
For each pen in Chart.Pens
If pen.GetCursorPos(aa,bb) Then
strResult = strResult&pen.name&”:=”&CSTr(CDate(aa))+_
"y" + cstr(bb) + vbnewline
End If
Next
MsgBox strResult
End Sub

. <$

NOTE: E3Chart pens collection must be accessed through Pens property.

AddPen(pen)
AddPen() method add a new pen to the E3Chart, returning the pen created.
Examples:
Sub CommandButton1_Click()
'Create a name to the pen added.
Set Pen = Screen.Item("E3Chart1").Pens.AddPen("")
MsgBox Pen.Name
End Sub

SubCommandButton1_DbClick()
'Give a pen the name "Pen1".
'If the name exists, the pen is added.
Set Pen = Screen.Item("E3Chart1").Pens.AddPen("Pen1")
MsgBox Pen.Name
End Sub

Methods 143
E3 - Scripts - Reference Manual

Sub CommandButton2_Click()
'Create a pen and associate it to TagDemo1.
Set Chart = Screen.Item("E3Chart1")
Set Pen = Chart.Pens.AddPen("")
MsgBox Pen.Name
Pen.UsetimeStamp = true
Pen.YLink = "Data.TagDemo1"
Pen.Connect()
End Sub

ChangePenPos(Source, Dest)
Modify the drawing position of pens in E3Chart. This function is especially useful
when the pen has the shape of lines and another one has areas shape, for example. In
this case, depending on the drawing order, it can be impossible viewing all pens if
the area pen is in from of the line pen. This method has the following parameters:
,$ determines the index of the pen to be moved (starting from 1) and = ,
determines the pen destination (starting from 1).
Example:
Sub CommandButton1_Click()
'Move Pen 1 to the second position
Screen.Item("E3Chart1").Pens.ChangePenPos(1,2)
End Sub

Item(index)
Item() method turns pen object back to pens collection, specified by the index. This
method has the + %parameter that can be of numeric type if corresponding to the
pen index, or text if corresponding to the pen name.
Example:
Sub CommandButton1_Click()
'Obtains the first pen
Set Pen1 = Screen.Item("E3Chart1").Pens.Item(0)
End Sub

Remove(Name)
Remove() method removes a pen through the specified name. This method has a
Name parameter determining the name of the pen to be removed.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Pens.Remove(1)
End Sub

144 Methods
E3 - Scripts - Reference Manual

. <. 4 !
In the legend, many columns can be selected. Each column show a type of
information and has a corresponding name and a value. Following we have a
description table of the possible columns in the legend.

Available options for column identification


OPTION DESCRIPTION
M> ; Column showing the pen name.
9> - .D Column showing the name of the tagX associated to the pen.
:> - .G Column showing the name of the tagY associated to the pen.
F> - .D8 , Column showing the value of the tagX associated to the pen. This
value is showed when the graphic is in Search mode.
I> - .G8 , Column showing the value of the tagY associated to the pen. This
value is showed when the graphic is in Search mode.
L> = $ ' Column showing pen DocString property.
> Column showing the pen column.
O> , Column showing the pen status.
K> $ D Column showing the name of the scale associated to the tagX.
P> $ G Column showing the name of the scale associated to the tagY.

ChangeColumnPos(Source, Dest)
Change the position of a column. This method has the following parameters: ,$
is the index of the column to be moved to = , and = is the index of the column
to be moved to ,$.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Legend.ChangeColumnPos 1,2
End Sub

Count()
Return the number of columns of the legend.
Example:
Sub CommandButton1_Click()
MsgBox Screen.Item("E3Chart1").Legend.Count()
End Sub

InsertColumn(Col, Index)
Insert a new column in the legend. This method has the following parameters:
identifies the column to be inserted (see the columns identification table) and + %
determines the position in which the column will be inserted.

Methods 145
E3 - Scripts - Reference Manual

Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Legend.InsertColumn 1,2
End Sub

Sub CommandButton1_Click()
Screen.Item("E3Chart1").Legend.InsertColumn "Color",2
End Sub

Item(Col)
Return a legend column by name or index. parameter determines the column
index or name. In order to see the column name, see the column identification table.
Example:
Sub CommandButton1_Click()
MsgBox Screen.Item("E3Chart1").Legend.Item(1)
End Sub

RemoveColumn(Col)
Remove the columns. This method has a parameter determining the column to
be removed. See the columns identification table.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Legend.RemoveColumn (1)
End Sub

. </ ;
The following methods are used to handle Queries collection.

AddQuery(QueryName)
Add a query to E3Chart queries collection. This method has H, 4
; parameter
determining the query name that is being added.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Queries.AddQuery("Query1")
End Sub

Item(index)
Setup or return a query collection by name or index. This method has an + %
parameter that is mandatory and assumes the following behavior: if it is numeric, it

146 Methods
E3 - Scripts - Reference Manual

corresponds to the query index in the queries collection; if it is text, it corresponds to


the query name.
Example:
Sub CommandButton1_Click()
Set query = Screen.Item("E3Chart1").Queries.Item(0)
End Sub

Remove(Index)
Return the query object specified by name or index. This method has an + %
parameter corresponding to the query name to be removed.
Example:
Sub CommandButton1_Click()
Screen.Item("E3Chart1").Queries.RemoveQuery(0)
End Sub

UpdateData()
Update the data of all queries.
Example:
Sub Text1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
E3Chart1.Queries.UpdateData
End Sub

. 1 '
CreateUnit(bstrUnitName)
Create a unit in formulas database and returns if the operation performance was
achieved. This method has a " 6 ; parameter determining the name of the
formula to be created. This method returns True if the operation performance was
achieved; otherwise, it returns False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it creates a new Unit
Application.GetObject("Formula1").CreateUnit("Unit2")
End Sub

Methods 147
E3 - Scripts - Reference Manual

CreateValue(bstrValueName)
Create a values set in formulas database and returns if the operation performance
was achieved. This method has a " 8 , ; parameter determining the name
of the set to be created. This method returns True if the operation performance was
achieved; otherwise, it returns False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it creates a new Value
Application.GetObject("Formula1").CreateValue("Template5")
End Sub

DeleteUnit(bstrUnitName)
Delete a unit in formulas database and returns if the operation performance was
achieved. This method has a " 6 ; parameter informing the name of the
unit to be deleted. The method returns True if the operation performance was
achieved; otherwise, it returns False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it deletes the unit
Application.GetObject("Formula1").DeleteUnit("Unit2")
End Sub

DeleteValue(bstrValueName)
Delete a values set in formulas database and returns if the operation performance
was achieved. This method has a " 8 , ; parameter informing the values
set to be deleted. The method returns True if the operation performance was
achieved; otherwise, it returns False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it deletes a values set
Application.GetObject("Formula1").DeleteValue("Template5")
End Sub

FindUnit(bstrUnitName)
Check whether given unit exists in formulas database. This method has a
" 6 ; parameter determining the name of the unit to be found. The method
returns True if the operation performance was achieved; otherwise, it returns False.

148 Methods
E3 - Scripts - Reference Manual

Example:
Sub Button1_Click()
Dim val
'When clicking the button, it shows a MessageBox
'with the result
MsgBox (Application.GetObject("Formula1")._
FindUnit("Unit2"))
End Sub

FindValue(bstrValueName)
Check whether given values set exist in formulas database. This method has a
" 8 ,; parameter informing the name of the set to be checked. The
method returns True if the operation performance was achieved; otherwise, it returns
False.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it shows a MessageBox
'with the result
MsgBox CStr(Application.GetObject("Formula1")._
FindValue("Template5"))
End Sub

GetUnitData(bstrValueName, bstrTemplateName, pVal)


This method loads to a variable the name of the tag identified to certain template in
given unit and returns if the operation performance was achieved. This method has
the following parameters: " 6 ; , informing the unit name,
" - ' ; informing the template name of the tag associated in
" 6 ; and '8 , determining the name of the variable that will receive the
tag name.
Example:
Sub Button1_Click()
Dim qualTag, qualFormula
Application.GetObject("Formula1").GetUnitData_
"Unit1", "Template2", var1
End Sub

GetValueData(bstrValueName, bstrTemplateName, pVal)


This method loads to a variable the value of certain template defined to certain
values set, returning if the operation was achieved. This method has the following
parameters: " 8 , ; , informing the values set name, " - ' ;
Methods 149
E3 - Scripts - Reference Manual

determining the name of the template in which the value associated in


" 8 ,; , and '8 , informing the name of the template which has the value
associated in " 8 , ; .
Example:
Sub Botao1_Click()
Dim Valor, qualFormula
Application.GetObject("Formula1").GetValueData_
"Values4", "Template2", var1
End Sub

LoadFormulaValuesQuiet(bstrUnitName, bstrValueName)
This method loads a values set to a destination unit, without showing any message.
This method has the following parameters: " 6 ; , determines the unit name
and " 8 , ; , determining the name of the values set. The method returns
True when it is successfully executed, and False when it fails (which does not mean
there is a script error).
Example:
Sub Button1_Click()
Application.LoadFormulaValuesQuiet_
"Formula1", "Unit3", "Values1"
End Sub

NOTA: This method can be accessed through the Viewer object also.

RenameUnit(bstrUnitName, bstrNewUnitName)
Rename given unit existing in formulas database. It returns True if achieved
performing the operation, or otherwise it returns False. This method has the
following parameters: " 6 ; determines the name of the unit to be found
and " ; 6 ; informs the unit name.

NOTE: This method is accessed through the Viewer object also.


Example:
Sub Button1_Click()
Dim val
'When clicking the button, it renames a unit
Application._
GetObject("Formula1").RenameUnit "Unit2", "Unit3"
End Sub

150 Methods
E3 - Scripts - Reference Manual

RenameValue(bstrValueName, bstrNewValueName)
Rename given values set existing in formulas database. It returns True if achieved
performing the operation, or otherwise it returns False. This method has the
following parameters: " 8 , ; informs the values set name and
" ; 8 ,; informs the new values set name.
Example:
Sub Button1_Click()
Dim val
'When clicking the button, it renames a values set
Application. GetObject("Formula1")._
RenameValue "Template5","TemplateABC"
End Sub

SaveFormulaValues(bstrUnitName, bstrValueName,
[IgnoreErrors])
This method saves origin unit tags’s current values in a cluster of values on the
formula table. This method does not check for limits, in case the template’s
restriction is of the absolute type. " 6 ; parameter is the name of the origin
unit, and " 8 , ; parameter is the cluster of values to be saved. It returns
True if the operation is accomplished; otherwise, it returns False. . !
parameter, when True, causes all values to be recorded, regardless of link errors in
the Formula. Its default value is False, though.
Example:
Sub CommandButton1_Click()
Application. GetObject("Formula1")._
SaveFormulaValues "Unit1", "Value1"
End Sub

SetUnitData(bstrUnitName, bstrTemplateName, bstrData)


This method loads to a database the tag identified to a certain template in given unit,
and returns if the operation performance was achieved. This method has the
following parameters: " 6 ; informs the unit name, " - ' ;
informs tag template name and " = informs the name of the variable
containing the tag name. Example:
Sub Button1_Click()
Dim val
Application.GetObject("Formula1").SetUnitData_
"Unit2", "Template5", 50
End Sub

Methods 151
E3 - Scripts - Reference Manual

SetValueData(bstrValueName, bstrTemplateName, bstrData)


Alters the value referring to a defined template to a given cluster of values. This
method checks for limits, returning True if the operation could be performed, or
False otherwise. This method’s parameters are: " 8 , ; : determines the
name of the cluster of values; " - ' ; : determines the name of the
template; and " = : determines the name of the variable that has the value.
Example:
Sub Botao1_Click()
Dim val
Application.GetObject("Formula1").SetValueData_
"Unit2", "Template1", 100
End Sub

.
Export([ExportFilter], [ExportFileName])
Print a report according to the format specified in the file. This method has the
following parameters: !%' 1 determines the filter for the report, by indicating
the format type for exporting. It can assume the following options:
• PDF: Export data to Acrobat Reader format.
• Excel: Export data to Excel spreadsheet format.
• HTML: Export data to HTML page format.
• TEXT: Export data to text format.
• RTF: Export data to Rich Text Format.
• TIFF: Export data to Tag Image File Format.
By simply informing the filter name as showed above, the data can be exported
using the standard properties of each filter. It must also be informed the file name
into the !%' 1 ; parameter. One can also modify the standard properties of
an exporting filter through GetExportFilter() method, before exporting the data.

152 Methods
E3 - Scripts - Reference Manual

Example:
Sub Button1_Click()
Set report = Application.LoadReport("[Report3]")
Select case Application._
SelectMenu("PDF|Excel|HTML|RTF|Text|TIFF|Text(CSV)")
Case 1
Report.Export "PDF", "C:\correio\reports\report.pdf"
MsgBox "Exported to PDF!"
Case 2
Report.Export "EXCEL", "C:\correio\reports\report.XLS"
MsgBox "Exported to XLS!"
Case 3
Report.Export "HTML", "C:\correio\reports\report.html"
MsgBox "Exported to HTML!"
Case 4
Report.Export "RTF", "C:\correio\reports\report.rtf"
MsgBox "Exported to RTF!"
Case 5
Report.Export "TEXT", "C:\correio\reports\report.txt"
MsgBox "Exported to TXT!"
Case 6
Report.Export "TIFF", "C:\correio\reports\report.tiff"
MsgBox "Exported to TIFF!"
Case 7
Set reportFilter = report.GetExportFilter("TEXT")
reportFilter.FileName="C:\correio\reports\report2.txt"
reportFilter.TextDelimiter=","
report.Export reportFilter
MsgBox "Exported to TXT by using the filter!"
End Select
End Sub

Methods 153
E3 - Scripts - Reference Manual

GetExportFilter(FilterName)
Return an object specifying the exporting parameters customization. This method
has 1 ; parameter determining the filter for reporting, by indicating the
format type for exporting. It can assume the following options:
• PDF: Export data to Acrobat Reader format.
• Excel: Export data to Excel spreadsheet format.
• HTML: Export data to HTML page format.
• TEXT: Export data to text format.
• RTF: Export data to Rich Text Format.
• TIFF: Export data to Tag Image File Format.
After the filter is obtained, the following parameters can be modified:

PROPERTY FILTER DESCRIPTION


1 ; All Inform the file name to which the data will be
exported.
S H, 4 PDF Indicate the quality level of exported images (0 to
100).
0, E .2 Excel If it is true (default), it automatically setup line
height. In case it is false , it setup the height for the
higher element in the line.
, 5+ 2 Excel Column minimum size. The default is 1011 twips.

, 2 Excel If it is True, each page in the report goes to a


separate spreadsheet.
- ! '4 ' $ Excel If it is true, vertical space between the elements will
be eliminated. By default it is false.
= ," ,+ Excel If the elements right aligned they should replace
those left aligned to the same column, put true in it.
Otherwise, leave it in false in order to release more
space.
E .2 Excel Line minimum size.

+ '$ Excel Minimum spacing between cells (Default 59 twips).

. ( HTML If it is true, it will insert horizontal page breaks


below the lowest elements of each page in the
report.
5 " $
2 ,', HTML If it is true, it will be exported to Web Cache
service. Otherwise (default), it will not be exported.
!%
' . HTML Indicates a page range to be exported. Example “1,
2, 3-9, 14”
1 HTML If it is true, it generated a CSS file in the
TMLOutputPath directory.
E- ,', 2 HTML Default path to HTML files.

154 Methods
E3 - Scripts - Reference Manual

- %= HTML Setup/Return the delimiter character between texts.

.= TEXT Setup/Return the delimiter character between pages.

6 $+ TEXT Determine whether the text will be saved into


Unicode (16 bits) format.
,'' ! '4 TEXT Withdraw/Insert empty lines for the layout effect.

1%
!%' TIFF Object that allows exporting data into RFC 1314
TIFF format.

Print()
Print a report.
Example:
Sub Rect_Click()
Application.LoadReport("[Report3]").Print()
End Sub

PrintPreview()
It gives a preview on Screen of the report to be printed. If the report is correctly
showed on Screen, it returns True. In case the user press the $ button or
some error happens, it returns False.
Example:
Sub CommandButton1_Click()
set report = Application.LoadReport("[Report1]")
Beginning =
Application.GetObject("Data.Graphic.idate").Value
Final = Application.GetObject("Data.Graphic.fdate").Value
report.Item("Query1").SetVariableValue "Ini",Initiate
report.Item("Query1").SetVariableValue "End",Final
report.PrintPreview()
End Sub

Query()
Return current Query object selected in the report, by informing through
SourceQuery property. (There might be more than one query in the report).
Example:
Sub Rect_Click()
Set Query = Application.LoadReport("[Report3]").Query()
Query.SetVariableValue("Key1","XYZ")
End Sub

Methods 155
/ /

Each object has Properties, which are used to save information about its
characteristics. For example, take and object like a Rectangle. One of its properties
is Name, where its name is stored. Two other properties are Width and Height, which
save its width and height, respectively.
In this chapter, E3 object’s properties will be summarized. Each entry has the name
of the property, its description, and, when possible, a practical example of its use.
The first topic (“Common Properties”) introduces the properties that are present in
all E3’s objects. The following topics bring the properties that are specific to the
object or group of objects mentioned in their titles. In some of these topics, the first
item is also about common properties; in this case, properties that are common to all
the objects whose group is being depicted in the topic (for example, in the topic
“Screen Objects Properties”, the first item is “Screen Objects Common
Properties”, where all properties common to these objects are grouped).
Properties are identified by an icon indicating the datatype supported on their
content. They are:

Available Datatypes
ICON DATA DESCRIPTION
Returns True or False.

;, $ Returns positive, negative, integer, or double,


to be defined by the property.
= Returns a date in Gregorian format (from 1899
on).
. Returns a text.

8 Returns a variable type, which can assume


different formats.
Returns a color in RGB format.

( Returns a link between objects.

!, Returns a certain set of values.

Properties 157
E3 - Scripts - Reference Manual

Some properties can propagate their values to the same property in their child-
objects; in this case, they are called propagator properties. You can, however,
force the property in the child-object to behave distinctively.

NOTE: Some of properties use HIMETRIC unit system. In HIMETRIC system,


each unit is equivalent to a thousandth centimeter; that is, 1,000 units equals to 1
centimeter. So, this is the measurement pattern adopted for properties in this manual,
when necessary.

/ ''

Application: Returns the application related to this object. With this application
it is possible, for example, to search for other objects that are in the application.
Example:
Sub Tela1_Click()
'When Screen is clicked, a tag is searched
Dim obj
Set obj = Application.GetObject("DataServer1.InternalTag1")
obj.Value = 100
End Sub

Count: Returns the number of child-objects the object has. This property works
conjoined with Item() method. If the object does not have any child-objects, this
property’s value is 0.

Example:
Sub Tela1_Click()
'Searches all Screen objects and sets
'ForegroundColor property to red
Dim obj
For i=1 TO Count
Set obj = Item(i) 'Takes child-object
obj.ForegroundColor = RGB(255,0,0)
Next
End Sub

DocString: Free text that enables the documentation of the object’s functionalities
and/or characteristics by the project’s programmers. Example:

158 Properties
E3 - Scripts - Reference Manual

Sub CommandButton1_Click()
Docstring = "This button activates system condenser."
MsgBox Docstring
End Sub

Links: Returns an object that is a collection of links of any given object at E3.
This property is available in runtime only.

Name: Identifies each object present in the system. Modifying this property
implies in modifying all other properties and/or scripts that use this object. Hence, it
is not advisable to change this property in runtime.

Example:
Sub CommandButton9_Click()
MsgBox "Screen name is "&(Screen.Name)
End Sub

Parent: Returns the object’s parent-object. So, if an object is inserted in the


Screen, Parent property will return Screen. Likewise, if an Internal Tag is inserted
directly below a Data Server, InternalTag’s Parent property will point to Data
Server. Example:
Sub IOTag1_OnStartRunning()
'When IOTag starts, it adjusts parent IODriver’s P1
Parent.P1 = 1
End Sub

PathName: Identifies path name in the system. This property is available in


runtime only. Example:
Sub CommandButton9_Click()
MsgBox "Screen path is "&(Screen.PathName)
End Sub

/ ,

/ 9 ,

DriverLocation: Defines which driver will be used by the I/O driver to


communicate with the device. This property accepts a string with the complete
driver path. After that, DriverName property will change to the driver description.

Properties 159
E3 - Scripts - Reference Manual

This property cannot be modified once communication has started. Default value is
empty. Example:
Sub Driver1_BeforeStart()
'Sets DriverLocation as "c:\drivers\Driver1.dll"
DriverLocation = "c:\drivers\" & Name & ".dll"
End Sub

DriverName: Contains the string that describes the driver associated to


communication driver. You should first set DriverLocation property. This property
is read-only. Default value is empty. Example:
Sub Driver1_BeforeStart()
MsgBox DriverName
End Sub

EnableReadGrouping: Enables read optimization (automatic tag grouping).


This property cannot be altered in runtime. Default value is False (disables read
grouping).

P1: Sets the driver. See driver documentation for appropriate parameters. This
property cannot be modified once communication has started. Example:
Sub Driver1_BeforeStart()
'Driver1 is an I/O Driver
DriverLocation = "c:\driver\plc.dll"
P1 = 2
P2 = 1
P3 = 9600
End Sub

160 Properties
E3 - Scripts - Reference Manual

P2: Sets the driver. See driver documentation for appropriate parameters. This
property cannot be modified once communication has started. Example:
Sub Driver1_BeforeStart()
'Driver1 is an I/O Driver
DriverLocation = "c:\driver\plc.dll"
P1 = 2
P2 = 1
P3 = 9600
End Sub

P3: Sets the driver. See driver documentation for appropriate parameters. This
property cannot be modified once communication has started. Example:
Sub Driver1_BeforeStart()
'Driver1 is an I/O Driver
DriverLocation = "c:\driver\plc.dll"
P1 = 2
P2 = 1
P3 = 9600
End Sub

P4: Sets the driver. See driver documentation for appropriate parameters. This
property cannot be modified once communication has started. Example:
Sub Driver1_BeforeStart()
'Driver1 is an I/O Driver
DriverLocation = "c:\driver\plc.dll"
P1 = 2
P2 = 1
P3 = 9600
P4 = 500
End Sub

ParamDevice: Defines the address of the device accessed by the driver. This
property is inherited by the driver’s blocks and tags, which can override this value, if
necessary.

ReadRetries: Indicates the number of read retries by the driver in case of error. If
it is set to 2, for example, it means the driver will retry failed communication twice,
apart from the original try.

Properties 161
E3 - Scripts - Reference Manual

ShareMaximum: Defines the maximum number of I/O Drivers that will be


grouped in a shared I/O Server. This property is only used when ShareServer
property is enabled.

Example:
'This driver will not be shared
ShareServer = False
ShareMaximum = <qualquer valor>
'all drivers are grouped in the same ‘IOServer
'does not define limit
ShareServer = True
ShareMaximum = 0
'groups every 5 drivers in an IOServer
ShareServer = True
ShareMaximum = 5

ShareServer: If True, this driver will share its execution among all other I/O
drivers that have the same string in DriverLocation. It means that only the first I/O
driver that is set will execute communication initialization. All other shared
communication drivers will ignore all setting parameters from P1 to P4, as well as
other settings. Otherwise, if ShareServer property is False, the driver will not share
any kind of communication with other I/O drivers. This property cannot be modified
once communication has started. Default value is False.

WriteFeedbackMode: Allows controlling write feedback in tags. It applies only


to readable tags, i.e., tags whose AllowRead property is set to True. Through this
property, the reading of write-on tags is made more quickly. This property has the
following setting options:

Available options for WriteFeedbackMode


OPTION DESCRIPTION
M> 5 ; % + Tag reading is done normally in the next
scan.
9> + +0 5 A confirmation reading will be done
immediately after each writing.
:> -, 5 ,$
$ If the driver indicates success in writing, the
written value is assumed directly by the tag,
without reading it from the PLC.

Default value is 9> + +0 5 . Applications from earlier


versions, before this property existed, assume 0 when loaded.
162 Properties
E3 - Scripts - Reference Manual

Example:
Sub CommandButton1_Click()
Dim mode
mode = Application.GetObject("Driver1").WriteFeedbackMode
MsgBox mode
Select case mode
Case 0
MsgBox "Tag reading is done in the next scan"
Case 1
MsgBox "After each writing, a confirmation _
reading will be done as soon as possible”
Case 2
MsgBox "If the driver indicates writing success, _
the written value is assumed directly by the tag, _
without reading it from the PLC."
End Select
End Sub

NOTA: When value 2 is used, timestamp and quality may be damaged, since in a
successful writing the value is assumed by the tag without searching for timestamp
and quality in the PLC. Besides, the assumed value itself may present a little
deviation due to any kind of simplification in numbers that may occur in the driver
and/or PLC. Also note that some drivers or protocols may indicate success, even
when the writing has failed. So, the other values (0 or 1) should be preferred as often
as possible.

WriteRetries: Indicates the number of write retries by the driver in case of error.
If it is set to 2, for example, it means the driver will retry failed communication
twice, apart from the original try.
WriteSyncMode: Determines how writes will be sent to the IOServer
(synchronous or asynchronous mode). This property has the following configuration
options:

Properties 163
E3 - Scripts - Reference Manual

Available options for WriteSyncMode


OPTION DESCRIPTION
M> = , Synchronous mode (default).
9> 4$ Synchronous mode. Every time a value is written in
a tag, E3Run sends the write to IOServer and waits
for the write return.
:> 04$
6$ + Unconfirmed, assynchronous mode. All writes are
sent to IOServer without return feedback, and it is
always assumed that the write has worked. When
assynchronous mode is on, write methods of tags
(Write, WriteEx) always return True immediately,
and write status (on methods returning this status) is
always empty. Driver’s OnTagWrite script is
executed as soon as the write is sent to the IOServer,
and ,$ $ + + parameter is always True.

Asynchronous writes will be executed by IOServer as soon as the driver is available


(when current read is over). If several asynchronous writes are sent to the IOServer,
the driver will only return the reads after all asynchronous writes are executed.

/ 9 !

AdviseType: Controls Advise mode.

Available options for AdviseType


OPTION DESCRIPTION
M> 0 4 0+& The tag is updated if property AllowRead is True.
9> 0+& 52 (+ The tag is updated only if AllowRead is True and the tag
is associated to an active object (i. e., one Display in a
open Screen, a enabled Alarm etc.). A tag association for
this purposes can be assigned to these properties: Value,
RawValue, TimeStamp, Quality and Bit00..Bit31 for I/O
Tags.

Example:
Sub CommandButton3_Click()
MsgBox Application._
Application.GetObject("Driver1.Tag1").AdviseType
End Sub

AllowRead: Defines whether the tag will be read by the I/O driver. If True, the
driver automatically updates Value and Bits (00 to 31) properties, in time spans
164 Properties
E3 - Scripts - Reference Manual

defined by Scan property. Otherwise, the I/O tag will neither be read nor updated.
This property can be modified in execution. Default value is True.

Example:
Sub Botao1_Click()
'Stops tag reading
Set obj = Application.GetObject("Driver1.tag")
obj.AllowRead = False
End Sub

AllowWrite: Defines whether the tag will be written automatically when Value or
Bits (00 to 31) properties are modified. If True, the modifications will be sent to the
device associated to the I/O driver. Otherwise, the modifications will be ignored.
Default value is True. Example:
Sub Botao1_Click()
'disables tag writing
Set obj = Application.GetObject("Driver1.tag")
obj.AllowWrite = False
End Sub

Bit00-Bit031: These properties represent the 32 bits in I/O Tag Value property’s
value, ranging from Bit00 (the least significant bit) to Bit31 (the most significant
bit). By modifying each one of these bits you will modify tag’s Value property, and
vice-versa, but this only happens when UseBitFields property is True. Default value
is False.

DeviceHigh: Defines the highest value achieved by this tag in the device. Adjusts
the value scale from the device before being attributed to Value property. Likewise,
the inverse operation is done before sending the value to the driver, when writing.
This conversion happens only when EnableScaling property is True. Default value is
1,000.

Properties 165
E3 - Scripts - Reference Manual

Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.

DeviceLow: Defines the lowest value achieved by this tag in the device. Adjusts
the value scale from the device before being attributed to Value property. Likewise,
the inverse operation is done before sending the value to the driver, when writing.
This conversion happens only when EnableScaling property is True. Default value is
0.

Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.

166 Properties
E3 - Scripts - Reference Manual

EnableDeadBand: Enables/disables PercentDeadBand property. If True, tag


value is only updated when it changes, and its new value exceeds the limit defined
by PercentDeadBand property. Otherwise, the tag is always updated, and deadband
limit is not checked. Whenever it is possible, you should keep deadband enabled, for
it enhances data acquisition and processing performances. Usually, deadband is
disabled only for tags that return values which represent events in need of treatment
in the script. Default value is True.

EnableDriverEvent: Controls the generation of OnTagRead event, which occurs


in the I/O driver that contains the block. If True, OnTagRead event generation is
enabled by this tag. Otherwise, it is disabled. The three kinds of I/O elements (I/O
tag, I/O block, and block element) can generate this event. The event occurs in the
driver, and not in the block.

EnableScaling: If True, all values from the device will receive scale adjustments
according to DeviceHigh, DeviceLow, EUHigh and EULow properties before they
are attributed to Value property. Otherwise, no adjustment in scale will be made.
Default value is False.

Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

Properties 167
E3 - Scripts - Reference Manual

EU: Identifies the engineering unit represented by the value, such as degrees,
meters etc.

Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

EUHigh: Defines the highest value to be attributed to Value property, adjusting


the scale to the value from the device before it is done. Likewise, the inverse
operation is done before sending the value to the driver, when writing. This
conversion happens only when EnableScaling property is True.

Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.

EULow: Defines the lowest value to be attributed to Value property, adjusting the
scale to the value from the device before it is done. Likewise, the inverse operation
168 Properties
E3 - Scripts - Reference Manual

is done before sending the value to the driver, when writing. This conversion
happens only when EnableScaling property is True. Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EULow = 100
End Sub

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.

N1: Specifies which variable in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started. Default value is 0.

Example:
Sub Tag_OnStartRunning()
N1 = 10
End Sub

N2: Specifies which variable in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started. Default value is 0.

Example:
Sub Tag_OnStartRunning()
N2 = 3
End Sub

N3: Specifies which variable in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started. Default value is 0.

Properties 169
E3 - Scripts - Reference Manual

Example:
Sub Tag_OnStartRunning()
N1 = 10
N3 = 5
N4 = 20
End Sub

N4: Specifies which variable in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started. Default value is 0.

Example:
Sub Tag_OnStartRunning()
N1 = 10
N4 = 20
End Sub

ParamDevice: Defines the address of the device accessed by the tag. This
property is inherited from the driver, but its value can be overridden, if necessary.

ParamItem: Identifies the data the tag accesses from inside the device.

PercentDeadBand: Determines deadband for a tag, so that this value can be


updated at E3. This value is the percentage of variation between the values of
DeviceHigh and DeviceLow properties. This property is only used if the tag’s
EnableDeadBand property is set to True. If PercentDeadBand value is 0, the tag
will not have deadband, and any variation in value will be passed to E3. Otherwise,
E3 will receive a new value only if its difference is larger than deadband. Default
value is 0.

Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Tag it also sets data quality. This property is
read-only. Default value is 0 (Bad Quality).

NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.

RawValue: It is the element’s original value, before EnableScaling property has


acted upon it. So, if EnableScaling is False, Value and RawValue property will
behave identically.

170 Properties
E3 - Scripts - Reference Manual

Scan: Specifies the duration of the scan used by the server to update Value
property. This property is represented in milliseconds, and can be modified after
communication has started. It is used only when AllowRead property is set to True.
When you set this property in the several tags in the application, you should increase
the value of the property to those tags that do not vary very much in the device,
enabling other tags with higher priority to be read more frequently, and enhancing
general performance in the system. Default value is 1,000 (1 second). Scan value
should be above zero. Example:
Sub Tag_OnStartRunning()
Scan = 1500
End Sub

TimeStamp: Updated whenever there is a change in value or status in either


Value or Quality properties. Informs timestamp associated to both value and quality
in I/O tag. This is a read-only property. Default value is 00:00:00.

UseBitFields: If True, every time the value from Value property is modified, the
bits referring to Bit00 to Bit31 properties will be updated. Also, every time the value
from Bit00 to Bit31 properties are modified, the value from Value property is
updated and sent to the device, if AllowWrite property is True. Otherwise, bits will
not undergo any modification. This property can be updated once communication
has started. Default value is False.

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.

Properties 171
E3 - Scripts - Reference Manual

Value: Updated whenever a new device value valid reading is done, using N1-
N4 parameters. Datatype (integer, floating point, string) depends on the driver to
which the element is associated and its parameters.

This property is updated like this if AllowRead property is True, and when there are
no communication errors (in this case, Quality and TimeStamp properties are
updated), according to scan time defined in Scan property. Another way to use this
property is to write values in the device; for this, just attribute a new value to Value
property or to some of the bits from Bit00-Bit031. In this case, AllowWrite property
must be True.

This is also I/O Tag’s default property. So, it is not mandatory for a value reference
to a I/O Tag to make Value property explicit in order to access value. Default value
is empty (no value). Example:
Sub Botao1_Click()
'Accesses a tag and shows current value
'tag1 is an I/O tag
Set obj = Application.GetObject("I/O
Driver1.tag1")
MsgBox "Tag1's current value: " & obj.Value
'This can also be done in a different way,
'with no need to show Value property, which is default
MsgBox " Tag1's current value: " & obj
End Sub

NOTE: Bits value (Bit00...Bit31 properties) are not affected by scale adjustment.
That is to say, they represent bits of the value read from the device, before
conversion.

172 Properties
E3 - Scripts - Reference Manual

/ " 9 + #

AdviseType: Controls Advise mode.

Available options for AdviseType


OPTION DESCRIPTION
M> 0 4 0+& The tag is updated if property AllowRead is True.
9> 0+& 52 (+ The tag is updated only if AllowRead is True and the tag
is associated to an active object (i. e., one Display in a
open Screen, a enabled Alarm etc.). A tag association for
this purposes can be assigned to these properties: Value,
RawValue, Quality and Bit00..Bit31 for Block Elements,
and Quality and TimeStamp for I/O Blocks.

AllowRead: Defines whether the block will be read by the I/O driver. If True, the
driver automatically updates the I/O elements inserted in the block, in time spans
defined by Scan property. Otherwise, the communication block will neither be read
nor updated. This property can be modified in execution. Default value is True.
Example:
Sub Botao1_Click()
'Stops block reading
Set obj = Application.GetObject("Driver1.bloco1")
obj.AllowRead = False
End Sub

AllowWrite: Defines whether the block will be written automatically when


Value property from I/O Block Elements is modified. If True, the modifications will
be sent to the device associated to the I/O driver. Otherwise, the modifications will
be ignored. Communication elements will not accept values if this property is set to
False, unless AllowRead property is also set to False. Example:
Sub Botao1_Click()
'Disables block writing
Set obj = Application.GetObject("Driver1.bloco1")
obj.AllowWrite = False
End Sub

Properties 173
E3 - Scripts - Reference Manual

B1: Specifies which data cluster in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started.

Example:
Sub Bloco1_BeforeStart()
B1 = 2
B2 = 1
B3 = 9600
End Sub

B2: Specifies which data cluster in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started.

Example:
Sub Bloco1_BeforeStart()
B1 = 2
B2 = 1
B3 = 9600
End Sub

B3: Specifies which data cluster in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started.

Example:
Sub Bloco1_BeforeStart()
B1 = 2
B2 = 1
B3 = 9600
End Sub

174 Properties
E3 - Scripts - Reference Manual

B4: Specifies which data cluster in the device this tag is associated to. See driver
documentation for appropriate parameters. This property can be modified once
communication has started.

Example:
Sub Bloco1_BeforeStart()
B1 = 2
B2 = 1
B3 = 9600
B4 = 524
End Sub

EnableDeadBand: Enables/disables PercentDeadBand property. If True, block


value is only updated when it changes, and its new value exceeds the limit defined
by PercentDeadBand property. Otherwise, the block is always updated, and
deadband limit is not checked. Whenever it is possible, you should keep deadband
enabled, for it enhances data acquisition and processing performances. Usually,
deadband is disabled only for tags that return values which represent events in need
of treatment in the script OnRead. Default value is True.

EnableDriverEvent: Controls the generation of OnTagRead event, which occurs


in the I/O driver that contains the block. If True, OnTagRead event generation is
enabled by this tag. Otherwise, it is disabled. The three kinds of I/O elements (I/O
tag, I/O block, and block element) can generate this event. The event occurs in the
driver, and not in the block.

ParamDevice: Defines the address of the device accessed by the block. This
property is inherited from the driver, but its value can be overridden, if necessary.

ParamItem: Identifies the data the block accesses from inside the device.

Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Block it also sets data quality. This property
is read-only. Default value is 0 (Bad Quality).

NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.

Scan: Specifies the duration of the scan used by the server to update the block.
This property is represented in milliseconds, and can be modified after
communication has started. It is used only when AllowRead property is set to True.
When you set this property in several blocks in the application, you should increase
Properties 175
E3 - Scripts - Reference Manual

the value of the property to those blocks that do not vary very much in the device,
enabling other blocks with higher priority to be read more frequently, and enhancing
general performance in the system. Default value is 1,000 (1 second). Scan value
should be above zero. Example:
Sub IOBlock1_BeforeStart()
Scan = 152
End Sub

Size: Defines the size of the values cluster in this block. See driver documentation
for this property’s limits, according to parameters B1 to B4. By creating elements for
the block, you can access read values and write values for the device. This property
cannot be modified once communication has already started. Default value is 0.
Example:
Sub IOBlock1_BeforeStart()
Size = 10
End Sub

TimeStamp: Updated whenever there is a change in value or status in either


Value or Quality properties. Informs timestamp associated to both value and quality
in I/O block. This is a read-only property. Default value is 00:00:00.

/ $ + #) '

Bit00-Bit031: These properties represent the 32 bits in block element Value


property’s value, ranging from Bit00 (the least significant bit) to Bit31 (the most
significant bit). By modifying each one of these bits you will modify element’s
Value property, and vice-versa, but this only happens when UseBitFields property is
True. Default value is False.

DeviceHigh: Defines the highest value achieved by this element in the device. It
adjusts the value scale from the device before being attributed to Value property.
Likewise, the inverse operation is done before sending the value to the driver, when
writing. This conversion happens only when EnableScaling property is True.
Default value is 1,000.

176 Properties
E3 - Scripts - Reference Manual

Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

DeviceLow: Defines the lowest value achieved by this element in the device.
Adjusts the value scale from the device before being attributed to Value property.
Likewise, the inverse operation is done before sending the value to the driver, when
writing. This conversion happens only when EnableScaling property is True.
Default value is 0. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

EnableDriverEvent: Controls the generation of OnTagRead event, which occurs


in the I/O driver that contains the block. If True, OnTagRead event generation is
enabled by this tag. Otherwise, it is disabled. The three kinds of I/O elements (I/O
tag, I/O block, and block element) can generate this event. The event occurs in the
driver, and not in the block.

EnableScaling: If True, all values from the device will receive scale adjustments
according to DeviceHigh, DeviceLow, EUHigh and EULow properties before they
are attributed to Value property. Otherwise, no adjustment in scale will be made.
Default value is False.

Properties 177
E3 - Scripts - Reference Manual

Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

EU: Identifies the engineering unit represented by the value, such as degrees,
meters etc.

Example:
Sub ElementodeBloco1_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

EUHigh: Defines the highest value to be attributed to Value property, adjusting


the scale to the value from the device before it is done. Likewise, the inverse
operation is done before sending the value to the driver, when writing. This
conversion happens only when EnableScaling property is True. Default value is
1,000.

178 Properties
E3 - Scripts - Reference Manual

Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

EULow: Defines the lowest value to be attributed to Value property, adjusting the
scale to the value from the device before it is done. Likewise, the inverse operation
is done before sending the value to the driver, when writing. This conversion
happens only when EnableScaling property is True. Default value is 0. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EULow = 100
EULow = 0
End Sub

Index: Specifies this element’s position among the other elements configured by
Size property of the I/O block where it is inserted. This property’s values range from
0 to the value defined by Size, -1. (For example: If Size is 20, Index ranges from 0 to
19). This property can be modified once communication has started. Default value is
0, but when mapping the elements from a block Studio automatically adjusts Index
parameter to a specified value.

Properties 179
E3 - Scripts - Reference Manual

Example:
Sub Element_OnStartRunning()
Index = 15
End Sub

PercentDeadBand: Determines deadband for a block element, so that this value


can be updated at E3. This value is the percentage of variation between the values of
DeviceHigh and DeviceLow properties. This property is only used if the element’s
EnableDeadBand property is set to True. If PercentDeadBand value is 0, the block
element will not have deadband, and any variation in value will be passed to E3.
Otherwise, E3 will receive a new value only if its difference is larger than deadband.
Default value is 0.

Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Element it also sets data quality. This
property is read-only. Default value is 0 (Bad Quality).

NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.

RawValue: It is the element’s original value, before EnableScaling property has


acted upon it. So, if EnableScaling is False, Value and RawValue property will
behave identically.

UseBitFields: If True, every time the value from Value property is modified, the
bits referring to Bit00 to Bit31 properties will be updated. Also, every time the value
from Bit00 to Bit31 properties are modified, the value from Value property is
updated and sent to the device, if AllowWrite property is True. Otherwise, bits will
not undergo any modification. This property can be updated once communication
has started. Default value is False.

Value: Updated whenever a new device value valid reading is done, using B1-B4
parameters of the I/O Block where this element is inserted, and considering its
position on the table read via Index property. Datatype (integer, floating point,
string) depends on the driver to which the element is associated and its parameters.

This property is updated like this if I/O Block’s AllowRead property is True, and
when there are no communication errors (in this case, Quality and TimeStamp
properties are updated), according to scan time defined in Scan property. Another
way to use this property is to write values in the device; for this, just attribute a new
value to Value property or to some of the bits from Bit00-Bit031. In this case, I/O
Block’s AllowWrite property must be True.

180 Properties
E3 - Scripts - Reference Manual

This is also Block Element’s default property. So, it is not mandatory for a value
reference to a Block Element to make Value property explicit in order to access
value. In case the property is not updated, check if Index property is correctly set.
Default value is empty (no value).

Example:
Sub Button1_Click()
'Accesses and object and shows current value
'elm1 is a I/O BlockElement
Set obj = Application.GetObject("I/O
Driver1.Block1.elm1")
MsgBox "elm1's current value:" & obj.Value
'This can also be done in a different way,
'with no need to show Value property, which is default
MsgBox " elm1's current value: " & obj
End Sub

/"

/" ,

Compatibility: Controls the use of OPC default interfaces by E3’s OPC client.
The available options are: M>0 48 : normal operation (recommended): OPC
driver communicates with both DA 2.0x and 1.0a servers (preference is given to
2.0x interfaces); 9>8 9M0: forces communication with DA 1.0a pattern for
servers that support both DA 2.0x and 1.0a; and :>8 :M: forces
communication only with OPC DA 2.0x pattern.

This property cannot be modified when OPC client communication is enabled (both
in Studio and runtime).

NOTE: only as last resource should the diver be configured in a value different from
M>0 4 8 (default). This property is for advanced use only, and applies strictly
to overcoming a possible incompatibility situation with some specific OPC server.

ReconnectPeriod: Controls connection period to OPC Server. If connection is


lost, the driver stops and restarts until this action becomes successful. The period is
set to milliseconds, and when the value is set to 0, reconnection is disabled. Because
OPC Driver is stopped and started, BeforeStart and AfterStop events are generated.
When connection is lost, all the related tags will be disconnected from their current
state (bad/quality/null value).

Properties 181
E3 - Scripts - Reference Manual

Example:
Sub Driver OPC1_AfterStart()
Application.GetObject("DriverOPC1.GrupoOPC1")._
ReconnectPeriod = 0
End Sub

ServerID: Determines the server that OPC Driver connects to. This property can be
modified only when OPC Driver is not connected. If the property’s field is blank, OPC
object will not connect. Default value is empty. Example:
Sub Driver OPC1_AfterStart()
MsgBox _
Application.GetObject("DriverOPC1.GrupoOPC1").ServerID
End Sub

ServerMachine: Determines the address of the station where the OPC server is
running. For applications running locally, this property can remain blank. Otherwise,
it is necessary to specify the path. This property can only be modified when OPC
driver is disconnected. Default value is empty.

Example:
Sub Driver OPC1_AfterStart()
MsgBox Application._
GetObject("DriverOPC1.GrupoOPC1").ServerMachine
End Sub

ServerName: Returns OPC server’s name and description. This property is


different from ServerID, which is a code.

Example:
Sub Driver OPC1_AfterStart()
MsgBox _
Application.GetObject("DriverOPC1.GrupoOPC1").ServerName
End Sub

ServerStatus: Determines the status of the connection to OPC server. The


available options are:

182 Properties
E3 - Scripts - Reference Manual

Available options for ServerStatus


OPTIONS DESCRIPTION
>9R & ,T6 ( OPC Driver is connected to the server but either
status is not informed or OPC client has
ReconnectPeriod property set to 0.
MR & ,T; $+ OPC Driver is not connected to OPC Server.
This happens when, for example, OPC driver is
not active, or connection has not been established
for some problem.

The values below are only informed when ReconnectPeriod property is different
from 0. At each non-specified period passage, the status is searched in the server. In
case it is not correctly informed, the property can maintain value -1, or then
disconnection can be detected, what turns the status to 0. Values are based on the
five default types of status defined for OPC servers.

Available options for ReconnectPeriod different from 0


OPTIONS DESCRIPTION
9> & ,T , . Server is running normally.
:> & ,T1 + Server is not running. An unspecified error
has occurred in the server.
F> & ,T; . Server is running, but without configuration
information.
I> & ,T ,' + + Server has been temporarily suspended.
L> & ,T- Server is in Test mode.

Status is searched in the server at each passage from the specified period. In case
status is not informed correctly, the property can maintain value -1; or then
disconnection can be detected, what turns the status to 0. The values are based on the
five default types of status for OPC Server.

Properties 183
E3 - Scripts - Reference Manual

Example:
Sub CommandButton1_Click()
Dim status
status = Application.GetObject("DriverOPC1").ServerStatus
MsgBox "Driver status is " & status
Select Case status
Case -1
MsgBox "OPC Driver is connected to OPC Server_
but its status was not informed"
Case 0
MsgBox "OPC Driver is not connected to OPC Server"
Case 1
MsgBox "Server runs normally"
Case 2
MsgBox "Server is not running"
Case 3
MsgBox "Server is running with no configuration_
information"
Case 4
MsgBox "Server has been temporarily suspended"
Case 5
MsgBox "Server is on Test Mode"
End Select
End Sub

NOTA: If you want this property to behave as if it were Boolean, use ServerStatus
different from 0. This causes the property to differentiate only between the existence
or not of connection, not considering more specific status from the server. Besides,
the expression will not depend on ReconnectPeriod different from 0.

/" >

BlockMode: Determines OPC Group’s activating/deactivating behavior. If True,


OPC tags communication in the group starts in ensemble mode, right after the
activating of all tags in the group. This improves the performance, because it
minimizes the number of callings to OPC Driver. Otherwise, OPC tags
communication starts individually, according to the ordinary sequence of objects
activation. So the first tag in the Group (from the Organizer standpoint) will
communicate before the last one. Although slower, this block mode activation can

184 Properties
E3 - Scripts - Reference Manual

be useful when you need to perform some operation in the tag’s OnStartRunning()
event.

DeadBand: Adjusts OPC tag’s deadband, for its updating. This parameter only
applies to group tags that are considered analog by the OPC Server the OPC Driver
is connected to. The valid interval for this property is from 0 to 100 percent. When
DeadBand is 0, it means that any variation in the value of a group tag implies in
updating this tag (considering also the group’s updating time). This percentage is
applied to each tag according to their Engineering limits (defined in OPC Server).
To update a tag, the following expression must be True (according to OPC Server):
Abs(Previously_saved_value – Current_value) > _
(DeadBand / 100) * Abs (Upper_limit – Lower_limit)

Default value is 0.

Enabled: Enables tags updating inside a OPC Group. If True, tags with
AllowRead property set to True, and AdviseType property set to 1, are kept updated
according to the group’s updating time (Scan property) and deadband (DeadBand
property). Otherwise, no tag inside OPC Group will be updated. Also, it will not be
possible to use Refresh() method.

RealScan: Real scan used by OPC Group’s server. Example:


Sub CommandButton3_Click()
MsgBox _
Application.GetObject("DriverOPC2.GrupoOPC2").RealScan
End Sub

Scan: Specifies the duration of the scan used by the server to update group tags
used by the server. This property is represented in milliseconds, and can be modified
after communication has started. It is used only when Enable property is set to True.
When you set this property in the several tags in the application, you should increase
the value of the property to those tags that do not vary very much in the device,
enabling other tags with higher priority to be read more frequently, and enhancing
general performance in the system. Default value is 1000 (1 second).

Properties 185
E3 - Scripts - Reference Manual

/"" !

AdviseType: Controls Advise mode.

Available options for AdviseType


OPTION DESCRIPTION
M> 0 4 0+& The tag is updated if the property AllowRead is True
and the OPC Group property Enabled is True also.
9> 0+& 52 (+ The tag is updated only if AllowRead is True, the
OPC Group property Enabled is True and the tag is
associated to an active object (i. e., one Display in a
open Screen, a enabled Alarm etc.). A tag
association for this purposes can be assigned to
these properties: Value, RawValue, TimeStamp,
Quality and Bit00..Bit31 of OPC Tags.

Example:
Sub CommandButton3_Click()
MsgBox Application._
GetObject("Driver OPC.GrupoOPC.Tag_ OPC1").AdviseType
End Sub

AllowRead: Defines whether the tag will be read by the OPC driver. If True, the
driver automatically updates Value and Bits (00 to 31) properties from this object, in
time spans. Otherwise, the this tag will neither be read nor updated. This property
can be modified in execution. Default value is True. Example:
Sub CommandButton1_Click()
'Stops tag reading
Set obj = Application.GetObject("Driver1.tag")
obj.AllowRead = False
End Sub

AllowWrite: Defines whether the tag will be written automatically when Value or
Bits (00 to 31) properties are modified. If True, the modifications will be sent to the
device associated to the OPC driver. Otherwise, the modifications will be ignored.
Default value is True.

186 Properties
E3 - Scripts - Reference Manual

Example:
Sub Botao1_Click()
'Disables tag writing
Set obj = Application.GetObject("Driver1.tag")
obj.AllowWrite = False
End Sub

Bit00-Bit031: These properties represent the 32 bits in OPC Tag Value property’s
value, ranging from Bit00 (the least significant bit) to Bit31 (the most significant
bit). By modifying each one of these bits you will modify tag’s Value property, and
vice-versa, but this only happens when UseBitFields property is True. Default value
is False.

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.

DataType: Read-only property. Determines datatype associated to this OPC tag (see
table below).

Available options for DataType


OPTION DESCRIPTION
M> T6 + + Undefined value (Empty)
9> T;, Null value.
:RT . 16-bit signed integer value.
FRT . 32-bit signed integer value.
IRT . 32-bit floating-point value.
L RT= ," 64-bit floating-point value.
RT , $ 4 Currency value
O R T= Date/hour value
KRT . Text (string) value
P R T "#$ Generic object value.
9M R T! Error code value.
99 R T Boolean value (True/False)
9: R T8 Variant value.
9F R T6 ( "#$ Unknown object value.
9I R T= $ 96-bit floating-point value
F RT $+ Record value.
9 RT 2 8-bit signed integer value.
9O > T 4 8-bit unsigned integer value
9K R T5 + 16-bit signed integer value
9P R T= + 32-bit signed integer value
:M R T . . 64-bit signed integer value
:9 > T==5 + 64-bit integer value
Properties 187
E3 - Scripts - Reference Manual

OPTION DESCRIPTION
:: R T . T Integer value
:F R T6 . Unsigned integer value.
K9PI > T0 . Integer value array.
K9PL R T0 . 32-bit signed integer value one-dimensional array.
K9P R T0 . 32-bit floating-point value one-dimensional array.
K9PO > T0 = ," 64-bit floating-point value one-dimensional array.
K9PK R T0 , $ 4 Currency value one-dimensional array.
K9PP R T0 = Date/hour value one-dimensional array.
K:MM R T0 . Text (string) value one-dimensional array.
K:M9 R T0 "#$ Generic object value one-dimensional array.
K:M: R T0 ! Error code value unidimensional array.
K:MF R T0 Boolean value (True/False) one-dimensional array.
K:MI R T0 8 Variant value one-dimensional array.
K:ML R T0 6 ( "#$ Unknown object value one-dimensional array.
K:M R T0 = $ 96-bit floating-point value one-dimensional array.
K::K R T0 $ + Record value one-dimensional array.
K:MK R T0 2 8-bit signed integer value one-dimensional array.
K:MP R T0 4 8-bit unsigned integer value one-dimensional array.
K:9M R T0 5 + 32-bit integer value one-dimensional array.
K:99 R T0 =5 + 32-bit integer value one-dimensional array.
K:9: R T0 . . 16-bit integer value one-dimensional array.
K:9F R T0 ==5 + 32-bit signed integer value one-dimensional array.
K:9I R T0 . T 16-bit signed integer value one-dimensional array.
K:9L R T0 6 . Unsigned integer value one-dimensional array.

DeviceHigh: Defines the highest value achieved by this tag in the device. Adjusts
the value scale from the device before being attributed to Value property. Likewise,
the inverse operation is done before sending the value to the driver, when writing.
This conversion happens only when EnableScaling property is True. Default value is
1,000.

188 Properties
E3 - Scripts - Reference Manual

Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.

DeviceLow: Defines the lowest value achieved by this element in the device.
Adjusts the value scale from the device before being attributed to Value property.
Likewise, the inverse operation is done before sending the value to the driver, when
writing. This conversion happens only when EnableScaling property is True.
Default value is 0.

Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.

EnableScaling: If True, all values from the device will receive scale adjustments
according to DeviceHigh, DeviceLow, EUHigh and EULow properties before they
Properties 189
E3 - Scripts - Reference Manual

are attributed to Value property. Otherwise, no adjustment in scale will be made.


Default value is False. Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = TrueDeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

EU: Identifies the engineering unit represented by the value, such as degrees,
meters etc. Default value is empty. Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

EuHigh: Defines the highest value to be attributed to Value property, adjusting


the scale to the value from the device before it. Likewise, the inverse operation is
done before sending the value to the driver, when writing. This conversion happens
only when EnableScaling property is True. Default value is 1,000.

190 Properties
E3 - Scripts - Reference Manual

Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.

EuLow: Defines the lowest value to be attributed to Value property, adjusting the
scale to the value from the device before it is done. Likewise, the inverse operation
is done before sending the value to the driver, when writing. This conversion
happens only when EnableScaling property is True. Default value is 0.

Example:
Sub Tag_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EULow = 100
EULow = 0
End Sub

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in scale.
That is, they represent the bits from the value read by the equipment before the
conversion.

ItemID: Determines the path identifying OPC tag on the server, which OPC
Driver connects to. Path definition is flexible, and depends on the specific server.
Usually, servers specify an ID space with hierarchical items, such as
Properties 191
E3 - Scripts - Reference Manual

“ParentItem.ChildItem.Tag1”. ItemID works as a “key” for data, and it is considered


“where”, or “what” allows OPC server to connect to data source. Although default
value is empty, it is necessary to specify some value for OPC block to be valid.
Example:
Sub Tag OPC1_Click()
MsgBox ItemID
End Sub

Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Tag it also sets data quality. This property is
read-only. Default value is 0 (Bad Quality).

NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.

RawValue: It is the element’s original value, before EnableScaling property has


acted upon it. So, if EnableScaling is False, Value and RawValue property will
behave identically.

SyncWrite: Determines the type of writing used by an OPC tag. If True, writing
is synchronous, that is, OPC Driver waits for the writing result from the server.
Otherwise, writing is asynchronous, that is, OPCTag value is sent and OPC Driver
processing will continue immediately. Default value is False.

NOTE: In asynchronous mode (False), the quality of communication performance


tends to be higher. However, in synchronous mode (True), writing operation success
is verified and informed.

TimeStamp: Updated whenever there is a change in value or status in either


Value or Quality properties. Informs timestamp associated to both value and quality
in OPC tag. This is a read-only property. Default value is 00:00:00.

UseBitFields: If True, every time the value from Value property is modified, the
bits referent to Bit00 to Bit31 properties will be updated. Also, every time the value
from Bit00 to Bit31 properties are modified, the value from Value property is
updated and sent to the device, if AllowWrite property is True. Otherwise, bits will
not undergo any modification. This property can be updated once communication
has started. Default value is False.

NOTE: Bits value (Bit00 to Bit31 properties) are not affected by adjustment in
scale. That is, they represent the bits from the value read by the equipment before
the conversion.

192 Properties
E3 - Scripts - Reference Manual

Value: Contains current tag value. This property’s updating control (reading) is
made by AllowRead and AdviseType properties in the tag, as well as by Enabled,
Scan, and DeadBand properties in the tag’s OPC group. This property is a Variant,
and its subtype (informed by DataType property) varies according to its definition in
the OPC Server. In the event of communication reading errors, this property will
assume either null or the last known value. Since it is OPC tag’s default property, it
does not need explicit specification to be referred to. Default value is empty.
Example:
Sub Botao1_Click()
'Accesses a tag and shows its current value
'tag1 is an OPCTag
Set obj = Application._
GetObject("Driver de_ Comunicação1.tag1")
MsgBox "Tag1’s current value: " & obj.Value
'does not show Value property, since it is default
MsgBox " Tag1’s current value: " & obj
End Sub

Properties 193
E3 - Scripts - Reference Manual

/"$ + #

AdviseType: Controls Advise mode.

Available options for AdviseType


OPTION DESCRIPTION
M> 0 4 0+& The tag is updated if the property AllowRead is True and
the OPC Group property Enabled is True also.
9> 0+& 52 (+ The tag is updated only if AllowRead is True, the OPC
Group property Enabled is True and the tag is associated
to an active object (i. e., one Display in a open Screen, a
enabled Alarm etc.). A tag association for this purposes
can be assigned to these properties: Value, RawValue,
Quality and Bit00..Bit31 for Block Elements, and Quality
and TimeStamp for I/O Blocks.

Example:
Sub CommandButton3_Click()
MsgBox Application._
GetObject("DriverOPC.GrupoOPC.SCRIPT1").AdviseType
End Sub

AllowRead: Defines whether the block will be read by the OPC driver. If True,
the driver automatically updates Value and Bits (00 to 31) properties from OPC
block, in time spans. Otherwise, the OPC block will neither be read nor updated.
This property can be modified in execution. Default value is True. Example:
Sub Botao1_Click()
'Stops tag reading
Set obj = Application.GetObject("Driver1.tag")
obj.AllowRead = False
End Sub

AllowWrite: Defines whether the tag will be written automatically when Value or
Bits (00 to 31) properties are modified. If True, the modifications will be sent to the
device associated to the OPC driver. Otherwise, the modifications will be ignored.
Default value is True.

194 Properties
E3 - Scripts - Reference Manual

Example:
Sub Botao1_Click()
Set obj = Application.GetObject("Driver1.tag")
obj.AllowWrite = False
End Sub

DataType: Read-only property. Determines datatype associated to this OPC block.


(see table below).

Available options for DataType


OPTION DESCRIPTION
M> T6 + + Undefined value (Empty)
9> T;, Null value.
:RT . 16-bit signed integer value.
FRT . 32-bit signed integer value.
IRT . 32-bit floating-point value.
L RT= ," 64-bit floating-point value.
RT , $ 4 Currency value
O R T= Date/hour value
KRT . Text (string) value
P R T "#$ Generic object value.
9M R T! Error code value.
99 R T Boolean value (True/False)
9: R T8 Variant value.
9F R T6 ( "#$ Unknown object value.
9I R T= $ 96-bit floating-point value
F RT $+ Record value.
9 RT 2 8-bit signed integer value.
9O > T 4 8-bit unsigned integer value
9K R T5 + 16-bit signed integer value
9P R T= + 32-bit signed integer value
:M R T . . 64-bit signed integer value
:9 > T==5 + 64-bit integer value
:: R T . T Integer value
:F R T6 . Unsigned integer value.
K9PI > T0 . Integer value array.
K9PL R T0 . 32-bit signed integer value one-dimensional array.
K9P R T0 . 32-bit floating-point value one-dimensional array.
K9PO > T0 = ," 64-bit floating-point value one-dimensional array.
K9PK R T0 , $ 4 Currency value one-dimensional array.
K9PP R T0 = Date/hour value one-dimensional array.
K:MM R T0 . Text (string) value one-dimensional array.
K:M9 R T0 "#$ Generic object value one-dimensional array.
K:M: R T0 ! Error code value unidimensional array.

Properties 195
E3 - Scripts - Reference Manual

OPTION DESCRIPTION
K:MF R T0 Boolean value (True/False) one-dimensional array.
K:MI R T0 8 Variant value one-dimensional array.
K:ML R T0 6 ( "#$ Unknown object value one-dimensional array.
K:M R T0 = $ 96-bit floating-point value one-dimensional array.
K::K R T0 $ + Record value one-dimensional array.
K:MK R T0 2 8-bit signed integer value one-dimensional array.
K:MP R T0 4 8-bit unsigned integer value one-dimensional array.
K:9M R T0 5 + 32-bit integer value one-dimensional array.
K:99 R T0 =5 + 32-bit integer value one-dimensional array.
K:9: R T0 . . 16-bit integer value one-dimensional array.
K:9F R T0 ==5 + 32-bit signed integer value one-dimensional array.
K:9I R T0 . T 16-bit signed integer value one-dimensional array.
K:9L R T0 6 . Unsigned integer value one-dimensional array.

ItemID: Determines the path identifying OPC block on the server to which OPC
Driver is connected. Path definition is flexible, and depends on the specific server.
Usually, servers specify an ID space with hierarchical items, such as
“ParentItem.ChildItem.Tag1”. ItemID works as a unique “key” for data, and it is
considered “where”, or “what” allows OPC server to connect to data source.
Although default value is empty, it is necessary to specify some value for OPC block
to be valid. Example:
Sub Bloco OPC1_OnStartRunning()
MsgBox ItemID
End Sub

Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Block it also sets data quality. This property
is read-only. Default value is 0 (Bad Quality).

NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.

196 Properties
E3 - Scripts - Reference Manual

Size: Defines the size of value cluster in this block. See driver documentation for
this property’s limits according to B1 to B4 properties. By creating elements for the
block, it allows both accessing read values and writing values for the device. This
property cannot be modified once communication has started. Default value is 0.
Example:
Sub Bloco OPC1_OnStartRunning()
Size = 12
End Sub

SyncWrite: Determines the type of writing used by an OPC Block. If True,


writing is synchronous, that is, OPC Driver waits for the writing result from the
server. Otherwise, writing is asynchronous, that is, OPC Tag value is sent and OPC
Driver processing will continue immediately. Default value is False.

NOTE: In asynchronous mode (False), the quality of communication performance


tends to be higher. However, in synchronous mode (True), writing operation success
is checked and informed.

TimeStamp: Updated whenever there is a change in value or status in either


Value or Quality properties. Informs timestamp associated to both value and quality
in OPC Block. This is a read-only property. Default value is 00:00:00.

/". + #) '

Bit00-Bit031: These properties represent the 32 bits in OPC block element Value
property’s value, ranging from Bit00 (the least significant bit) to Bit31 (the most
significant bit). By modifying each one of these bits you will modify element’s
Value property, and vice-versa, but this only happens when UseBitFields property is
True. Default value is False.

DeviceHigh: Defines the highest value achieved by this element in the device.
Adjusts the value scale from the device before being attributed to Value property.
Likewise, the inverse operation is done before sending the value to the driver, when
writing. This conversion happens only when EnableScaling property is True.
Default value is 1,000. Example:

Properties 197
E3 - Scripts - Reference Manual

Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

DeviceLow: Defines the lowest value achieved by this element in the device.
Adjusts the value scale from the device before being attributed to Value property.
Likewise, the inverse operation is done before sending the value to the driver, when
writing. This conversion happens only when EnableScaling property is True.
Default value is 0. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

198 Properties
E3 - Scripts - Reference Manual

EnableScaling: If True, all values from the device will receive scale adjustments
according to DeviceHigh, DeviceLow, EUHigh and EULow properties before they
are attributed to Value property. Otherwise, no adjustment in scale will be made.
Default value is False. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

EU: Identifies the engineering unit represented by the value, such as degrees,
meters etc. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

Properties 199
E3 - Scripts - Reference Manual

EUHigh: Defines the highest value to be attributed to Value property, adjusting


the scale to the value from the device before it is done. Likewise, the inverse
operation is done before sending the value to the driver, when writing. This
conversion happens only when EnableScaling property is True. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EULow = 100
EULow = 0
End Sub

EULow: Defines the lowest value to be attributed to Value property, adjusting the
scale to the value from the device before it is done. Likewise, the inverse operation
is done before sending the value to the driver, when writing. This conversion
happens only when EnableScaling property is True. Example:
Sub Element_OnStartRunning()
'Adjusts the scale of temperature
'ranging from 0 to 255 at PLC, but it actually means
'0 to 100 degrees Celsius
EU = "Celsius degrees"
EnableScaling = True
DeviceHigh = 255
DeviceLow = 0
EUHigh = 100
EULow = 0
End Sub

200 Properties
E3 - Scripts - Reference Manual

Index: Specifies this element’s position among the other elements set by Size
property from the OPC block where it is inserted. This property’s values range from
0 to the value defined by Size, minus 1. (For example: If Size is 20, Index ranges
from 0 to 19). This property can be modified once communication has started.
Default value is 0, but when mapping the elements from a block Studio
automatically adjusts Index parameter to a specified value. Example:
Sub Elemento1_OnRead()
MsgBox Index
End Sub

Quality: Informs the quality of the value contained in Value property. Each time
the Driver attributes a new value to the Element it also sets data quality. This
property is read-only. Default value is 0 (Bad Quality).

NOTE: For further information on quality, see the topic “Quality” in User’s
Manual, or refers the topic “Property Quality”.

RawValue: It is the element’s original value, before EnableScaling property has


acted upon it. So, if EnableScaling is False, Value and RawValue property will
behave identically.

UseBitFields: If True, every time the value from Value property is modified, the
bits referent to Bit00 to Bit31 properties will be updated. Also, every time the value
from Bit00 to Bit31 properties are modified, the value from Value property is
updated and sent to the device, if AllowWrite property is True. Otherwise, bits will
not undergo any modification. This property can be updated once communication
has started. Default value is False.

Value: Updated whenever a new value is read at OPC Server, according to the
specifications of ItemID property of the OPC block where this element is inserted,
and taking into consideration Index property (which specifies element position in
OPC Server). Property’s datatype (integer, floating point, string, etc) depends on the
driver to which the element is associated and its parameters.
This property is updated like this if OPC Block’s AllowRead property is True, and
according to scan time defined in Scan property of the OPC Block that contains the
element. If OPC Block’s AllowWrite property is True, you can write values in the
device simply by attributing a new value to Value property.

This is also OPC Block Element’s default property. So, it is not mandatory for a
value reference to an OPC Block Element to make Value property explicit in order
to access value. In case the property is not updated, check if Index property is
correctly set (its value must be zero up to OPC block’s size minus one).

Example:
Properties 201
E3 - Scripts - Reference Manual

Sub Botao1_Click()
'Accesses an element and shows current value
'elm1 é is an OPC block Element
Setobj = Application.GetObject_
("OPCDriver1.Group1.OPCBlock1.elm1")
MsgBox " elm1’s current value: " & obj.Value
'This can also be done in a different way,
'with no need to show Value property, which is default
MsgBox " elm1’s current value: " & obj
End Sub

Property Quality

Quality: Represents value quality status. E3 uses OPC pattern to inform this
property. The field is formed by a 16-bit word, and the 8 first bits are defined in
three bit fields: Quality, Substatus, and Limit, arranged like this: QQSSSSLL.
Quality can be: bad, uncertain, or good (see following table). Substatus contains
additional information about Quality. Limit indicates diagnosis information. Servers
that cannot support these types of information return 0 in the corresponding bits.
The other 8 bits (of a higher order) are available for use from each manufacturer. If
those bits are used, default quality bits are still used to indicate which deductions can
be made over the returned data. So, it is the client’s responsibility to interpret the
specific quality information field to make sure the server providing this information
uses the same “rules” as the client.
OPC drivers or servers that do not support quality information always return 192
value (good quality). It is also acceptable for a server to simply return bad (0) or
good (192) quality, and not to pass out any substatus or limit information in bits.
A list with possible values for Quality, as well as their meaning, can be seen in the
following tables.

Quality Field
BAND QUALITY DESCRIPTION
MR F BAD Value cannot be used for the reasons indicated
in substatus.
I R 9:O UNCERTAIN Value’s quality is uncertain for the reasons
indicated in substatus.
9:K R 9P9 (Reserved) Not used in OPC pattern.
9P: > :LL GOOD Value’s quality is good

202 Properties
E3 - Scripts - Reference Manual

Limit Field
SPECIFICATIONS DESCRIPTION
; + The value is free to move up or down
+ The value has “pegged” at some lower limit
E.2 + The value has “pegged” at some high limit
The value is a constant and cannot move

Substatus for BAD Quality (0-63)


SUBSTATUS DESCRIPTION LIMITS

Constant
Limited

Limited

Limited
High
Low
Not
; > '$ $ The value is bad, but no specific 000 001 002 003
reason is known.
., There is some server specific 004 005 006 007
! problem with the configuration. For
example, the item is question has
been deleted from the
configuration.
; $+ The input is required to be logically 008 009 010 011
connected to something but it is
not. This quality may reflect that no
value is available at this time, for
reasons like the value may have not
been provided by the data source.
= &$ 1 , A device failure has been detected. 012 013 014 015
1 , A sensor failure has been detected 016 017 018 019
(Limit field may provide additional
information).

< Communications have failed. 020 021 022 023


8, However, the last known value is
available. Note that the “age” of the
value may be determined from the
TIMESTAMP in the
OPCITEMSTATE.
,$ Communications have failed. There 024 025 026 027
1 , is no last known value available.
, &$ The block is off scan or otherwise 028 029 030 031
locked This quality is also used
when the active state of the item or
the group containing the item is
InActive.
;/0 Not used by OPC. 032 – 063

Properties 203
E3 - Scripts - Reference Manual

Substatus for UNCERTAIN Quality (64 – 127)


SUBSTATUS DESCRIPTION LIMITS

Constant
Limited

Limited

Limited
High
Low
Not
; > '$ $ There is no specific reason why the 064 065 066 067
value is uncertain.
6 " Whatever was writing this value has 068 069 070 071
8, stopped doing so. The returned value
should be regarded as “stale”. Note that
this differs from a BAD value with
Substatus 5 (Last Known Value). That
status is associated specifically with a
detectable communications error on a
“fetched” value. This error is associated
with the failure of some external source
to “put” something into the value
within an acceptable period of time.
Note that the “age” of the value can be
determined from the TIMESTAMP in
OPCITEMSTATE.
;/0 Not used by OPC 072 - 079
; Either the value has “pegged” at one of 080 081 082 083
0$
$, the sensor limits (in which case the
limit field should be set to 1 or 2) or the
sensor is otherwise known to be out of
calibration via some form of internal
diagnostics (in which case the limit
field should be 0).
!. . The returned value is outside the limits 084 085 086 087
6 defined for this parameter. Note that in
!%$ + + this case the “Limits” field indicates
which limit has been exceeded but does
NOT necessarily imply that the value
cannot move farther out of range.
,">; The value is derived from multiple 088 089 090 091
sources and has less than the required
number of Good sources.
;/0 Not used by OPC 092 – 127

204 Properties
E3 - Scripts - Reference Manual

Substatus for GOOD Quality (192 – 255)


SUBSTATUS DESCRIPTION LIMIT

Low Limited
Not Limited

Constant
Limited
High
; > ' $ $ The value is good. There are no 192 193 194 195
special conditions
;/0 Not used by OPC 196 – 215
$ & + The value has been Overridden. 216 217 218 219
Typically this is means the input
has been disconnected and a
manually entered value has been
“forced”
;/0 Not used by OPC 220 - 255

/$ , ' !

Enabled: Defines whether demo tag variation is activated. If True, demo tag will
update Value property according to the settings in Period and Scan properties.
Otherwise, variation is disabled. Default value is True. Example:
Sub CommandButton1_Click()
Application.GetObject("Dados.TagDemo1").Enabled = True
End Sub

Maximum: Determines maximum tag value. Default value is 100. Example:


Sub CommandButton2_Click()
'When clicking the button, a message box is open,
'indicating TagDemo6's Maximum property value
MsgBox Application.GetObject("Dados.TagDemo6").Maximum
End Sub

Properties 205
E3 - Scripts - Reference Manual

Minimum: Determines maximum tag value. Default value is 0.

Example:
Sub CommandButton2_Click()
'When clicking the button, a message box is open,
'indicating TagDemo6's Minimum property value
MsgBox Application.GetObject("Dados.TagDemo6").Minimum
End Sub

Period: Defines wave shape length, in milliseconds. Does not apply when Type
property is set to either M> + or F> , - . Default value is 10,000 ms.
Example:
Sub Tag Demo1_OnStartRunning()
Period = 1000
End Sub

Scan: Defines time interval between two variations from Value property, in
milliseconds. Use this property to have a greater or smaller amount of data generated
by tag demo. Default value is 1,000. Scan value should be over 0.

Example:
Sub Linha1_Click()
Application.GetObject("Dados.TagDemo2").Scan = 200
End Sub

TimeStamp: Updated whenever there is a change in value or status in either


Value or Quality properties. Informs timestamp associated to both value and quality
in demo tag. This is a read-only property. Default value is 00:00:00.

206 Properties
E3 - Scripts - Reference Manual

Type: Defines tag’s wave type. Modify this property according to the table below.
When Type is set to 3 (CurrentTime), Value property will contain current timestamp from
the server.

Available options for Type


VALUE WAVE SHAPE

M Random

9 Sine

: Square

F N/A CurrentTime
I RampUp

L RampDown

RampUpDown

Example:
Sub Line1_Click()
Application.GetObject("Dados.TagDemo2").Type = 2
End Sub

Value: Varies according to the type of wave shape in Type property. This is a
read-only property. Default value is 0. Example:
Sub CommandButton1_Click()
MsgBox Application.GetObject("Dados.TagDemo2").Value=10
End Sub

/. !

Quality: Informs about the quality of the value in Value property. This property is
write/read, but whenever Internal Tag’s value is modified (be it by a script or an
association), it will be updated accordingly. Example:
Sub CommandButton1_Click()
MsgBox Application.GetObject("Dados.TagInterno1").Quality
End Sub

For further information on quality, see the topic “Quality” in the User’s Manual.

Properties 207
E3 - Scripts - Reference Manual

Retentive: If True, internal tag’s value will be stored automatically, in case


servers in the active domain switch. This guarantees that tag value will be
synchronized to a standby server. So, when the server is running, tag value will be
the same as the server that has stopped. Otherwise, tag value will be adjusted to the
initial value whenever the domain has been executed, or active servers switch. This
property has no effect if altered in execution. Example:
Sub CommandButton1_Click()
Dim status
status = Application.GetObject("Dados.TagInterno1").Retentive
MsgBox status
Select Case status
Case True
MsgBox "Internal tag’s value will be _
stored automatically."
Case False
MsgBox "Internal tag’s value will be adjusted _
to its initial value whenever domain is _
executed or active server is changed."
End Select
End Sub

NOTE: This property is valid only for internal tags within the Server. Internal tags
within the Viewer cannot be retentive.

TimeStamp: Informs the timestamp associated to the value in Value property.


This property is write/read, but whenever Internal Tag’s value is modified (be it by a
script or an association), it will be updated accordingly.

Value: Value property is a Variant type, which allows storing values of every and
any type, from an integer to objects’ references. Use it to store values inside the
Viewer or the Server, and to exchange data among the several points of its
application. Default value is empty. This property is read/write. Example:
Sub Months_OnStartRunning()
'Months is an InternalTag.
'Uses the event to initialize the vector.
Value = Array("January","February", "March", _
"April", "May", "June", "July", "August", _
"September", "October", "November", "December")
End Sub

208 Properties
E3 - Scripts - Reference Manual

//
NOTE: Some of properties use HIMETRIC unit system. In HIMETRIC system,
each unit is equivalent to a thousandth centimeter; that is, 1,000 units equals to 1
centimeter. So, this is the measurement pattern adopted for properties in this manual,
when necessary.

BackgroundColor: Specifies Screen filling background color. Use VBScript’s


RGB() function to compose the color to be associated to this property. Default value
is gray (RGB(192, 192, 192)).

Caption: Defines the title to be used on the title bar when this Screen is shown in
Viewer.

FillStyle: Defines Screen fill style. The following table shows the valid values
for this property:

Available options for FillStyle


OPTION DESCRIPTION
M> "( + Solid fill (default)
:> "( E 3 Horizontal stripes fill
F> "( 8 $ Vertical stripes fill
I>"( = + Downward diagonal stripes fill.
L>"( 6' + Upward diagonal stripes fill.
>"( Crossed stripes fill.
O>"(= . Crossed diagonal fill.
K>"( + Gradient fill, using both ForegroundColor and
BackgroundColor. The effect is defined by
GradientStyle property.
99> "( $ (
. ,+ Uses Backgroundcolor.
9: > "( $, Fills the Screen with the picture selected in
PictureFile property.

ForegroundColor: Specifies Screen filling foreground color. Use VBScript’s


RGB() function to compose the color to be associated to this property. Default value
is black (RGB(0, 0, 0)). Applications assembled previously to the introduction of
this property will have both ForegroundColor and BackgroundColor properties set
with the color stored in BackgroundColor property, and fill style set to 99>
"( $ (. , +, which will paint the whole Screen with the background color
(former behavior).

Properties 209
E3 - Scripts - Reference Manual

Example:
Sub Tela1_Click()
'Switches background color to blue
ForegroundColor = RGB(0, 0, 255)
End Sub

Frame: Returns the object’s parent frame. This property is available in runtime
only.

GradientStyle: Specifies the Screen’s gradient fill style. Used only when
FillStyle is set to 8 (gradient). Gradient ranges from ForegroundColor to
BackgroundColor.

Available options for GradientStyle


OPTIONS DESCRIPTION
M> - .2 Vertical gradient from left to right.
9> .2- Vertical gradient from right to left.
:> 8 1 Vertical gradient from center to edges.
F> 8 - Vertical gradient from edges to center.
I> 6' Horizontal gradient botton up.
L> - '= Horizontal gradient top down.
>E 3 1 Horizontal gradient from center to edges.
O> E 3 - Horizontal gradient from edges to center.
K> = .6' .2 Upward diagonal gradient with foreground color to
the right. (Default)
P> = .6' Upward diagonal gradient with foreground color to
the left
9M> = .6'1 Upward diagonal gradient from center to edges.
99> = .6'- Upward diagonal gradient from edges to center.
9:> = .= Downward diagonal gradient with foreground color
to the left
9F> = .= .2 Downward diagonal gradient with foreground color
to the right
9I> = .= 1 Downward diagonal gradient from center to edges.
9L> = .= - Downward diagonal gradient from edges to center.
9 > ' ,2! Gradient with foreground spot from Southeast.
9O> ' ,25 Gradient with foreground spot from Southwest
9K> ' ; 25 Gradient with foreground spot from Northwest.
9P> ' ; 2! Gradient with foreground spot from Northeast.
:M> ' 1 Gradient with foreground spot from center to edges.
:9> ' - Gradient with foreground spot from edges to center.

210 Properties
E3 - Scripts - Reference Manual

HasFocus: Determines whether the selected object has focus. This property is
available in runtime only.

Height: Defines Screen height, in Himetric units.

Layer: Shows objects on the Screen, according to the layers they are in. For
Screen objects, you can define up to 32 layers, so that they can be clustered logically
(e.g.: hydraulic layer objects, electric layer objects etc.), and shown/hidden just by
modifying the mask of the Screen’s Layer property. For the object to appear on the
Screen, Layer property should contain at least 1 bit set at the same position where
the Screen layer is.

Picture 27: Options available on the Properties List.

NOTE: Object’s visibility depends on three factors: Visible property set to True;
parent-object visible; and object’s Layer property present in Screen Layer.

MouseOver: Tells whether mouse cursor is on Screen. If so, the property is


enabled. Otherwise, it is False. This property is read-only, and its default value is
False. This property is available in runtime only.

MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. This property is available in runtime only.

PictureFile: Contains the filename of the picture to be used as Screen


background. It can be any format already supported by E3 in DrawPicture object
(*.bmp;*.gif;*.jpg;*.cur;*.ico;*.emf;*.wmf). Default value is a blank string. This
property is valid only when FillStyle property is set to 9: R "( $, .

Properties 211
E3 - Scripts - Reference Manual

PicturePosition: Indicates the position the picture selected at PictureFile


property will assume on Screen. This property is valid only when FillStyle property
is set to 9: R "( $, . The available options are:

Available options for PicturePosition


OPTION DESCRIPTION
M> Picture in its original size, centered on Screen.
9>- Picture in its original size, in as many tiles as
necessary to fit the Screen.
:> 2 Picture resized to fit the Screen.
$
F > -' Picture in its original size, on the Screen’s upper left
corner.
I> Picture in its original size, on the Screen’s lower left
corner.
L> .2 Picture in its original size, on the Screen’s lower
right corner.
> - ' .2 Picture in its original size, on the Screen’s upper
right corner.

Screen: Returns the object’s parent Screen. This property is available in runtime
only.

TabStop: Determines whether TAB key can be used in the system. If True,
-0 key use is enabled. Otherwise, the key cannot be used.

Width: Defines Screen’s width, in Himetric units.

212 Properties
E3 - Scripts - Reference Manual

/0 1 '

/0 1 ' -

Caption: Defines the title to be used on the title bar when this frame is shown in
Viewer.

/0

Border: If True, enables splitter border. Otherwise, the splitter will have no
border. Default value is True.

IsHTML: Returns True if the splitter has HTMLs inserted in it. Otherwise, it
returns False.

Resizable: Determines how the frame/splitter will be split. If True, the options
for horizontal and vertical split are enabled. Otherwise, they are disabled.

SplitLink: Contains a link that has to be displayed on the splitter. It is possible to


specify a Screen from the project, an executable, or a hyperlink. For Screens, it is possible
to specify zoom percentage and enable scroll bars by using the key “?”, as in the model:
<Screen-name>?<zoom>?<enable-scroll>, where <Screen-name> is the name of the
Screen to be opened; <zoom>, zoom percentage; and <enable-scroll> is 1 for enabling or 0
for disabling. Zoom and Scroll Bar parameters are valid only when the link is a Screen.
Otherwise, they are ignored. Example:
Sub CommandBUtton1_Click()
Application.GetFrame("Divisor1").SplitLink = "Tela1?10?2"
End Sub

SplitPosition: Indicates splitter position on Screen. The value in the field is used
to identify the splitter. Example:
Sub CommandButton1_Click()
Application.GetFrame("Divisor1").SplitPosition
End Sub

SplitType: Determines splitter orientation on frame. You can orient them as the
following:

Properties 213
E3 - Scripts - Reference Manual

Available options for SplitType


OPTION DESCRIPTION
M> ' ; No frame split (default).
9> ' E 3 Horizontal frame split.
:> ' 8 $ Vertical frame split.

Example:
Sub Divisor1_Click()
SplitType = 1
End Sub

SplitUnit: Determines which split unit is used to set frame split. You can specify this
unit either in pixels or in percentage.

Available options for SplitUnit


OPTION DESCRIPTION
M> 6 $ Splits unit into percentage (default)
9> 6 % Splits unit into pixels

SplitValue: Determines the value attributed to frame splitter. Example:


Sub Divisor1_Click()
SplitValue = 10
End Sub

/6
In this topic, the properties of the following Screen Objects are listed: Line,
Rectangle, Round Rectangle, Ellipse, Arc, Freehand, Polygon, Curved Polygon,
Picture, Text, Display, SetPoint, and Scale. Also listed here are the properties of
the object Group, and of Linear and Rotation Sliders. The properties listed below
do not apply to the following objects: ActiveX (MS Forms), E3Chart, E3Browser,
and E3Alarm. These will be explained later, in specific chapters for these objects.

NOTE: Some of properties use HIMETRIC unit system. In HIMETRIC system,


each unit is equivalent to a thousandth centimeter; that is, 1,000 units equals to 1
centimeter. So, this is the measurement pattern adapted for properties in this manual,
when necessary.

214 Properties
E3 - Scripts - Reference Manual

/6 ''

NOTE: The following properties are common to all objects listed above, including
object Group and sliders.

Enabled: Enables/disables the receiving of events from keyboard or mouse.


Default value is True.

Frame: Returns the object’s parent frame. This property is available in runtime
only.

HasFocus: Determines whether the selected object has focus. This property is
available in runtime only.

Height: Defines object height, in Himetric units.

Layer: Shows objects on the Screen, according to the layers they are in. For
Screen objects, you can define up to 32 layers, so that they can be clustered logically
(e.g.: hydraulic layer objects, electric layer objects etc.), and shown/hidden just by
modifying the mask of the Screen’s Layer property. For the object to appear on the
Screen, Layer property should contain at least 1 bit set at the same position where
the Screen layer is.

MouseOver: Tells whether mouse cursor is on Screen. If so, the property is


enabled. Otherwise, it is False. This property is read-only, and its default value is
False. This property is available in runtime only.

MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. This property is available in runtime only.

Screen: Returns the object’s parent Screen. This property is available in runtime
only.

TabStop: Determines whether -0 key can be used in the system. If True,


-0 key use is enabled. Otherwise, the key cannot be used.

Tip: Shows a popup text when the mouse is over the execution object for a brief
moment. Example:

Properties 215
E3 - Scripts - Reference Manual

Sub RetanguloArr1_MouseUp(nButton, nShiftState, x, y)


Tip= "This is a test!"
End Sub

Visible: Defines the object’s visibility. If True, the object is visible, as long as the
following factors are also present: visible object’s parent-object, and object’s Layer
property present on Screen layer.

Width: Determines object’s width.

X: Defines object’s left horizontal coordinate, in HIMETRIC units.

Y: Defines object’s upper vertical coordinate, in HIMETRIC units.

/6 , 2 ''

NOTE: The following properties are common to all Draw Screen Objects (Line,
Rectangle, Round Rectangle, Ellipse, Arc, Freehand, Polygon, and Curved Polygon)
and Text Screen Objects (Text, Display, and SetPoint).

Angle: Defines the rotation angle (in degrees and counterclockwise) the object
should be rotated. It also applies to any possible child-objects, considering each
child’s rotation limit. The object will rotate according to its center, which could be
edited during the rotation operation. Default value is 0 (no rotation).

BackgroundColor: Specifies the object’s background color. Use VBScript’s


RGB() function to compose the color to be associated to this property. Default value
is gray (RGB(192, 192, 192)).

BackgroundStyle: Specifies the object’s background fill style, as follows:


M>- ' = no drawn background; 9> ' Q, = the background is visible.
Enables the use of VerticalPercentFill and HorizontalPercentFill properties with
values different from 100, and also of FillStyle set between 2 and 8. With this, the
remaining area uses BackgroundColor. Example:
Sub Botao1_Click()
'Changes the object’s style when clicked
BackgroundStyle = 1
End Sub

BorderColor: Specifies the object’s border color. Used only in case BorderStyle
property is not set to 5 (null value), because in this case the object has no border.
216 Properties
E3 - Scripts - Reference Manual

Use VBScript’s RGB() function to compose the color to be associated to this


property. Default value is white (RGB (255, 255, 255)), except for the objects
Display and SetPoint, whose default value is dark gray (RGB (128, 128, 128)).

BorderStyle: Determines the style of the border to be applied to the object.

Available options for BorderStyle


OPTION DESCRIPTION
M> ; ____________________
9> = 2 -------------------------------
:> = ...........................................
F> = 2+ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
I> = 2+ + -..-..-..-..-..-..-..-..-..-..-..-..-..
L> ;, No line

BorderWidth: Defines border’s width, in Himetric units. Use it only when


BorderStyle property is not set to 5 (Null). This is actually an exception in E3’s
measurement system, because when its value is 0, it is not defined in HIMETRIC
units, but in pixels: BorderWidth=0 indicates it is one-pixel-wide. Default value is 0.
Example:
Sub CommandButton1_Click()
Screen.Item("Label1").BorderWidth=120
End Sub

Effect3D: Determines 3D effect on the selected object. The options available for
this property are:

Available options for Effect3D


OPTION DESCRIPTION
M> ; F= Transparent (default)
9> + Opaque. When visible, 3D effect is raised.
:> , ( 3D effect is sunken.

Effect3D_X: Specifies 3D effect’s dimension on the object’s horizontal axis (X).


Default value is 30. Example:
Sub Linha1_Click()
Effect3D_X=50
End Sub

Properties 217
E3 - Scripts - Reference Manual

Effect3D_Y: Specifies 3D effect’s dimension on the object’s vertical axis (Y).


Default value is 30. Example:
Sub Linha1_Click()
Effect3D_Y=50
End Sub

Effect3DColorBase: Determines 3D effect’s color in the object’s base. Default


value is black (RGB (0, 0, 0)). Example:
Sub Linha1_Click()
Effect3DColorBase= RGB (0,150,200)
End Sub

Effect3DColorTop: Determines 3D effect’s color on the object’s top. Default


value is white (RGB (255, 255, 255)). Example:
Sub Linha1_Click()
Effect3DColorTop= RGB (0,255,200)
End Sub

FillStyle: Defines object fill style. The following table shows the valid values for
this property:

Available options for FillStyle


OPTION DESCRIPTION
M> + Solid fill (default)
9> E No fill
:> E 3 Horizontal stripes fill
F> 8 $ Vertical stripes fill
I>= + Downward diagonal stripes fill.
L>6' + Upward diagonal stripes fill.
> Crossed stripes fill.
O>= . Crossed diagonal fill.
K> + Gradient fill, using both ForegroundColor and
BackgroundColor. The effect is defined by
GradientStyle property.
P> - ' The object is semi transparent.
9M> , 0 No fill, but the object is sensitive to events.

ForegroundColor: Specifies object’s foreground color. Used when FillStyle


property is set to 0 (solid), or ranging from 2 to 9. Use VBScript’s RGB() function
218 Properties
E3 - Scripts - Reference Manual

to compose the color to be associated to this property. Default value is blue (RGB
(0, 0, 255)), except for the objects Display and SetPoint, whose default value for this
property is white (RGB (255, 255, 255)). Example:
Sub Botao1_Click()
'Foreground color is green
'when object is clicked
ForegroundColor = RGB(0, 255, 0)
End Sub

GradientStyle: Specifies the object’s gradient fill style. Used only when FillStyle
is set to 8 (gradient). Gradient ranges from ForegroundColor to BackgroundColor.

Available options for GradientStyle


OPTIONS DESCRIPTION
M> - .2 Vertical gradient from left to right.
9> .2- Vertical gradient from right to left.
:> 8 1 Vertical gradient from center to edges.
F> 8 - Vertical gradient from edges to center.
I> 6' Horizontal gradient botton up.
L> - '= Horizontal gradient top down.
>E 3 1 Horizontal gradient from center to edges.
O> E 3 - Horizontal gradient from edges to center.
K> = .6' .2 Upward diagonal gradient with foreground color to
the right. (Default)
P> = .6' Upward diagonal gradient with foreground color to
the left
9M> = .6'1 Upward diagonal gradient from center to edges.
99> = .6'- Upward diagonal gradient from edges to center.
9:> = .= Downward diagonal gradient with foreground color
to the left
9F> = .= .2 Downward diagonal gradient with foreground color
to the right
9I> = .= 1 Downward diagonal gradient from center to edges.
9L> = .= - Downward diagonal gradient from edges to center.
9 > ' ,2! Gradient with foreground spot from Southeast.
9O> ' ,25 Gradient with foreground spot from Southwest
9K> ' ; 25 Gradient with foreground spot from Northwest.
9P> ' ; 2! Gradient with foreground spot from Northeast.
:M> ' 1 Gradient with foreground spot from center to edges.
:9> ' - Gradient with foreground spot from edges to center.

IMPORTANT: Too many objects using gradient on Screen imply in damaging both
performance and Screen updating. The use of figures instead can solve the problem.
Properties 219
E3 - Scripts - Reference Manual

Example:
Sub Botao1_Click()
'Object gets gradient
FillStyle = 8 'GradientFill
GradientStyle = 0 'leftToRight
End Sub

HorizontalFillStyle: Defines the style of the object’s horizontal fill. Works jointly
with HorizontalPercentFill property, which tells the percentage of the object to be
filled. These two properties then can simulate level filling like, for example, in a
tank The table below shows the available options for this property.

Available options for HorizontalFillStyle


OPTION DESCRIPTION
M> 1 - .2 Fills from left to right. (Default).
9>1 .2- Fills from right to left.
:>1 - !+. E Fills from center to edges.

Example:
Sub Circulo1_OnStartRunning()
HorizontalFillStyle=2
End Sub

HorizontalPercentFill: Specifies the percentage of the object’s horizontal area to


be filled. Accepts values ranging from 0 to 100. Works jointly with
HorizontalFillStyle property. Default value is 100. Example:
Sub Circulo1_OnStartRunning()
HorizontalPercentFill=200
End Sub

Shadow: Indicates shadow effect upon the object. If True, the object presents a
shadow, whose coordinates are established by ShadowX and ShadowY properties.
Otherwise, the object does not present this effect. Default value is False.

ShadowColor: Specifies the object’s shadow color. This color is used when
Shadow property is set to True. Use VBScript’s RGB() function to compose the
color to be associated to this property. Default value is dark gray (RGB (128, 128,
128)).

220 Properties
E3 - Scripts - Reference Manual

Example:
Sub Botao1_Click()
'Troca a cor de fundo do botao para cinza claro
'quando clica no objeto
ShadowColor = RGB(192, 192, 192)
End Sub

ShadowX: Defines the object’s shadow left vertical coordinate, in Himetric units.
This shadow always relates to the object’s X property. Positive values indicate the
shadow is right to the object; negative values indicate the shadow is left to it.
Default value is 200.

ShadowY: Defines the object shadow’s upper horizontal coordinate, in Himetric


units. This shadow always relates to the object’s Y property. Positive values indicate
the shadow is below the object, negative values indicate the shadow is above it.
Default value is 200.

Example:
Sub Botao1_Click()
ShadowY = 250
End Sub

VerticalFillStyle: Defines the style of the object’s vertical fill. Works jointly with
VerticalPercentFill property, which tells about the object’s percentage to be filled.
The table below shows the available options for this property.

Available options for VerticalFillStyle


OPTION DESCRIPTION
M> 1 - - ' Fills from botton to top.
9>1 - '- Fills from top to bottom.
:>1 - !+. 8 Fills from center to edges.

Example:
Sub Circulo1_OnStartRunning()
VerticalFillStyle= 2
End Sub

Properties 221
E3 - Scripts - Reference Manual

VerticalPercentFill: Specifies the percentage of the object’s vertical area to be


filled. Accepts values ranging from 0 to 100. Works jointly with VerticalFillStyle
property. Default value is 100.

Example:
Sub Circulo1_OnStartRunning()
VerticalPercentFill= 254
End Sub

/ 6" !

RoundAspectX: Defines the rectangle’s lateral dimensions on X axis. So,


according to the value defined by this property, rectangle’s corners will change their
shape, from a square rectangle to an ellipse. Its value can range from 0.1 to 1.0.
Example:
Sub RetanguloArred_Click()
RoundAspectX = 0.5
End Sub

RoundAspectY: Defines the rectangle’s height dimensions on Y axis. So


according to the value defined by this property, rectangle’s corners will change their
shape, from a square rectangle to an ellipse. Its value can range from 0.1 to 1.0.
Example:
Sub RetanguloArred_Click()
RoundAspectY = 0.5
End Sub

/ 6$
ArcBeginAngle: Sets the object arc’s initial angle, in degrees. This property
ranges from 0 to 359. Both arc style and arc shape depend also on ArcEndAngle and
ArcStyle properties. Default value is 0. Example:
Sub CommandButton9_Click()
Screen.Item("Arco1").ArcBeginAngle = 12
End Sub
ArcEndAngle: Sets the object arc’s end angle, in degrees. This property ranges
from 0 to 359. Both arc style and arc shape depend also on ArcBeginAngle and
ArcStyle properties. Default value is 270.

222 Properties
E3 - Scripts - Reference Manual

Example:
Sub CommandButton9_Click()
Screen.Item("Arco1").ArcEndAngle = 12
End Sub

ArcStyle: Specifies the object’s border style. The border is drawn according to
the defined style, using the color specified by BorderColor property, and the width
specified by BorderWidth property. The table below shows the valid values for this
property.

Available options for ArcStyle


OPTION DESCRIPTION
M> $ The style is an arc.
9> $2 + The style is a chord, binding the initial and the final spots.
:> ' The style is a pie. (Default).

Example:
Sub CommandButton9_Click()
Screen.Item("Arco1").ArcStyle = 1
End Sub

/ 6. :, -:

EnableLimits: Checks for limits in the text. If True, and the user inserts a non-
number value, or a value outside the limits defined by MinValue and MaxValue
properties, an Error message is displayed (IsSetPoint property must be True).
Example:
Sub CommandButton1_Click()
Screen.Item("Texto1").EnableLimits = _
Not(Screen.Item("Texto1").EnableLimits)
End Sub

Format: Specifies the type of format to be attributed to the object. It allows changing
the way data is presented without changing their value. You can edit this property
manually, or set it through the formatting window. Its use is similar to format codes on
spreadsheets, following the same basic syntax. The following datatype are supported:

Properties 223
E3 - Scripts - Reference Manual

Datatype supported by Format


DATA DESCRIPTION
;, $ Decimal, scientific, hexadecimal, binary, and octal output.
- % Texts in general.
Boolean values.
= / Gregorian calendar.

IsSetPoint: Determines whether the object allows editing Value property. Value
property is a variant (it can assume any and every type of value) exhibited by Text
object. If True, editing is allowed; otherwise, it is not. It can be viewed when Viewer
object is running. Default value is False.

KeepFormatWhenEditing: Allows you to edit object’s value with or without


keeping its format. The available options are: M R (; & = in this case, the value
is always edited with no formatting (default); and 9 R (0, $= allows the
value to be edited in the formatted value, in case E3 detects it is possible for the
formatted text to be interpreted as a value. In case the value is deemed incompatible,
the value is edited without formatting.

MaxLimits: Contains the maximum value allowed for the object (EnableLimits
property must be True). Example:
Sub CommandButton3_Click()
Screen.Item("Texto1").MaxLimit=Screen.Item("Texto6").Value
End Sub

MinLimits: Contains the minimum value allowed for the object (EnableLimits
property must be True). Example:
Sub CommandButton2_Click()
Screen.Item("Texto1").MinLimit= Screen.Item("Texto5").Value
End Sub

Multiline: This property indicates whether the text will have multiple lines (True)
or be a simple text box (False). It can be viewed when Viewer is running. Default
value is False. Example:
Sub Tela1_OnStartRunning()
Screen.Item("TextBox1").Multiline=True
End Sub

224 Properties
E3 - Scripts - Reference Manual

SetPointDataType: Type of value sent from SetPoint to tag.

Available options for SetPointDataType


OPTION DESCRIPTION
M> , -4
' Maintains current type.
9> 2 8-bit signed integer value.
:> 4 8-bit unsigned integer value.
F> 5 + 16-bit unsigned integer value.
I> . 16-bit signed integer value.
L> . 32-bit signed integer value.
> =5 + 32-bit signed integer value.
O> . 32-bit floating-point value.
K> = ," 64-bit floating-point value.
P> = - Date/time value.
9M> . Text (string).

When the typed text is sent by the SetPoint, it will first try to convert the value to the
set type (Word, String, Double etc.). If conversion is not possible—that is, the typed
value is not valid for the chosen type—no value is sent (e.g., if the user types “-1”,
and the type is Byte). But when property value is 0-stCurrentType, the datatype sent
by the SetPoint comes from the previous value present in the object. In case it is
empty, or null, no conversion will be made, and typed value will be sent as text.
Example:
Sub Combobox1_Change()
Screen.Item("Texto1").SetPointDataType=CInt(Left(Value,2))
End Sub

StretchText: Resizes object type. When enabled, the object automatically resizes
text font size so that the area the object occupies always remains the same.
Otherwise, if the property is set to False, no resizing will take place.

TextAlignment: Specifies horizontal alignment of the text displayed in the object.

Available options for TextAlignment


OPTION DESCRIPTION
M> 0. Text aligns to the left.
9> 0. Text aligns to the center.
:> .20 . Text aligns to the right.

Properties 225
E3 - Scripts - Reference Manual

TextColor: Specifies font color in the text. Use VBScript’s RGB() function to
compose the color to be associated to this property. Default value is black (RGB(0,
0, 0)).

TextFont: Defines the type of font to be used in the object. This property cannot be
used in scripts and/or associations, and it is configured only via Studio.

Value: Value property is a variant (it can assume any and every type of value)
exhibited by the object. Usually this property contains text, because it is
automatically filled when the creation of a new Text object occurs. IsSetPoint
property determines whether the object allows the edition of Value property.
Example:
Sub DrawString1_OnStartRunning()
'Reads tag value and displays a Text
Dim obj
Set obj = Application.GetObject("DataServer1.DemoTag1")
Value = "Valor de DemoTag1 = " & obj.Value
End Sub

VertTextAlignment: Specifies vertical alignment of the text displayed in the


object.

Available options for VertTextAlignment


OPTION DESCRIPTION
M>- '0 . Text aligns to the top.
9> +0 . Text aligns to the center.
:> 0. Text aligns to the botton.

WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.

/ 6/

BackgroundColor: Specifies the object’s background color. Use VBScript’s


RGB() function to compose the color to be associated to this property. Default value
is gray (RGB (192, 192, 192)).

BackgroundStyle: Specifies the object’s background fill style, as follows:


M>- ' = no drawn background; 9> ' Q, = the background is visible.
226 Properties
E3 - Scripts - Reference Manual

Enables the use of VerticalPercentFill and HorizontalPercentFill properties with


values different from 100, and also of FillStyle set between 2 and 8. The remaining
area then uses BackgroundColor. Example:
Sub Botao1_Click()
'Changes the object’s style when clicked
BackgroundStyle = 1
End Sub

Convert: Allows converting the figure. If 0, conversion can be seen. If 1, it is not


possible to view this conversion. This property only accepts 0 and 1 as valid values.
Default value is 0.

EnableOverrideLineColor: Enables/disables overriding the object line’s original


color by the color defined in OverrideLineColor property. If True, the original color
is overridden by the color defined in OverrideLineColor property. Otherwise, the
original color is maintained.

Filename: Defines the filename of the picture associated to this object. Filepath
could be either the complete filepath on disk or the path related to the application
(when picture file is inserted as an application resource). Default value is null. The
following types of figure file are supported:
PROPERTY FILTER DESCRIPTION FILTER
Bitmap file BMP No Yes
Graphics Interchange GIF No Yes
Format
Joint Picture Expert JPG No Yes
Group
Icon File ICO No Yes

HorizontalFillStyle: Defines the style of the object’s horizontal fill. Works jointly
with HorizontalPercentFill property, which tells the percentage of the object to be
filled. These two properties then can simulate level filling like, for example, in a
tank The table below shows the available options for this property.

Available options for HorizontalFillStyle


OPTION DESCRIPTION
M> 1 - .2 Fills from left to right. (Default).
9>1 .2- Fills from right to left.
:>1 - !+. E Fills from center to edges.

Properties 227
E3 - Scripts - Reference Manual

Example:
Sub Circulo1_OnStartRunning()
HorizontalFillStyle=2
End Sub

HorizontalPercentFill: Specifies the percentage of the object’s horizontal area to


be filled. Accepts values ranging from 0 to 100. Works jointly with
HorizontalFillStyle property. Default value is 100.

Example:
Sub Circulo1_OnStartRunning()
HorizontalPercentFill=200
End Sub

OverrideFillColor: When OverrideFillMode property is set for values 2 or 3,


OverrideFillColor property is used to define which color will fill the figure, instead
of its original color. Use VBScript’s RGB() function to compose the color to be
associated to this property. This property’s default value is red (RGB(255, 0, 0)).

Example:
Sub DrawPicture1_Click()
'When clicking the object sets
'Override mode to solid and changes
'picture fill color to blue
OverrideFillMode = 2
OverrideFillColor = RGB(0, 0, 255)
End Sub

NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).

228 Properties
E3 - Scripts - Reference Manual

OverrideFillMode: Specifies picture’s fill mode, when displaying a Windows


Metafile. It alters original fill mode without altering the file defined by Filename property.
The table shows the valid values for OverrideFillMode property:

Available options for OverrideFillMode


OPTION DESCRIPTION
M> ; & + The figure maintains its original fill. (Default).
9> 5 + 1 The figure is not filled.
:> +1 The figure is filled by using the color specified by
OverrideFillColor property.
F> 4 .2 The figure is filled by using the color specified by
OverrideFillColor property, but maintains the brightness of its
original color.

Example:
Sub DrawPicture1_Click()
'Ao clicar no objeto seta o modo
'Override para sólido e troca a cor de
'preenchimento da imagem para azul
OverrideFillMode = 2
OverrideFillColor = RGB(0, 0, 255)
End Sub

NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).

OverrideLineColor: When EnableOverrideLineColor property is set to True,


OverrideLineColor is used to define the color to be used on the picture line, instead
of its original color. Use VBScript’s RGB() function to compose the color to be
associated to this property. Default value is red (RGB(255, 0, 0)). Example:
Sub DrawPicture1_Click()
OverrideLineColor = RGB(0, 0, 255)
End Sub

NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).

Shadow: Indicates shadow effect upon the object. If True, the object presents a
shadow, whose coordinates are established by ShadowX and ShadowY properties.
Otherwise, the object does not present this effect. Default value is False.

ShadowColor: Specifies the object’s shadow color. This color is used when
Shadow property is set to True. Use VBScript’s RGB() function to compose the
Properties 229
E3 - Scripts - Reference Manual

color to be associated to this property. Default value is dark gray (RGB (128, 128,
128)). Example:
Sub Botao1_Click()
'Troca a cor de fundo do botao para cinza claro
'quando clica no objeto
ShadowColor = RGB(192, 192, 192)
End Sub

NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).

ShadowX: Defines the object’s shadow left vertical coordinate, in Himetric units.
This shadow always relates to the object’s X property. Positive values indicate the
shadow is right to the object; negative values indicate the shadow is left to it.
Default value is 200.

ShadowY: Defines the object shadow’s upper horizontal coordinate, in Himetric


units. This shadow always relates to the object’s Y property. Positive values indicate
the shadow is below the object, negative values indicate the shadow is above it.
Default value is 200. Example:
Sub Botao1_Click()
ShadowY = 250
End Sub

NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).

TransparentColor: When TransparentMode property is set to 1, TransparentColor


property indicates which color in the picture remains transparent. Use VBScript’s RGB()
function to compose the color to be associated to this property. Default value is white
(RGB(255, 255, 255)). Example:
Sub DrawPicture1_Click()
'Deixa a cor da imagem azul transparente
'quando clica no objeto Figura
TransparentMode = 1 'ByColor
TransparentColor = RGB(0, 0, 255)
End Sub

NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).

230 Properties
E3 - Scripts - Reference Manual

TransparentMode: Specifies the picture’s transparency mode, according to the


table:

Available options for TransparentMode


OPTION DESCRIPTION
M> = " + The picture has no transparent spots.
9> 4 The picture is transparent in the color specified by
TransparentColor property.
:> 4 $ The picture is semi-transparent, and the percentage of
transparency is specified by TransparentPercent property.

Example:
Sub DrawPicture1_Click()
'Turns image blue color transparent
'when Picture is clicked
TransparentMode = 1 'ByColor
TransparentColor = RGB(0, 0, 255)
End Sub

NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).

TransparentPercent: When TransparentMode property is set to 2,


TransparentPercent property indicates how transparent the figure will be, ranging from 0
(totally transparent) to 100 (opaque—solid). Example:
Sub DrawPicture1_Click()
'The image is translucent when the object is clicked
TransparentMode = 1 'ByPercent
TransparentPercent = 50 '50% translucent
End Sub

NOTE: This property only works when Picture is working with metafiles (WMF or
EMF).

Properties 231
E3 - Scripts - Reference Manual

VerticalFillStyle: Defines the style of the object’s vertical fill. Works jointly with
VerticalPercentFill property, which tells about the object’s percentage to be filled.
The table below shows the available options for this property.

Available options for VerticalFillStyle


OPTION DESCRIPTION
M> 1 --' Fills from bottom to top.
9>1 - '- Fills from top to bottom.
:>1 - !+. 8 Fills from center to edges.

Example:
Sub Circulo1_OnStartRunning()
VerticalFillStyle= 2
End Sub

VerticalPercentFill: Specifies the percentage of the object’s vertical area to be


filled. Accepts values ranging from 0 to 100. Works jointly with VerticalFillStyle
property. Default value is 100. Example:
Sub Circulo1_OnStartRunning()
VerticalPercentFill= 254
End Sub

/ 60

Angle: Defines the rotation angle (in degrees and counterclockwise) the object
should be rotated. It also applies to any possible child-objects, considering each
child’s rotation limit. The object will rotate according to its center, which could be
edited during the rotation operation. Default value is 0 (no rotation).

BackgroundColor: Specifies the object’s background color. Use VBScript’s


RGB() function to compose the color to be associated to this property. Default value
is gray (RGB(192, 192, 192)).

232 Properties
E3 - Scripts - Reference Manual

BorderColor: Determines the color of the border to be applied to the object.


Default value is white (RGB (255, 255, 255)). Example:
Sub Escala1_Click()
BorderColor = RGB (255,0,0)
End Sub

BorderStyle: Determines the style of the border to be applied to the object.

Available options for BorderStyle


OPTION DESCRIPTION
M> ; ____________________
9> = 2 -------------------------------
:> = ...........................................
F> = 2+ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
I> = 2+ + -..-..-..-..-..-..-..-..-..-..-..-..-..
L> ;, No line

Example:
Sub Escala1_Click()
BorderStyle = 1
End Sub

BorderWidth: Determines border width of Scale object, in pixels. Default value is 0.


Example:
Sub CommandButton1_Click()
Screen.Item("Escala1").BorderWidth=120
End Sub

Properties 233
E3 - Scripts - Reference Manual

FillStyle: Defines object fill style. The following table shows the valid values for
this property:

Available options for FillStyle


OPTION DESCRIPTION
M> + Solid fill.
9> E No fill
:> E 3 Horizontal stripes fill
F> 8 $ Vertical stripes fill
I>= + Downward diagonal stripes fill.
L>6' + Upward diagonal stripes fill.
> Crossed stripes fill.
O>= . Crossed diagonal fill.
K> + Gradient fill, using both ForegroundColor and
BackgroundColor. The effect is defined by
GradientStyle property.
P> - ' The object is semi transparent.
9M> , 0 No fill, but the object is sensitive to events (default).

ForegroundColor: Specifies object’s foreground color. Used when FillStyle


property is set to 0 (solid), or ranging from 2 to 9. Use VBScript’s RGB() function
to compose the color to be associated to this property. Default value is blue (RGB
(0, 0, 255)). Example:
Sub Botao1_Click()
'Foreground color is green
'when object is clicked
ForegroundColor = RGB(0, 255, 0)
End Sub

Format: Specifies the type of format to be attributed to the object. It allows changing
the way data is presented without changing their value. You can edit this property
manually, or set it through the formatting window. Its use is similar to format codes on
spreadsheets, following the same basic syntax. The following datatype are supported:

Datatype supported by Format


DATA DESCRIPTION
;, $ Decimal, scientific, hexadecimal, binary, and octal output.
- % Texts in general.
Boolean values.
= / Gregorian calendar.

234 Properties
E3 - Scripts - Reference Manual

GradientStyle: Specifies the object’s gradient fill style. Used only when FillStyle
is set to 8 (gradient). Gradient ranges from ForegroundColor to BackgroundColor.

Available options for GradientStyle


OPTIONS DESCRIPTION
M> - .2 Vertical gradient from left to right.
9> .2- Vertical gradient from right to left.
:> 8 1 Vertical gradient from center to edges.
F> 8 - Vertical gradient from edges to center.
I> 6' Horizontal gradient botton up.
L> - '= Horizontal gradient top down.
> E 31 Horizontal gradient from center to edges.
O> E 3- Horizontal gradient from edges to center.
K> = .6' .2 Upward diagonal gradient with foreground color to
the right. (Default)
P> = .6' Upward diagonal gradient with foreground color to
the left
9M> = .6'1 Upward diagonal gradient from center to edges.
99> = .6'- Upward diagonal gradient from edges to center.
9:> = .= Downward diagonal gradient with foreground color
to the left
9F> = .= .2 Downward diagonal gradient with foreground color
to the right
9I> = .= 1 Downward diagonal gradient from center to edges.
9L> = .= - Downward diagonal gradient from edges to center.
9 > ' ,2! Gradient with foreground spot from Southeast.
9O> ' ,25 Gradient with foreground spot from Southwest
9K> ' ; 25 Gradient with foreground spot from Northwest.
9P> ' ; 2! Gradient with foreground spot from Northeast.
:M> ' 1 Gradient with foreground spot from center to edges.
:9> ' - Gradient with foreground spot from edges to center.

IMPORTANT: Too many objects using gradient on Screen imply in damaging both
performance and Screen updating. The use of figures instead can solve the problem.
Example:
Sub Botao1_Click()
'Object gets gradient
FillStyle = 8 'GradientFill
GradientStyle = 0 'leftToRight
End Sub

LineColor: Determines the color of the line with the scale’s ticks and minor
ticks. To determine the color of the subtitle with the numbers, use TextColor
property. Default value is black (RGB (0, 0, 0)).

Properties 235
E3 - Scripts - Reference Manual

MaximumValue: Determines the maximum value achieved by the object. Default


value is 100. Example:
Sub CommandButton_Click()
'when clicking the button, a message box opens
'indicating scale’s maximum value
MsgBox CSTr(Screen.Item("Escala1").MaximumValue)
End Sub

MinimumValue: Determines the minimum value achieved by the object. Default


value is 0. Example:
Sub CommandButton1_Click()
'when clicking the button, a message box opens
'indicating minimum property on TagDemo1
MsgBox _
CSTr(Application.GetObject("Dados.Scala1").MinimumValue)
End Sub

MinorTicks: Determines the number of minor ticks on the scale. Default value is 3.
Example:
Sub CommandButton1_Click()
'shows the total amount of minor ticks on the scale
MsgBox CStr(Screen.Item("Escala1").MinorTicks)
End Sub

MinorTicksPercentSize: Determines minor ticks’ size. Default value is 10.


Example:
Sub CommandButton1_Click()
'determines minor ticks’ size
MsgBox CStr(Screen.Item("Escala1").MinorTicksPercentSize)
End Sub

ScaleAlignment: Determines the type of alignment to be attributed to the scale:


M> .2 + = aligns to the right side (default); 9> + = aligns to the left side.

Example:
Sub CommandButton1_Click()
Screen.Item("Escala1").ScaleAlignment=1
End Sub

236 Properties
E3 - Scripts - Reference Manual

ShowText: Determines whether text is displayed in Scale subtitle. If True, text is


displayed. Otherwise, the object displays only scale lines and minor ticks. Default
value is True. Example:
Sub CommandButton1_Click()
Screen.Item("Escala1").ShowText=True
End Sub

StretchText: Applies stretch to the text in the object (whenever height or width vary,
the text box follows the alteration). If True, the text stretches to accommodate to the
object’s new dimensions. Otherwise, text maintains its original settings. Default value is
False.

TextAlignment: Determines text alignment in the object.

Available options for TextAlignment


OPTION DESCRIPTION
M> 0. Text aligns to the left (default).
9R $ 0. Text aligns to the center.
:R .20 . Text aligns to the right.

TextColor: Determines the color of the font applied to the numbers subtitle on
the Scale. To determine the color of the line with the ticks and minor ticks, use
LineColor property. Default value is black (RGB (0, 0, 0)).

TextFont: Determines font to be applied in the Scale. This property cannot be used
in scripts and/or associations, and it is configured only via Studio.

Ticks: Determines the number of ticks on the scale. Default value is 5.

TickPercentSize: Determines ticks’ size. Default value is 20.

/ 66 >

Angle: Defines the rotation angle (in degrees and counterclockwise) the group
should be rotated. It also applies to any possible child-objects, considering each
child’s rotation limit. The group will rotate according to its center, which could be
edited during the rotation operation. Default value is 0 (no rotation).

EnableOverrideLineColor: Enables the group to override the original line colors


of the objects in the group by the color defined by OverrideLineColor property.
Properties 237
E3 - Scripts - Reference Manual

Otherwise, each object in the group will present its original line color. Default value
is False.

OverrideFillColor: When OverrideFillMode property is set for values 2 or 3,


OverrideFillColor property is used for defining the color to fill the objects in the
group, instead of their original color. Use VBScript’s RGB() function to compose
the color to be associated to this property. Default value is red (RGB(255, 0, 0)).
Example:
Sub DrawGroup1_Click()
'Ao clicar no objeto seta o modo
'Override para sólido e troca a cor de
'preenchimento da imagem para azul
OverrideFillMode = 2
OverrideFillColor = RGB(0, 0, 255)
End Sub

OverrideFillMode: Specifies fill mode of the objects inside the group. Alters original
fill mode without altering the original settings for filling objects. The table shows the valid
values for OverrideFillMode:

Available options for OverrideFillMode


OPTION DESCRIPTION
M> ; & + The objects maintain their original fill mode. (Default).
9> 5 1 The objects are not filled, only their borders are drawn.
:> +1 The objects are filled with the color specified by
OverrideFillColor property.
F> 4 .2 The objects are filled with the color specified by
OverrideFillColor property, but maintains the brightness of their
original color.

Example:
Sub DrawGroup1_Click()
'when clicking the object sets
'Override Mode to solid and changes fill color
'to blue
OverrideFillMode = 2
OverrideFillColor = RGB(0, 0, 255)
End Sub

OverrideLineColor: When EnableOverrideLineColor property is set to True,


OverrideLineColor property is used to define the color to be used on object lines,
238 Properties
E3 - Scripts - Reference Manual

instead of their original color. Use VBScript’s RGB() function to compose the color
to be associated to this property. Default value is red (RGB(255, 0, 0)). Example:
Sub Grupo1_Click()
OverrideLineColor = RGB (255,0,0)
End Sub

Shadow: Indicates shadow effect upon the object. If True, the object presents a
shadow, whose coordinates are established by ShadowX and ShadowY properties.
Otherwise, the object does not present this effect. Default value is False.

ShadowColor: Specifies the group’s shadow color. This color is used when
Shadow property is set to True. Use VBScript’s RGB() function to compose the
color to be associated to this property. Default value is dark gray (RGB (128, 128,
128)). Example:
Sub Botao1_Click()
'Troca a cor de fundo do botao para cinza claro
'quando clica no objeto
ShadowColor = RGB(192, 192, 192)
End Sub

ShadowX: Defines the object’s shadow left vertical coordinate, in Himetric units.
This shadow always relates to the object’s X property. Positive values indicate the
shadow is right to the object; negative values indicate the shadow is left to it.
Default value is 200.

ShadowY: Defines the group shadow’s upper horizontal coordinate, in Himetric


units. This shadow always relates to the object’s Y property. Positive values indicate
the shadow is below the object, negative values indicate the shadow is above it.
Default value is 200. Example:
Sub Botao1_Click()
ShadowY = 250
End Sub

/ 67 ?4 @

Angle: Defines the rotation angle (in degrees and counterclockwise) the object
should be rotated. It also applies to any possible child-objects, considering each
child’s rotation limit. The object will rotate according to its center, which could be
edited during the rotation operation. Default value is 0 (no rotation).

Properties 239
E3 - Scripts - Reference Manual

Detents: Determines the number of detents in the object. Example:


Sub CommandButton1_Click()
MsgBox Screen.Item("DynamicRotate1").Detents
End Sub

EnableOverrideLineColor: Enables the object to override the original line colors


of the object by the color defined by OverrideLineColor property. Otherwise, each
object in the group will present its original line color. Default value is False.

EnableSlider: If True, enables movement slider. Otherwise, movement slider is


disabled.

OverrideFillColor: When OverrideFillMode property is set for values 2 or 3,


OverrideFillColor property is used for defining the color to fill the object, instead of
its original color. Use VBScript’s RGB() function to compose the color to be
associated to this property. Default value is red (RGB(255, 0, 0)). Example:
Sub DrawGroup1_Click()
'when clicking the object sets
'Override mode to solid and changes
'fill color to blue
OverrideFillMode = 2
OverrideFillColor = RGB(0, 0, 255)
End Sub

OverrideFillMode: Specifies fill mode on the object being slided. Alters original fill
mode without altering the original settings for filling objects. The table shows the valid
values for OverrideFillMode:

Available options for OverrideFillMode


OPTION DESCRIPTION
M> ; & + The objects maintain their original fill mode. (Default).
9> 5 1 The objects are not filled, only their borders are drawn.
:> +1 The objects are filled with the color specified by
OverrideFillColor property.
F> 4 .2 The objects are filled with the color specified by
OverrideFillColor property, but maintains the brightness of their
original color.

240 Properties
E3 - Scripts - Reference Manual

Example:
Sub DrawGroup1_Click()
'when clicking the object sets
'Override Mode to solid and changes fill color
'to blue
OverrideFillMode = 2
OverrideFillColor = RGB(0, 0, 255)
End Sub

OverrideLineColor: When EnableOverrideLineColor property is set to True,


OverrideLineColor property is used to define the color to be used on object lines,
instead of their original color. Use VBScript’s RGB() function to compose the color
to be associated to this property. Default value is red (RGB(255, 0, 0)). Example:
Sub Grupo1_Click()
OverrideLineColor = RGB (255,0,0)
End Sub

RangeMax: Determines maximum range of the object’s linear or rotation slide.


Example:
Sub CommandButton1_Click()
MsgBox Screen.Item("DynamicMove1").RangeMax
End Sub

RangeMin: Determines minimum range of the object’s linear or rotation slide.


Example:
Sub CommandButton1_Click()
MsgBox Screen.Item("DynamicMove1").RangeMin
End Sub

Shadow: Indicates shadow effect upon the object. If True, the object presents a
shadow, whose coordinates are established by ShadowX and ShadowY properties.
Otherwise, the object does not present this effect. Default value is False.

ShadowColor: Specifies the object’s shadow color. This color is used when
Shadow property is set to True. Use VBScript’s RGB() function to compose the
color to be associated to this property. Default value is dark gray (RGB (128, 128,
128)).

Properties 241
E3 - Scripts - Reference Manual

Example:
Sub Botao1_Click()
'Troca a cor de fundo do botao para cinza claro
'quando clica no objeto
ShadowColor = RGB(192, 192, 192)
End Sub

ShadowX: Defines the object’s shadow left vertical coordinate, in Himetric units.
This shadow always relates to the object’s X property. Positive values indicate the
shadow is right to the object; negative values indicate the shadow is left to it.
Default value is 200.

ShadowY: Defines the object shadow’s upper horizontal coordinate, in Himetric


units. This shadow always relates to the object’s Y property. Positive values indicate
the shadow is below the object, negative values indicate the shadow is above it.
Default value is 200. Example:
Sub Botao1_Click()
ShadowY = 250
End Sub

Value: Slide’s initial value. It must be a value between the values set in
RangeMax and RangeMin properties.

242 Properties
E3 - Scripts - Reference Manual

/6 <

RotationAngle: Determines the object’s rotation angle. Example:


Sub CommandButton1_DbClick()
Screen.Item("DynamicMove1").RotationAngle = 180
End Sub

RotationDirection: Determines the object’s rotation orientation.

Available options for RotationDirection


OPTION DESCRIPTION
M> $
( Directs rotation angle clockwise.
9> , $(5 Directs rotation angle anti-clockwise.

Example:
Sub CommandButton1_Click()
Screen.Item("DynamicMove1").RotationDirection = 1
End Sub

/7 8
NOTE: Some of properties use HIMETRIC unit system. In HIMETRIC system,
each unit is equivalent to a thousandth centimeter; that is, 1,000 units equals to 1
centimeter. So, this is the measurement pattern adopted for properties in this manual,
when necessary.

/7 ''

BackColor: Specifies the object’s background color. Use VBScript’s RGB()


function to compose the color to be associated to this property. Default value for
ComboBox, ListBox, and TextBox is white (RGB (255,255,255)). For the other
objects, it is beige (RGB (236,233,216)).

Enabled: Enables/disables the object, that is, the focus and the answer to events
generated by the user. If True, the object has focus, responds to events generated by
the user, and will be available via scripts (default). Otherwise, the user cannot
interact with the object by using the mouse, pressing keys, or shortcuts, and the
object is then faded. Besides, if the object displays a bitmap, this bitmap is faded
every time whenever the object is disabled.

Properties 243
E3 - Scripts - Reference Manual

• Enabled and Locked properties are interconnected. When both Enabled


and Locked properties are True, the object has focus and appears normally on Screen,
but its data can only be copied, and not edited. When Enabled is True, but Locked is
False, data can not only be copied, but also edited. However, when Enabled is False,
the object has no focus and is faded on Screen, regardless of Locked’s status. Besides,
data can neither be copied nor edited.
• It is possible to match the configurations of Enabled and TabStop
properties to keep the user from selecting a command button with -0 , although it is
still allowed to the user to click the button. Defining TabStop property as False means
the command button will not appear in tabulation order. However, if Enabled is True,
the user can still click the command button, as long as TakeFocusOnClick property is
set to True.

ForeColor: Specifies the object’s foreground color. Use VBScript’s RGB()


function to compose the color to be associated to this property. Default value is
black (RGB (0,0,0)).

Frame: Returns the object’s parent frame. This property is available in runtime
only.

HasFocus: Determines whether the selected object has focus. This property is
available in runtime only.

Height: Determines the object’s height.

Layer: Defines on which layers the object should appear. The value represents a
32-bit mask (a bit per layer), being possible to define up to 32 individual layers. So,
objects can be logically grouped and displayed/hidden just by modifying Layer’s
property mask. At least one of the object’s layers has to be visible for it to be
displayed on Screen; that is, at least 1 bit set at the mask has to be also set at
Screen’s Layer property.

244 Properties
E3 - Scripts - Reference Manual

MouseIcon: This property attaches an image to mouse pointer, whenever the


pointer moves over the object. This property is valid only when MousePointer
property is set as PPU , , .

An image file can be selected to be used at mouse pointer in two different ways: via
Property Window (.cur or .ico extensions); or via scripts, by using LoadPicture()
method to specify name and path of the file with the personalized icon (.cur
extension only). Example:
Sub CommandButton1_Click()
' Atribuindo o item 99-fmMousePointerCustom à propriedade
' para que ela aceite a customização do ícone do mouse
Screen.Item("CheckBox1").MousePointer=99
Screen.Item("CheckBox1").MouseIcon=LoadPicture("C:\a.cur")
End Sub

MouseOver: Tells whether mouse pointer is on Screen. If True, MouseOver is


enabled. Otherwise, it is not. This property is available in runtime only. Default
value is False.

MouseOverChild: Tells whether mouse pointer is on one of the objects inserted


on the Screen. If True, MouseOverChild is enabled. Otherwise, it is not. This
property is available in runtime only. Default value is False.

MousePointer: Specifies the type of mouse pointer displayed when the user
places it over an object. The available options are:

Properties 245
E3 - Scripts - Reference Manual

Available options for MousePointer


OPTION DESCRIPTION
M> , = , Default pointer. The image is
determined by the object. (Default)
9> , 0 Arrow shaped pointer.
:> , Cross shaped pointer.
F> , Beam shaped pointer.
> , 3; Double arrow shaped pointer pointing
northeast and southwest.
O> , 3; Double arrow shaped pointer pointing
north and south.
K> , ;5 Double arrow shaped pointer pointing
northwest and southeast.
P> , 5! Double arrow shaped pointer pointing
west and east.
9M> , 6'0 Arrow shaped pointer pointing up.
99> , E, . Hourglass shaped pointer.
9:> , E '; = ' “Don’t” symbol (a circle crossed
diagonally) shaped pointer. Indicates
invalid destination for dropping.
9F> , 0'' . Arrow shaped pointer with an hourglass
symbol.
9I> , E ' Arrow shaped pointer with question
mark symbol.
9L> , 30 Sizes the cursor to all directions (arrows
pointing north, south, east, and west).
PP> , , Use the icon customized by the
property MouseIcon.

Use this property to indicate functionality alterations as the mouse pointer slides
over the objects on the Screen. For example, an hourglass shaped pointer (option 11)
is useful to indicate that the user should wait for the process or operation to be
finished. Some icons may vary, depending on the system’s configuration, like the
icons associated to the work area themes.

Screen: Returns the object’s Screen-parent. This property is available in runtime


only.

TabStop: Sets the use of -0 key in the system. If True, it is possible to use
the key; otherwise, it cannot be used.

246 Properties
E3 - Scripts - Reference Manual

Tip: Shows a popup text whenever the mouse is briefly over an object that is
running. Example:
Sub RetanguloArr1_MouseUp(nButton, nShiftState, x, y)
Tip= "This is a test!"
End Sub

Visible: Defines the object’s visibility. If True, the object is visible, as long as the
following factors are also present: visible object’s parent-object, and object’s Layer
property present on Screen layer.

Width: Determines object’s width.

X: Defines object’s left horizontal coordinate, in HIMETRIC units.

Y: Defines object’s upper vertical coordinate, in HIMETRIC units.

/7 #+ +

Accelerator: Defines or recovers the object'


s accelerator key. This accelerator key
is a shortcut key used together with 0 key, featuring the object' s focus. Default
value is Empty.

Alignment: Specifies the object's alignment on the Screen relating to its legend. The
available options are: M> 0 . = aligns the legend to the object’s left;
9> 0 . .2 = aligns the legend to the object’s right.

AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the objects CheckBox and OptionButton, if the property is True, the text
will be resized to fit the object’s current size.

BackStyle: Defines the object’s background style. The available options are:
M> $( 4- ' : the object’s background is transparent, with no
drawing; and e 9> $( 4 ' Q, (default): the object’s background is
opaque, with some kind of drawing.

NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.

Caption: Defines the text to be displayed with the object.

Properties 247
E3 - Scripts - Reference Manual

Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.

GroupName: Creates a group of objects mutually exclusive.

NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.

Locked: Enables/disables object edition. If True, edition is not allowed;


otherwise, it is. The value configured for Enabled property influences Locked
property’s behavior. For further details, see Enabled property. Default value is
False.

Picture: Specifies the picture (bitmap) attributed to the object. An image file
can be selected in two ways: via Properties List; or via scripts, by using
LoadPicture function to specify the path and the name of the file containing the
picture. To remove the picture, click the value of Picture property and press =
$(' $ key does not delete the picture. Example:
Sub CommandButton1_Click()
Screen.Item("CheckBox1").Picture =LoadPicture("C:\aba.gif")
End Sub

PicturePosition: Specifies the position of the picture attributed to the object in


Picture property. The available options for this property are:

248 Properties
E3 - Scripts - Reference Manual

Available options for PicturePosition


OPTION DESCRIPTION
M> $, -' Picture to the left of the legend. Legend
aligned to the top of the picture.
9> $, Picture to the left of the legend. Legend
aligned to the center of the picture.
:> $, Picture to the left of the legend. Legend
aligned to the bottom of the picture.
F> $, .2- ' Picture to the right or the legend. Legend
aligned to the top of the picture.
I> $, .2 Picture to the right or the legend. Legend
aligned to the center of the picture.
L> $, .2 Picture to the right or the legend. Legend
aligned to the bottom of the picture.
> $, 0" & Picture above the legend. Legend aligned
to the leftmost part of the picture.
O> $, 0" & Picture above the legend. Legend aligned
to the lowest central part of the picture.
(Default).
K> $, 0" & .2 Picture above the legend. Legend aligned
to the rightmost part of the picture.
P> $, Picture below the legend. Legend aligned
to the leftmost part of the picture.
9M> $, Picture below the legend. Legend aligned
to the highest central part of the picture.
99> $, .2 Picture below the legend. Legend aligned
to the rightmost part of the picture.

SpecialEffect: Specifies the object’s appearance. The options available are:

Available options for SpecialEffect


OPTION DESCRIPTION
M> , ! $1 The object looks flat
:> , ! $ , (+ The object looks sunken

TextAlign: Specifies how the text is aligned in the object. The options available
are:

Available options for TextAlign


OPTION DESCRIPTION
9> - %0 . Aligns the text to the left of the object.
:> - %0 . Aligns the text to the center of the object.
F> - %0 . .2 Aligns the text to the right of the object.

Properties 249
E3 - Scripts - Reference Manual

TripleState: Determines up to three value status for the object. If True, the user
can choose from three status option: False, True, or Null. Null state is displayed with
a shaded button. Otherwise, the user can only choose from the Values True or False.
Default value is False.

Value: Indicates the object’s initial value. Its behavior is Boolean; if True, its
initial status is checked, otherwise it will start unmarked. Default value is False.

WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.

/ 7" ' +

AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the object ComboBox, if the property is True, the text will be resized to fit
the object’s current size.

AutoTab: Enables/disables object’s automatic tabulation. If True, there is


automatic tabulation. Otherwise, there is not.
After the user has typed the maximum number of characters in an object (using
MaxLength property), focus moves automatically to the next object in the tabulation
order, whenever these characters are reached. For example, for a ComboBox to
always display stored data with five characters, you can use MaxLength property to
specify the maximum number of characters to be introduced in the object and
AutoTab property to tabulate automatically to the next object after the user has typed
five characters.
AutoWordSelect: Enables/disables the object’s automatic word selection. If True,
the whole word is selected, with its posterior blank space. Otherwise, just the
indicated character is selected.

BackStyle: Defines the object’s background style. The available options are: MR
$( 4- ' : the object’s background is transparent, with no drawing;
and e 9 R $( 4 ' Q, : the object’s background is opaque, with some kind
of drawing.

NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.

Default value is 1 – fmBackStyleOpaque.

250 Properties
E3 - Scripts - Reference Manual

BorderColor: Defines the color of the border applied to the object. Thus, it is
possible to use the default color, or personalize it during edition. To apply this
property, BorderStyle property must be set to 1 - fmBorderStyleSingle. Default
value is black (RGB (0,0,0)).

BorderStyle: Defines the style of the border applied to the object. The available
options are: MU + 4; : no border; e 9U + 4 .:
simple border.

BoundColumn: Establishes the column where data are stored on the list. For
example, if each line has 8 items, and BoundColumn property is 3, the system stores
information on the third column of the line currently selected. If value is 0, it is
passed to the object’s ListIndex property. If value is 1 or higher, the indicated data is
attributed to the column referring to the value specified in the property. Columns are
numbered from 1.

NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.

CanPaste: Specifies whether transference area contains the data the object
supports. If True, the object can receive information pasted from transference area.
However, if the data in this area are in a format the object does not support, the
property is False. This property is available in runtime only.

Column: Specifies object’s line and column. If only column value is specified,
Column property reads or writes the column specified on the object’s current line.
For example, MyComboBox.Column(3) reads or writes the object’s third column.
This property is available in runtime only.

ColumnCount: Specifies the object’s number of columns. If it is set to 0, no


columns will be shown. If set to -1, all available columns will appear. Default value
is 1.

ColumnHeads: Enables/disables the display of column titles in the object. If


True, the title is displayed. Otherwise, it is not. Default value is False.

ColumnWidths: Specifies the object’s column width, in points. If value is -1 or


blank, width is calculated on the column (minimum width in a calculated column is
72 points=1 inch). If value is 0, column is hidden. To produce narrower columns,
you should specify width in the property, or use one of the values below:

Properties 251
E3 - Scripts - Reference Manual

Available options for ColumnWidths


OPTION DESCRIPTION
PMV
O:V
PM First column is 90 points (1.25 inch) long; second column is
72 points (1 inch) long; third column is 90 points long.
$V
MV $ First column is 6 centimeters long; second column is
hidden; third column is 6 centimeters long. Since the third
column is only partially visible, a horizontal scrollbar
appears.
9L V
MV:L First column is 1.5 inch long; second column is hidden;
third column is 2.5 inches long.
: V
V: First column is 2 inches long; second column is 1 inch long
(default); third column is 2 inches long. Since the third
column is only partially visible, a horizontal scrollbar
appears.
;, All three columns have the same width (1.33 inch). Default
value is null (E3 will use the system’s default value).

CurTargetX: Returns the text insertion horizontal position in the object. This
position is measured in HIMETRIC units. You can use either CurTargetX or CurX
properties to move the insertion point in a text as the user passes over the object’s
content. When the user moves the insertion point to another line in the text,
CurTargetX property specifies the most appropriate position for the text’s insertion
point. CurX property is defined in this value, if the text line is bigger than the value
of CurTargetX. Otherwise, CurX property is defined as the text line end. This
property is available in runtime only.

NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.

CurX: Specifies current text insertion horizontal position in the object. This
property is applied in an object with many lines, that is, whenever Multiline property
is enabled. The return value is valid when the object has focus. You can use either
Multiline or CurX properties to place the text insertion point as the user passes over
the object’s content. When the user moves the insertion point to another line in the
text, CurTargetX property specifies the most appropriate position for the text’s
insertion point. CurX property is defined in this value, if the text line is bigger than
the value of CurTargetX. Otherwise, CurX property is defined as the text line end.
This property is available in runtime only.

DragBehavior: Enables/disables drag-and-drop resource a text in the object’s


content. The available options for this property are: M> = . 2 & = " +:
does not allow drag-and-drop the text in the object’s content; and 9-
= . 2 & ! " +: allows drag-and-drop the text in the object’s content.
Default value is 0.

252 Properties
E3 - Scripts - Reference Manual

NOTE: This property has no effect if Style property is set to 2.

DropButtonStyle: Specifies the symbol displayed on Combo Box’s button. The


options available for this property are:

Available options for DropButtonStyle


OPTION DESCRIPTION
M> = ', 4 Displays a plain style button, with no symbol.
9> = ', 40 Displays a downwards arrow (default).
:> = ', 4 !' Displays an ellipse (..).
F> = ', 4 +,$ Displays a horizontal straight line with an
underlined character.

Default value is 1- fmDropButtonStyleArrow.

EnterFieldBehavior: Controls how text content is selected in the edition area


when [-0 key is pressed on the object, and not when the object receives focus as
the result of SetFocus() method. The available options are: M>
! 1 + 2& $0 (default): selects all the content of the text when
-0 key is pressed on the object; and 9> ! 1 + 2& $ $ :
the selection remains untouched.

Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.

HideSelection: Specifies whether the selected text is still highlighted when the
object does not have focus anymore. If True, the selected text only remains
highlighted in case the object has focus. Otherwise, the object will always appear
highlighted, regardless of the presence of focus in the object. Default value is True.

IMEMode: Specifies the object’s IME mode.

NOTE: This property applies only to applications written in Asian languages, and is
ignored in other applications. It was maintained in the program for compatibility
reasons with the default specifications for Microsoft Forms objects.

The options available are:

Properties 253
E3 - Scripts - Reference Manual

Available options for IMEMode


OPTION DESCRIPTION
M> ! + ; No IME control (default).
9> ! + IME mode on.
:> ! + IME mode off. English mode on.
F> ! + = " IME mode disabled. The user cannot activate
it via keyboard.
I> ! + E . IME Hiragana mode on. (Full width).
L> ! + < ( 1, IME Katakana mode on. (Full width).
> ! + < ( IME Katakana mode on. (Half width).
O> ! + 0'2 1, IME Alphanumeric mode on. (Full width).
K> ! + 0'2 IME Alphanumeric mode on (Half width).
P> ! + E .,1, IME Hangul mode on. (Full width).
9M> ! + E ., IME Hangul mode on. (Half width).
99> ! + E 31, IME Hanzi mode on (Full width).
9:> ! + E 3 IME Hanzi mode on (Half width).

LineCount: Returns the object number of lines. This property is available in


runtime only.

List: Returns or defines column and row entries on the object’s list. Column and
row numbering starts at zero; it means that the number of the first column and of the
first row on the list are zero, the second column and row are 1, and so forth. This
property is available in runtime only.

ListCount: Returns the number of items in the object’s list. This property is
available in runtime only.

ListIndex: Identifies the item currently selected on the list (index). The values of
this property go from -1 to the total amount of rows in a list minus one (that is,
ListCount - 1). When no row is selected, ListIndex returns -1. When the user selects
a row in a Combo Box, the system defines the value of ListIndex property. The list’s
first row value of this property is 0, the second row value is 1, and so forth. This
property is available in runtime only.

ListRows: Determines the maximum amount of rows on the object’s list. Default
value is 8.

ListStyle: Determines the object’s list style. The options available for this
property are: M> 4 : lists the items in a plain style; and 9>
4 ' : displays option buttons or check boxes for a list with several
options—when the user selects an item in the group, the option button linked to the
item is selected, and the buttons linked to the other items in the group are
unchecked. Default value is 0- fmListStylePlain.
254 Properties
E3 - Scripts - Reference Manual

ListWidth: Determines the object’s list width. Default value is 0.

Locked: Enables/disables object edition. If True, edition is not allowed;


otherwise, it is. The value configured for Enabled property influences Locked
property’s behavior. For further details, see Enabled property. Default value is
False.

MatchEntry: Searches for a text entry that matches the data in the object. When
a text instance is found, the line with the text is highlighted, and column content is
displayed.

The options available are: M> $2! 4 1 : searches for the a text entry
whose first letter matches the character typed in the object. If the same letter is typed
repeatedly, it goes to the next text entry beginning with this letter and so forth; 9>
$2! 4 ' : as each character is being typed, the object searches for a
text entry whose characters match the ones being typed; and :>
$2! 4 ; : does not search in the object. Default value is 1-
fmMatchEntryComplete.

MatchFound: Indicates whether the text the user has typed in the object matches
any entry in the box. If True, Value property’s content matches one of the registers
in the box. Otherwise, Value property’s content does not match any of the registers
in the box (default). This property is available only in runtime, and does not apply if
MatchEntry property is set as 2. Default value is False.

MatchRequired: Specifies whether the text typed should match or not the items
in Combo Box. If True, the user cannot leave the box until the text inserted matches
an item in the object. Otherwise, the text inserted in the Combo Box can be different
from all other data in there.

MaxLength: Determines the maximum number of characters in the object. If set


to 0, there will be no character limit in the object.

SelectionMargin: Enables/disables the object’s selection margin. If True, the


text will be selected when you click the object’s margin. Otherwise, the text will not
be selected when you click the margin.

NOTE: If SelectionMargin property is set to True when the object is being printed,
the selection margin will also be printed.

SelLength: Returns the number of characters selected in the object. This property
is available in runtime only.

SelStart: Indicates the starting point of the selected text, or the insertion point if
no text is selected. This property is available in runtime only.
Properties 255
E3 - Scripts - Reference Manual

SelText: Returns the text selected in the object. This property is available in
runtime only.

ShowDropButtonWhen: Specifies when drop button (object’s browsing tool) is


shown. The available options are: M> 2 = ' , 52 ; & : never
shows drop button; 9> 2 = ' , 52 1 $ ,: shows drop button when
the object has focus; and :> 2 = ' , 52 0 4: always shows drop
button.

SpecialEffect: Specifies the object’s appearance. The options available are:

Available options for SpecialEffect


OPTION DESCRIPTION
M> ' $ ! $1 The object looks flat
9> '$ ! $ + The object looks raised.
:> ' $ ! $ , (+ The object looks sunken
F> ' $ ! $!$2 The object borders look etched.
> '$ ! $ , ' The object looks bumped.

Style: Determines the object’s style. The available options are: M>
4 = '= " : the object behaves as a combo (default); and :>
4 = '= : the object behaves as a list.

Text: returns the selected option’s text. This property is available only in
runtime. TextAlign: Specifies how the text is aligned in the object. The options
available are: 9> - %0 . : aligns the text to the left of the object; :>
- %0 . : aligns the text to the center of the object; and F>
- %0 . .2: aligns the text to the right of the object.

TextColumn: Identifies the column in the object. The values for this property go
from -1 to the actual number of columns in the box. TextColumn property’s value for
the first column is 1, for the second column is 2, and so forth. When TextColumn
property is set to 0, the values of ListIndex property will be displayed. When
TextColumn property is set to -1, the first column with ColumnWidths property
value superior to 0 will be displayed.

TextLength: Returns the number of characters typed in the object. This property
is available in runtime only.

TopIndex: Defines or returns the item in the combo which is on the top of the
list. This property returns -1 if the list is empty or hidden.

256 Properties
E3 - Scripts - Reference Manual

Value: It is the value in BoundColumn property of the currently selected rows.


For a ComboBox, changing the contents of Value property does not change the
value of BoundColumn. To add or delete entries in a ComboBox, you can use either
AddItem() or RemoveItem() methods.

/ 7$ '' +

Accelerator: Defines or recovers the object'


s accelerator key. This accelerator key
is a shortcut key used together with 0 key, featuring the object' s focus. Default
value is Empty.

AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the object Command Button, if the property is True, the text will be resized
to fit the object’s current size.

BackStyle: Defines the object’s background style. The available options are: MR
$( 4- ' : the object’s background is transparent, with no drawing;
and e 1 R $( 4 ' Q, : the object’s background is opaque, with some kind
of drawing.

NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.

Default value is 1 – fmBackStyleOpaque.

Caption: Defines the text to be displayed with the object.

Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.

Locked: Enables/disables object edition. If True, edition is not allowed;


otherwise, it is. The value configured for Enabled property influences Locked
property’s behavior. For further details, see Enabled property. Default value is False.

Properties 257
E3 - Scripts - Reference Manual

Picture: Specifies the picture (bitmap) attributed to the object. An image file
can be selected in two ways: via Properties List; or via scripts, by using
LoadPicture function to specify the path and the name of the file containing the
picture. To remove the picture, click the value of Picture property and press =
$(' $ key does not delete the picture. Example:
Sub CommandButton1_Click()
Screen.Item("CheckBox1").Picture =LoadPicture("C:\aba.gif")
End Sub

PicturePosition: Specifies the position of the picture attributed to the object in


Picture property. The available options for this property are:

Available options for PicturePosition


OPTION DESCRIPTION
M> $, - ' Picture to the left of the legend. Legend
aligned to the top of the picture.
9> $, Picture to the left of the legend. Legend
aligned to the center of the picture.
:> $, Picture to the left of the legend. Legend
aligned to the bottom of the picture.
F> $, .2- ' Picture to the right or the legend. Legend
aligned to the top of the picture.
I> $, .2 Picture to the right or the legend. Legend
aligned to the center of the picture.
L> $, .2 Picture to the right or the legend. Legend
aligned to the bottom of the picture.
> $, 0" & Picture above the legend. Legend aligned
to the leftmost part of the picture.
O> $, 0" & Picture above the legend. Legend aligned
to the lowest central part of the picture.
(Default).
K> $, 0" & .2 Picture above the legend. Legend aligned
to the rightmost part of the picture.
P> $, Picture below the legend. Legend aligned
to the leftmost part of the picture.
9M> $, Picture below the legend. Legend aligned
to the highest central part of the picture.
99> $, .2 Picture below the legend. Legend aligned
to the rightmost part of the picture.

TakeFocusOnClick: Specifies whether the object takes focus when clicked. If


True, it does. Otherwise, the object does not take focus when clicked.

258 Properties
E3 - Scripts - Reference Manual

WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.

/ 7. 4

Accelerator: Defines or recovers the object'


s accelerator key. This accelerator key
is a shortcut key used together with [Alt] key, featuring the object's focus. Default
value is Empty.

AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the object Label, if the property is True, the text will be resized to fit the
object’s current size.

BackStyle: Defines the object’s background style. The available options are: MR
$( 4- ' : the object’s background is transparent, with no drawing;
and e 9 R $( 4 ' Q, : the object’s background is opaque, with some kind
of drawing. Default value is 1 – fmBackStyleOpaque.

NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.

BorderColor: Defines the color of the border applied to the object. Thus, it is
possible to use the default color, or personalize it during edition. To apply this
property, BorderStyle property must be set to 9 > + 4 . . Default
value is black (RGB (0,0,0)).

BorderStyle: Defines the style of the border applied to the object. The available
options are: MU + 4; : no border; e 9U + 4 .:
simple border.

Caption: Defines the text to be displayed with the object.

Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.

Picture: Specifies the picture (bitmap) attributed to the object. An image file
can be selected in two ways: via Properties List; or via scripts, by using
LoadPicture function to specify the path and the name of the file containing the
picture. To remove the picture, click the value of Picture property and press =
$(' $ key does not delete the picture.

Properties 259
E3 - Scripts - Reference Manual

Example:
Sub CommandButton1_Click()
Screen.Item("CheckBox1").Picture =LoadPicture("C:\aba.gif")
End Sub

PicturePosition: Specifies the position of the picture attributed to the object in


Picture property. The available options for this property are:

Available options for PicturePosition


OPTION DESCRIPTION
M> $, -' Picture to the left of the legend.
Legend aligned to the top of the
picture.
9> $, Picture to the left of the legend.
Legend aligned to the center of the
picture.
:> $, Picture to the left of the legend.
Legend aligned to the bottom of the
picture.
F> $, .2- ' Picture to the right or the legend.
Legend aligned to the top of the
picture.
I> $, .2 Picture to the right or the legend.
Legend aligned to the center of the
picture.
L> $, .2 Picture to the right or the legend.
Legend aligned to the bottom of the
picture.
> $, 0" & Picture above the legend. Legend
aligned to the leftmost part of the
picture.
O> $, 0" & Picture above the legend. Legend
aligned to the lowest central part of
the picture. (Default).
K> $, 0" & .2 Picture above the legend. Legend
aligned to the rightmost part of the
picture.
P> $, Picture below the legend. Legend
aligned to the leftmost part of the
picture.
9M> $, Picture below the legend. Legend
aligned to the highest central part of
the picture.
99> $, .2 Picture below the legend. Legend
aligned to the rightmost part of the
picture.

260 Properties
E3 - Scripts - Reference Manual

SpecialEffect: Specifies the object’s appearance. The options available are:

Available options for SpecialEffect


OPTION DESCRIPTION
M> ' $ ! $1 The object looks flat
9> '$ ! $ + The object looks raised.
:> ' $ ! $ , (+ The object looks sunken
F> ' $ ! $!$2 The object borders look etched.
> '$ ! $ , ' The object looks bumped.

TextAlign: Specifies how the text is aligned in the object. The options available
are: 9> - %0 . : aligns the text to the left of the object; :>
- %0 . : aligns the text to the center of the object; and F>
- %0 . .2: aligns the text to the right of the object.

WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True. If False, the configuration “white-space:nowrap”
will appear on Style property. Default value is True.

/ 7/ 4 +

BorderColor: Defines the color of the border applied to the object. Thus, it is
possible to use the default color, or personalize it during edition. To apply this
property, BorderStyle property must be set to 1 > + 4 . . Default
value is black (RGB (0,0,0)).

BorderStyle: Defines the style of the border applied to the object. The available
options are: MU + 4; : no border; e 9U + 4 .:
simple border.

BoundColumn: Establishes the column where data are stored on the list. For
example, if each line has 8 items, and BoundColumn property is 3, the system stores
information on the third column of the line currently selected. If value is 0, it is
passed to the object’s ListIndex property. If value is 1 or higher, the indicated data is
attributed to the column referring to the value specified in the property. Columns are
numbered from 1.

NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.

Column: Specifies object’s line and column. If only column value is specified,
Column property reads or writes the column specified on the object’s current line.

Properties 261
E3 - Scripts - Reference Manual

For example, MyComboBox.Column(3) reads or writes the object’s third column.


This property is available in runtime only.

ColumnCount: Specifies the object’s number of columns. If it is set to 0, no


columns will be shown. If set to -1, all available columns will appear. Default value
is 1.

ColumnHeads: Enables/disables the display of column titles in the object. If


True, the title is displayed. Otherwise, it is not. Default value is False.

ColumnWidths: Specifies the object’s column width, in points. If value is -1 or


blank, width is calculated on the column (minimum width in a calculated column is
72 points=1 inch). If value is 0, column is hidden. To produce narrower columns,
you should specify width in the property, or use one of the values below:

Available options for ColumnWidths


OPTION DESCRIPTION
PMV
O:V
PM First column is 90 points (1.25 inch) long; second column is
72 points (1 inch) long; third column is 90 points long.
$V
MV $ First column is 6 centimeters long; second column is
hidden; third column is 6 centimeters long. Since the third
column is only partially visible, a horizontal scrollbar
appears.
9L V
MV:L First column is 1.5 inch long; second column is hidden;
third column is 2.5 inches long.
: V
V: First column is 2 inches long; second column is 1 inch long
(default); third column is 2 inches long. Since the third
column is only partially visible, a horizontal scrollbar
appears.
;, All three columns have the same width (1.33 inch). Default
value is null (E3 will use the system’s default value).

Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.

262 Properties
E3 - Scripts - Reference Manual

IMEMode: Specifies the object’s IME mode.

NOTE: This property applies only to applications written in Asian languages, and is
ignored in other applications. It has no effect at E3, and it was maintained in the
program for compatibility reasons with the default specifications for Microsoft
Forms objects.

The options available are:

Available options for IMEMode


OPTION DESCRIPTION
M> ! + ; No IME control (default).
9> ! + IME mode on.
:> ! + IME mode off. English mode on.
F> ! + = " IME mode disabled. The user cannot activate
it via keyboard.
I> ! + E . IME Hiragana mode on. (Full width).
L> ! + < ( 1, IME Katakana mode on. (Full width).
> ! + < ( IME Katakana mode on. (Half width).
O> ! + 0'2 1, IME Alphanumeric mode on. (Full width).
K> ! + 0'2 IME Alphanumeric mode on (Half width).
P> ! + E .,1, IME Hangul mode on. (Full width).
9M> ! + E ., IME Hangul mode on. (Half width).
99> ! + E 31, IME Hanzi mode on (Full width).
9:> ! + E 3 IME Hanzi mode on (Half width).

IntegralHeight: Adjusts height in text edition area, in case its available area
exceeds object size. If True, its height is adjusted to fit the object’s current size, thus
displaying the whole text. Otherwise, the size of text edition area remains the same.
If a text is bigger than the available space, it will not be displayed in the object.

List: Returns or defines column and row entries on the object’s list. Column and
row numbering starts at zero; it means that the number of the first column and of the
first row on the list are zero, the second column and row are 1, and so forth. This
property is available in runtime only.

ListCount: Returns the number of items in the object’s list. This property is
available in runtime only.

ListIndex: Identifies the item currently selected on the list (index). The values of
this property go from -1 to the total amount of rows in a list minus one (that is,
ListCount - 1). When no row is selected, ListIndex returns -1. When the user selects
a row in a Combo Box, the system defines the value of ListIndex property. The list’s
first row value of this property is 0, the second row value is 1, and so forth. This
property is available in runtime only.

Properties 263
E3 - Scripts - Reference Manual

ListStyle: Determines the object’s list style. The options available for this
property are: M> 4 : lists the items in a plain style; and 9>
4 ' : displays option buttons or check boxes for a list with several
options—when the user selects an item in the group, the option button linked to the
item is selected, and the buttons linked to the other items in the group are
unchecked. Default value is M> 4 .

Locked: Enables/disables object edition. If True, edition is not allowed;


otherwise, it is. The value configured for Enabled property influences Locked
property’s behavior. For further details, see Enabled property. Default value is False.

MatchEntry: Searches for a text entry that matches the data in the object. When
a text instance is found, the line with the text is highlighted, and column content is
displayed.

The options available are: M> $2! 4 1 : searches for the a text entry
whose first letter matches the character typed in the object. If the same letter is typed
repeatedly, it goes to the next text entry beginning with this letter and so forth; 9>
$2! 4 ' : as each character is being typed, the object searches for a
text entry whose characters match the ones being typed; and :>
$2! 4 ; : does not search in the object.

Default value is M> $


2! 4
1 .

MultiSelect: Indicates whether the object allows multiple selections. The


available options for this property areWM> , $ . : only one item can
be selected; 9> , $ , : selects one item via space key or mouse click,
thus checking or unchecking an item on the list; and 2- , $!% + +:
selects one item via SHIFT key and mouse click, or via [[SHIFT]] key and an arrow
key, to select the current item. When [CTRL] key is pressed and the mouse is
clicked, the item will be checked/unchecked. Default value is M>
, $ ..

Selected: Selects/deselects an item, and checks whether an item is selected, when


Multiselect property is True. To check whether the item is selected or not, the items
index must be passed, and the property returns its selection status. So, it is possible
to see which items are selected when the user selects more than one. This property is
available in runtime only.

When multiple selections are not being used, it is recommended the use of Value or
ListIndex properties.

SpecialEffect: Specifies the object’s appearance. The options available are:

264 Properties
E3 - Scripts - Reference Manual

Available options for SpecialEffect


OPTION DESCRIPTION
M> ' $ ! $1 The object looks flat
9> '$ ! $ + The object looks raised.
:> ' $ ! $ , (+ The object looks sunken
F> ' $ ! $!$2 The object borders look etched.
> '$ ! $ , ' The object looks bumped.

Text: returns the selected option’s text. This property is available only in
runtime. TextAlign: Specifies how the text is aligned in the object. The options
available are: 9> - %0 . : aligns the text to the left of the object; :>
- %0 . : aligns the text to the center of the object; and F>
- %0 . .2: aligns the text to the right of the object.

TextColumn: Identifies the column in the object. The values for this property go
from -1 to the actual number of columns in the box. TextColumn property’s value for
the first column is 1, for the second column is 2, and so forth. When TextColumn
property is set to 0, the values of ListIndex property will be displayed. When
TextColumn property is set to -1, the first column with ColumnWidths property
value superior to 0 will be displayed.

TopIndex: Defines or returns the item in the combo which is on the top of the
list. This property returns -1 if the list is empty or hidden.

Value: It is the value in BoundColumn property of the currently selected rows.


This property has no effect at E3, and it was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.

/ 70 +

Delay: Specifies the object’s delay. Delay property affects the duration of time
between consecutive SpinUp, SpinDown and Change events, generated when the
user clicks the scroll bar and keeps it pressed. The first event occurs immediately.
Delay until the second occurrence of the event is five times the value specified for
this property. After this initial occurrence, the interval between events is the one
specified at Delay property.

Default value is 50 ms. This means that the object starts the first event after 250 ms
(five times the specified value), and start the following events after every 50 ms.

LargeChange: Specifies the scroll bar cursor’s number of steps. LargeChange


property’s value is the quantity that alters Value property when the user clicks the
area between scroll box and scroll bar cursor. Any integer will fit at LargeChange

Properties 265
E3 - Scripts - Reference Manual

property, but the recommended interval is from -32.767 to +32.767. Also, this value
should be between the values of Max and Min properties.

Max: Determines the object’s maximum limit.

Min: Determines the object’s minimum limit.

Orientation: Determines object orientation on Screen. The options available for


this property are: >9> 0, : determines orientation automatically,
based on the object’s dimensions, i.e., how it was created; M>
8 $: the object is placed vertically; and 9>
E 3 : the object is placed horizontally. Default value is -9>
0, .

ProportionalThumb: Specifies whether the size of the scroll box is the same as
the object’s dimensions. If True, ScrollBar’s box is as long as the object. Otherwise,
the scroll box remains the same, regardless of the size of the object. Default value is
True.

SmallChange: Specifies the amount of movement that happens when the user
clicks one of the object’s scroll arrows. Default value is 1.

Value: Integer between the values defined for Min and Max properties. It
indicates scroll bar’s initial position. It does not accept values lower than Min or
higher than Max.

/ 76 +

Delay: Specifies the object’s delay. Delay property affects the duration of time
between consecutive SpinUp, SpinDown and Change events, generated when the
user clicks the spin button and keeps it pressed. The first event occurs immediately.
Delay until the second occurrence of the event is five times the value specified for
this property. After this initial occurrence, the interval between events is the one
specified at Delay property.

Default value is 50 ms. This means that the object starts the first event after 250 ms
(five times the specified value), and start the following events after every 50 ms.

Max: Determines the object’s maximum limit.

Min: Determines the object’s minimum limit.

266 Properties
E3 - Scripts - Reference Manual

Orientation: Determines object orientation on Screen. The options available for


this property are: >9> 0, : determines orientation automatically,
based on the object’s dimensions, i.e., how it was created; M>
8 $: the object is placed vertically; and 9>
E 3 : the object is placed horizontally. Default value is -1-
fmOrientationAuto.

SmallChange: Specifies the amount of movement that happens when the user
clicks one of the object’s scroll arrows. Default value is 1.

Value: Integer between the values defined for Min and Max properties. It
indicates spin’s initial value. It does not accept values lower than Min or higher than
Max.

/ 77 +

AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the object Text Box, if the property is True, the text will be resized to fit
the object’s current size.

AutoTab: Enables/disables object’s automatic tabulation. If True, there is


automatic tabulation. Otherwise, there is not.
After the user has typed the maximum number of characters in an object (using
MaxLength property), focus moves automatically to the next object in the tabulation
order, whenever these characters are reached. For example, for a ComboBox to
always display stored data with five characters, you can use MaxLength property to
specify the maximum number of characters to be introduced in the object and
AutoTab property to tabulate automatically to the next object after the user has typed
five characters.
AutoWordSelect: Enables/disables the object’s automatic word selection. If True,
the whole word is selected, with its posterior blank space. Otherwise, just the
indicated character is selected.

BackStyle: Defines the object’s background style. The available options are:
M> $( 4- ' : the object’s background is transparent, with no
drawing; and e 9> $( 4 ' Q, : the object’s background is opaque, with
some kind of drawing. Default value is 1 – fmBackStyleOpaque.

NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.

Properties 267
E3 - Scripts - Reference Manual

BorderColor: Defines the color of the border applied to the object. Thus, it is
possible to use the default color, or personalize it during edition. To apply this
property, BorderStyle property must be set to 1 - fmBorderStyleSingle. Default
value is black (RGB (0,0,0)).

BorderStyle: Defines the style of the border applied to the object. The available
options are: MU + 4; : no border; e 9U + 4 .:
simple border.

CanPaste: Specifies whether transference area contains the data the object
supports. If True, the object can receive information pasted from transference area.
However, if the data in this area are in a format the object does not support, the
property is False. This property is available in runtime only.

CurLine: Specifies the object’s current line, that is, the line that contains the text
insertion point. First line’s number is 0. Default value is 0. CurTargetX: Returns
the text insertion horizontal position in the object. This position is measured in
HIMETRIC units. You can use either CurTargetX or CurX properties to move the
insertion point in a text as the user passes over the object’s content. When the user
moves the insertion point to another line in the text, CurTargetX property specifies
the most appropriate position for the text’s insertion point. CurX property is defined
in this value, if the text line is bigger than the value of CurTargetX. Otherwise, CurX
property is defined as the text line end. This property is available in runtime only.

NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.

CurX: Specifies current text insertion horizontal position in the object. This
property is applied in an object with many lines, that is, whenever Multiline property
is enabled. The return value is valid when the object has focus. You can use either
Multiline or CurX properties to place the text insertion point as the user passes over
the object’s content. When the user moves the insertion point to another line in the
text, CurTargetX property specifies the most appropriate position for the text’s
insertion point. CurX property is defined in this value, if the text line is bigger than
the value of CurTargetX. Otherwise, CurX property is defined as the text line end.
This property is available in runtime only.

DragBehavior: Enables/disables drag-and-drop resource a text in the object’s


content. The available options for this property are: M> = . 2 & = " +:
does not allow drag-and-drop the text in the object’s content; and 9>
= . 2 & ! " +: allows drag-and-drop the text in the object’s content.
Default value is 0.

268 Properties
E3 - Scripts - Reference Manual

NOTE: This property has no effect if Style property is set to 2.

EnterFieldBehavior: Controls how text content is selected in the edition area


when -0 key is pressed on the object, and not when the object receives focus as the
result of SetFocus() method. The available options are: M>
! 1 + 2& $0 : selects all the content of the text when -0 key is
pressed on the object; and 9> ! 1 + 2 & $ $ : the selection
remains original.

Default value is 0- fmEnterFieldBehaviorSelectAll.

EnterKeyBehavior: Defines ! key behavior in the object. If True,


whenever you press ! a new line is created in the object’s text edition area.
Otherwise, whenever you press ! , focus goes to the next object in tabulation
order. This also happens if Multiline property is set to False, regardless of
EnterKeyBehavior property value.

The combination - ! also depends on the value of Multiline property.


If this property is set to True, whenever these two keys are pressed together a new
line is created in the object’s text edition area, regardless of EnterKeyBehavior
property value. If the property is False, the keys will have no effect on the text.

Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.

HideSelection: Specifies whether the selected text is still highlighted when the
object does not have focus anymore. If True, the selected text only remains
highlighted in case the object has focus. Otherwise, the object will always appear
highlighted, regardless of the presence of focus in the object. Default value is True.

IMEMode: Specifies the object’s IME mode.

NOTE: This property applies only to applications written in Asian languages, and is
ignored in other applications. It was maintained in the program for compatibility
reasons with the default specifications for Microsoft Forms objects.

The options available are:

Properties 269
E3 - Scripts - Reference Manual

Available options for IMEMode


OPTION DESCRIPTION
M> ! + ; No IME control (default).
9> ! + IME mode on.
:> ! + IME mode off. English mode on.
F> ! + = " IME mode disabled. The user cannot activate
it via keyboard.
I> ! + E . IME Hiragana mode on. (Full width).
L> ! + < ( 1, IME Katakana mode on. (Full width).
> ! + < ( IME Katakana mode on. (Half width).
O> ! + 0'2 1, IME Alphanumeric mode on. (Full width).
K> ! + 0'2 IME Alphanumeric mode on (Half width).
P> ! + E .,1, IME Hangul mode on. (Full width).
9M> ! + E ., IME Hangul mode on. (Half width).
99> ! + E 31, IME Hanzi mode on (Full width).
9:> ! + E 3 IME Hanzi mode on (Half width).

IntegralHeight: Adjusts height in text edition area, in case its available area
exceeds object size. If True, its height is adjusted to fit the object’s current size, thus
displaying the whole text. Otherwise, the size of text edition area remains the same.
If a text is bigger than the available space, it will not be displayed in the object.

LineCount: Returns the object number of lines. This property is available in


runtime only.

Locked: Enables/disables object edition. If True, edition is not allowed;


otherwise, it is. The value configured for Enabled property influences Locked
property’s behavior. For further details, see Enabled property. Default value is
False.

MaxLength: Determines the maximum number of characters in the object. If set


to 0, there will be no character limit in the object.

Multiline: This property indicates whether the text will have multiple lines (True)
or be a simple text box (False). It can be viewed when Viewer is running. Default
value is False.

PasswordChar: Converts the object’s text to a special character configured at the


property. Use this property to protect confidential information, such as passwords or
security codes. PasswordChar property’s value is a character (usually an asterisk)
that will appear in the object instead of the actual characters the user types. If the
character is not specified, the control will display the characters actually typed.

270 Properties
E3 - Scripts - Reference Manual

ScrollBars: Specifies whether the object has vertical or horizontal scroll bars, or
even both. The available options are: M> $ ; : no scroll bars are
displayed; 9> $ E 3 : a horizontal scroll bar is displayed; and :>
$ 8 $ : a vertical scroll bar is displayed. Default value is 0-
fmScrollBarNone.

SelectionMargin: Enables/disables the object’s selection margin. If True, the


text will be selected when you click the object’s margin. Otherwise, the text will not
be selected when you click the margin.

NOTE: If SelectionMargin property is set to True when the object is being


printed,the selection margin will also be printed.

SelLength: Returns the number of characters selected in the object. This property
is available in runtime only.

SelStart: Indicates the starting point of the selected text, or the insertion point if
no text is selected. This property is available in runtime only.

SelText: Returns the text selected in the object. This property is available in
runtime only.

SpecialEffect: Specifies the object’s appearance. The options available are:

Available options for SpecialEffect


OPTION DESCRIPTION
M> ' $ ! $1 The object looks flat
9> '$ ! $ + The object looks raised.
:> ' $ ! $ , (+ The object looks sunken
F> ' $ ! $!$2 The object borders look etched.
> '$ ! $ , ' The object looks bumped.

TabKeyBehavior: Determines whether tabulation is allowed at edition area. If


True, whenever [-0 key is pressed, a space character is inserted at edition area.
Otherwise, when [-0 is pressed, focus goes to the next object on the tabulation
order.

Text: returns the text being typed. This property is available only in
runtime. TextAlign: Specifies how the text is aligned in the object. The options
available are: 9> - %0 . : aligns the text to the left of the object; :>
- %0 . : aligns the text to the center of the object; and F>
- %0 . .2: aligns the text to the right of the object.

Properties 271
E3 - Scripts - Reference Manual

TextLength: Returns the number of characters typed in the object. This property
is available in runtime only.

Value: It is the text in the edit region.

WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.

/7 < !! +

Accelerator: Defines or recovers the object'


s accelerator key. This accelerator key
is a shortcut key used together with 0 key, featuring the object' s focus. Default
value is Empty.

Alignment: Specifies the object'


s alignment on the Screen relating to its legend. The
available options are: M> 0 . = aligns the legend to the object’s left;
9> 0 . .2 = aligns the legend to the object’s right. This property is
available in runtime only.

AutoSize: Adjusts text width, in case its available area is larger than the object’s
size. For the object ToggleButton, if the property is True, the text will be resized to
fit the object’s current size.

BackStyle: Defines the object’s background style. The available options are: MR
$( 4- ' : the object’s background is transparent, with no drawing;
and e 9 R $( 4 ' Q, : the object’s background is opaque, with some kind
of drawing.

NOTE: This property does not affect bitmaps transparency. You have to use a
picture editor, such as Paintbrush, to turn the bitmap transparent. Not all ActiveX
objects support transparent bitmaps.

Default value is 9 R ( 4 ' Q, .


$

Caption: Defines the text to be displayed with the object.

Font: Determines object’s font. It cannot be used in scripts and/or links, and it is
configured exclusively via Studio.

GroupName: Creates a group of objects mutually exclusive. This property is


available in runtime only.
272 Properties
E3 - Scripts - Reference Manual

NOTE: This property is not used at E3. It was maintained in the program for
compatibility reasons with the default specifications for Microsoft Forms objects.

Locked: Enables/disables object edition. If True, edition is not allowed;


otherwise, it is. The value configured for Enabled property influences Locked
property’s behavior. For further details, see Enabled property. Default value is False.

Picture: Specifies the picture (bitmap) attributed to the object. An image file
can be selected in two ways: via Properties List; or via scripts, by using
LoadPicture function to specify the path and the name of the file containing the
picture. To remove the picture, click the value of Picture property and press =
$(' $ key does not delete the picture. Example:
Sub CommandButton1_Click()
Screen.Item("CheckBox1").Picture =LoadPicture("C:\aba.gif")
End Sub

Properties 273
E3 - Scripts - Reference Manual

PicturePosition: Specifies the position of the picture attributed to the object in


Picture property. The available options for this property are:

Available options for PicturePosition


OPTION DESCRIPTION
M> $, -' Picture to the left of the legend. Legend
aligned to the top of the picture.
9> $, Picture to the left of the legend. Legend
aligned to the center of the picture.
:> $, Picture to the left of the legend. Legend
aligned to the bottom of the picture.
F> $, .2- ' Picture to the right or the legend. Legend
aligned to the top of the picture.
I> $, .2 Picture to the right or the legend. Legend
aligned to the center of the picture.
L> $, .2 Picture to the right or the legend. Legend
aligned to the bottom of the picture.
> $, 0" & Picture above the legend. Legend aligned
to the leftmost part of the picture.
O> $, 0" & Picture above the legend. Legend aligned
to the lowest central part of the picture.
(Default).
K> $, 0" & .2 Picture above the legend. Legend aligned
to the rightmost part of the picture.
P> $, Picture below the legend. Legend aligned
to the leftmost part of the picture.
9M> $, Picture below the legend. Legend aligned
to the highest central part of the picture.
99> $, .2 Picture below the legend. Legend aligned
to the rightmost part of the picture.

SpecialEffect: Specifies the object’s appearance. This property is available in


runtime only. The options available are:

Available options for SpecialEffect


OPTION DESCRIPTION
M> ' $ ! $1 The object looks flat
9> '$ ! $ + The object looks raised.
:> ' $ ! $ , (+ The object looks sunken
F> ' $ ! $!$2 The object borders look etched.
> '$ ! $ , ' The object looks bumped.

TextAlign: Specifies how the text is aligned in the object. The options available
are: 9> - %0 . : aligns the text to the left of the object; :>
- %0 . : aligns the text to the center of the object; and F>
- %0 . .2: aligns the text to the right of the object.
274 Properties
E3 - Scripts - Reference Manual

TripleState: Determines up to three value status for the object. If True, the user
can choose from three status option: False, True, or Null. Null state is displayed with
a shaded button. Otherwise, the user can only choose from the Values True or False.
Default value is False.

Value: Indicates the object’s initial value. Its behavior is Boolean; if True, its
initial status is selected, otherwise it will start cleared. Default value is False.

WordWrap: Enables/disables line breaks in the text, in case the area available
for the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.

/ < 4 #
Links make the association between any two variables much easier, since it is
execution is done neither logical or via scripts. The object Links returns a collection
of any E3 object’s associations. Links collection’s default property is Count.

Count: Informs the number of connections an object has. Equals 0 (zero) if the
object has no links. Example:
Sub CommandButton1_Click()
MsgBox Screen.Item("ScrollBar1").Links.Count
End Sub

/ < 4 # ''
To access or modify a connection, you can use either Link properties or Link
methods. Each type of connection has its own properties, except for three default
properties, shared by all types: Property, Source, and Type.

Property: Specifies the name of the property it is linked to. When modified,
moves the link to another property of the same object. Example:
Sub CommandButton1_Click()
dim bind
set bind = Screen.Item("TableBind").Links.Item(1)
bind.Property = "Caption"
End Sub

Properties 275
E3 - Scripts - Reference Manual

Source: Specifies link’s source, which could be the name of another object in the
application, or even a more complex expression accessing several objects. Example:
Sub CommandButton25_Click()
dim bind
set bind = Screen.Item("TableBind").Links.Item(1)
bind.Source = "Data.TagDemo1.Value"
End Sub

Type: This is a read-only property, and informs the type of link. The available
values are:

Available options for Type


VALUES DESCRIPTION
M> " ' Simple link.
9> " ' = Bidirectional link.
:> " 0 . Analog link.
F> " 0 Digital link.
I> " -" Table link.
L> " & Reverse link.

Example:
Sub CommandButton1_Click()
dim bind
set bind = Screen.Item("TableBind").Links.Item(1)
MsgBox bind.Type & " – Table link"
End Sub

/ < ' :+ : 4 #
Simple, bidirectional, and reverse links are all implemented by the same object.
According to the value of these properties, you can determine which type of
connection you are dealing with.

Bidirectional: True when the connection is bidirectional, False when the


connection is simple or reverse.

Example:

276 Properties
E3 - Scripts - Reference Manual

Sub CommandButton29_Click()
dim bind
set bind = Screen.Item("SimpleBind").Links.Item(1)
bind.BiDirectional = True
End Sub

Reverse: True when the connection is reverse, False when the connection is
simple or bidirectional. Example:
Sub CommandButton29_Click()
dim bind
set bind = Screen.Item("SimpleBind").Links.Item(1)
bind.Reverse = True
End Sub

/ <" !4 #
Through four specified values, a linear scale is made between property values and
source values.

DstHiValue: Specifies the highest value achieved in the property.

Example:
Sub DstHiValue_ValueChange()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("ScrollBar1").Links.Item("Value")
Screen.Item("ScrollBar1").Max = Value
If Bind Is Nothing Then
MsgBox "ScrollBar1 is not linked"
Else
MsgBox "ScrollBar1 is linked to " & Bind.Source & "‘"
MsgBox "Changing DstHiValue from " &_
Bind.DstHiValue & " to " & Value
Bind.DstHiValue = Value
End If
End Sub

Properties 277
E3 - Scripts - Reference Manual

DstLoValue: Specifies the lowest value achieved in the property.


Example:
Sub DstLoValue_ValueChange()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("ScrollBar1").Links.Item("Value")
Screen.Item("ScrollBar1").Min = Value
If Bind Is Nothing Then
MsgBox "ScrollBar1 is not linked"
Else
MsgBox "ScrollBar1 is linked to " & Bind.Source & " "
MsgBox "Changing DstLoValue from " &_
Bind.DstLoValue & " to " & Value
Bind.DstLoValue = Value
End If
End Sub

SrcHiValue: Specifies the highest value achieved in the source.


Example:
Sub SrcHiValue_ValueChange()
On error resume next
Dim Bind
Set Bind = Screen.Item("ScrollBar1").Links.Item("Value")
Screen.Item("ScrollBar2").Max = Value
If Bind Is Nothing Then
MsgBox "ScrollBar1 is not linked"
Else
MsgBox "ScrollBar1 is linked to " & Bind.Source & " "
MsgBox "Changing SrcHiValue from " &_
Bind.SrcHiValue & " to " & Value
Bind.SrcHiValue = Value
End If
End Sub

278 Properties
E3 - Scripts - Reference Manual

SrcLoValue: Specifies the lowest value achieved in the source.

Example:
Sub SrcLoValue_ValueChange()
On error resume next
Dim Bind
Set Bind = Screen.Item("ScrollBar1").Links.Item("Value")
Screen.Item("ScrollBar2").Min = Value
If Bind Is Nothing Then
MsgBox "ScrollBar1 is not linked"
Else
MsgBox "ScrollBar1 is linked to " & Bind.Source & " "
MsgBox "Changing SrcLoValue from " &_
Bind.SrcLoValue & " to " & Value
Bind.SrcLoValue = Value
End if
End Sub

NOTE: In case the values specified for SrcHiValue and SrcLoValue properties are
the same, there will be no linear scale, so the connection will work as a simple
connection.

Properties 279
E3 - Scripts - Reference Manual

/ <$ ,! 4 #

BlinkOff: If True, the connected property alternates periodically between the


values of the properties OffValue and BlinkOffValue, in case the source returns
False.

Example:
Sub BlinkOff_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1")._
Links.Item("ForegroundColor")
If Bind Is Nothing Then
MsgBox "Retangulo1 is not linked"
Else
MsgBox "Retangulo1 is linked to " & Bind.Source & " "
MsgBox "Changing BlinkOff from " &_
Bind.BlinkOff & " to " & Value
Bind.BlinkOff = Value
End If
End Sub

280 Properties
E3 - Scripts - Reference Manual

BlinkOffValue: Specifies the alternative value the property will assume


periodically when the source returns False, and BlinkOff property is True.

Example:
Sub BlinkOffValue_Click()
On Error Resume Next
Dim Value
If Application.ShowPickColor_
(Value, ForegroundColor, 400, 300) Then
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
if Bind Is Nothing Then
MsgBox "Retangulo1 is not linked"
Else
MsgBox "Retangulo1 is linked to "& Bind.Source & " "
MsgBox "Changing BlinkOffValue from " &_
Bind.BlinkOffValue & " to " & Value
Bind.BlinkOffValue = Value
End If
ForegroundColor = Value
End If
End Sub

Properties 281
E3 - Scripts - Reference Manual

BlinkOn: If True, the connected property alternates periodically between the


values of the properties OnValue and BlinkOnValue, in case the source returns True.
Example:
Sub BlinkOn_Change()
On error resume next
dim Bind
Set Bind =_
Screen.Item("Retangulo1").Links.Item("ForegroundColor")
if Bind Is Nothing Then
MsgBox "Retangulo1 is not linked"
Else
MsgBox "Retangulo1 is linked to " & Bind.Source & " "
MsgBox "Changing BlinkOn from " & Bind.BlinkOn & " to "_
& Value
Bind.BlinkOn = Value
End if
End Sub

BlinkOnValue: Specifies the alternative value the property will assume


periodically when the source returns True, and BlinkOn property is True. Example:
Sub BlinkOnValue_Click()
On Error Resume Next
Dim Value
If Application.ShowPickColor_
(Value, ForegroundColor, 400, 300) Then
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
MsgBox "Retangulo1 is not linked"
Else
MsgBox "Retangulo1 is linked to "& Bind.Source & " "
MsgBox "Changing BlinkOnValue from " &_
Bind.BlinkOnValue & " to " & Value
Bind.BlinkOnValue = Value
End If
ForegroundColor = Value
End If

282 Properties
E3 - Scripts - Reference Manual

End Sub

OffValue: Specifies the value the property will take when the source returns
False. Example:
Sub OffValue_Click()
On Error Resume Next
Dim Value
If Application.ShowPickColor_
(Value, ForegroundColor, 400, 300) Then
Dim Bind
Set Bind =_ Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
if Bind Is Nothing Then
MsgBox "Retangulo1 is not linked"
Else
MsgBox "Retangulo1 is linked to "& Bind.Source & " "
MsgBox "Changing OffValue from " &_
Bind.OffValue & " to " & Value
Bind.OffValue = Value
End If
ForegroundColor = Value
End If
End Sub

Properties 283
E3 - Scripts - Reference Manual

OnValue: Specifies the value the property will take when the source returns True.
Example:
Sub OnValue_Click()
On error resume next
Dim Value
If Application.ShowPickColor_
(Value, ForegroundColor, 400, 300) Then
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
if Bind Is Nothing Then
MsgBox "Retangulo1 is not linked"
Else
MsgBox "Retangulo1 is linked to "& Bind.Source & " "
MsgBox "Changing OnValue from " &_
Bind.OnValue & " to " & Value
Bind.OnValue = Value
End If
ForegroundColor = Value
End If
End Sub

284 Properties
E3 - Scripts - Reference Manual

/ <. 4 #

Blink(Line): Determines that when the source is within this line’s interval, the
property will alternate periodically between the values established in the properties
Value(Line) and BlinkValue(Line). Line index determines table line (from 1 to
RowCount property’s value). Example:
Sub ScrollBarRow_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
If Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor = _
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub

Properties 285
E3 - Scripts - Reference Manual

BlinkValue(Line): Specifies the alternative (blinking) value the property will take
when the source is within the interval specified on the line, and Blink(Line) property
is True. Line index determines table line (from 1 to RowCount property’s value).
Example:
Sub ScrollBarRow_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
If Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor =_
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub

286 Properties
E3 - Scripts - Reference Manual

Max(Line): Specifies the highest source value for a table line. Line index
determines table line (from 1 to RowCount property’s value). Example:
Sub ScrollBarRow_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
If Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor =_
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub

Properties 287
E3 - Scripts - Reference Manual

Min(Line): Specifies the lowest source value for a table line. Line index
determines table line (from 1 to RowCount property’s value). Example:
Sub ScrollBarRow_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
If Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor =_
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub

288 Properties
E3 - Scripts - Reference Manual

RowCount: Informs the number of rows in a table. This is a read-only property.


Example:
Sub ScrollBarRow_Change()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
If Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor =_
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub

Properties 289
E3 - Scripts - Reference Manual

Value(Line): Specifies the value the property will take when the source is within
the interval specified on the line. Line index determines table line (from 1 to
RowCount property’s value). Example:
Sub CommandButton1_Click()
On Error Resume Next
Dim Bind
Set Bind = Screen.Item("Retangulo1").Links._
Item("ForegroundColor")
If Bind Is Nothing Then
Else
if Value < 1 Then
Value = 1
ElseIf Value > Bind.RowCount Then
Value = Bind.RowCount
Else
Screen.Item("Value2").ForegroundColor =_
Bind.Value(Value)
Screen.Item("BlinkValue").ForegroundColor =_
Bind.BlinkValue(Value)
Screen.Item("Max").Value = Bind.Max(Value)
Screen.Item("Min").Value = Bind.Min(Value)
Screen.Item("Blink").Value = Bind.Blink(Value)
End If
End If
End Sub

/ * 2

BlinkTime: Defines the time, in milliseconds, between status change when the
objects needs blinking (that is, whenever a screen object has a link and the option
Blink is checked). Default value is 200 ms.

NOTE: Minimum screen update time is 55ms; so, if this property is configured with
a value lower than 55ms, the configuration will have no effect at all.

CacheEnable: Keeps in memory the Screens already opened in the Viewer,


allowing you to switch among them. If the property is enabled, then Screens cache is
also enabled.

290 Properties
E3 - Scripts - Reference Manual

Caption: Determines the name of the application using the Viewer. Default value
is empty.

CenterWindow: If True, determines that Viewer Window should start


centralized. Otherwise, default configuration will be used. Default value is True.

CloseButton: If True, button is enabled at Viewer, and it is possible to


use this button. Otherwise, this button does not appear in the window. Default value
is True.

DisableTaskSwitching: If True, disables task (window) switching at Viewer.


Otherwise, task switching is enabled. Default value is True.

EnableHeartbeat: Enables/disables the sending of heartbeat (message sent in


fixed intervals of time, indicating E3 Server is active) between Viewer and server. If
the Viewer stops receiving heartbeat messages, it means some problem has
occurred, so connection must be aborted. Default value is False.

EnableInactivity: Enables/disables user inactivity period check. For further


information, see OnInactive event, on Viewer object. Default value is False.

EnableZoomMenu: If True, enables the displaying of zoom configuration menu


via right-clicking in runtime, unless there is a script configured with discrepant
information in either MouseDown() or MouseUp() event. Otherwise, the menu is not
displayed. Default value is True.

HeartbeatPeriodMs: Indicates the interval (in milliseconds) between heartbeat


messages sent by E3 Server. Heartbeat messages are always sent whenever the
server does not send any message to Viewer for the period of time indicated by this
property. Default value is 2000 (two seconds).

HeartbeatTimeoutMs: Indicates the time, in milliseconds, the Viewer will


tolerate no message from E3 Server. If this time is reached, and no message is
received, Viewer assumes the connection has been lost, and starts reconnection
process. This interval must be higher than the one determined at HeartbeatPeriodMs
property (if possible, more than double). Default value is 5000 (five seconds).

Properties 291
E3 - Scripts - Reference Manual

InactivityTime: Defines the maximum waiting time for a mouse or keyboard


event before the inactivity period, in minutes. For further information, see Viewer’s
OnInactive event. Default value of this property is 5 (five) minutes. Example:
Sub CommandButton3_Click()
MsgBox "Application will turn inactive within" & _
Application.InactivityTime & " minute(s)."
End Sub

InitialScreen: Indicates the initial Screen/Frame to be displayed when the Viewer


is called. Through WindowStyle property it is possible to determine if the window
should start maximized, windowed, or minimized. Default value is InitialScreen.

IsViewerReadOnly: If True, indicates Viewer with Read-Only mode on


(restricted access).

LoginRetries: Specifies the number of Viewer login retries, that is, the number
of times the login dialog will be displayed apart from the first time. Default value is
2.

MaximizeButton: If True, % 3 button is enabled at Viewer, and it is


possible to use this button. Otherwise, this button is not displayed on the window.
Default value is True.

MinimizeButton: If True, 3 button is enabled at Viewer, and it is


possible to use this button. Otherwise, this button is not displayed on the window.
Default value is True.

ReconnectDialogDelaySec: Indicates how many seconds the Viewer will wait to


show the reconnection dialog, during this action (this property does not affect the
first connection). If equals to zero, the dialog always will be shown. To make sure
the dialog will not be shown, it is recommended to specify a great number.

NOTE: When the reconnection occurs in quiet mode (the dialog is not shown), all
windows of current Viewer will be disabled and the hourglass cursor appears,
indicating that the application is busy. During this time, the user won’t be able to
cancel the action.

TitleBar: If True, Viewer’s title bar is displayed, according to the specifications


of Caption property. Otherwise, it is hidden. Default value is True.

User: Displays the name of the user using Viewer. This property is read only.

292 Properties
E3 - Scripts - Reference Manual

WindowHeight: Determines Viewer window’s height, in pixels. Default value is


300.

WindowStyle: Defines Viewer window’s initial style. The available options are:
M- % 3+: Viewer starts maximized; 9-5 + +: Viewer starts windowed;
and :- 3+: Viewer starts minimized.

WindowWidth: Determines Viewer window’s width, in pixels. Default value is


400.

/ ,

ConnectionActive: Shows status of Database current connection. If True, the


connection is active; if False, is inactive.

ConnectTimeOut: Displays the waiting time for any database operation, before
the system generates a timeout error. Default value is 180 (3 minutes).

EnableLocalCreation: Defines whether Viewer will create a database connection


locally. The local connection will be used only to create queries. If the property is
enabled (True), the Viewer tries to create a connection locally, and if this is not
possible, it will search for the query asked in the server. Default value is False.

EnableSynchronization: Indicates to the E3, if enabled (True), that it should also


record data in a second base simultaneously, for security purposes. If the property is
enabled and there is a StandBy server, E3 synchronizes both servers databases.
Default value is False, i.e., the synchronization is disabled.

nRetries: Indicates how many times E3 will try to execute a database operation.
If the operation fails all times, it will be discarded.

ReconnectDelay: Determines system’s delay (in milliseconds) for a new attempt


to establish a lost connection with the database. Default value is 2000 (2 seconds).

SourceDatabase: In case the Database’s format is Access, this is the name of the
.mdb file. In case the Database’s format is SQL, this is the name of the SQL server
concatenated to the chosen DB in the format Server/Database. In case the Database’s
format is Oracle, this is the name of the connection generated. This is a read-only
property.

Properties 293
E3 - Scripts - Reference Manual

SourceType: Indicates the DMS that will be used by the Database object. The
available options are: M> $ : Oracle; 9> 0$ $ : Microsoft Access; and
:> H & : Microsoft SQL Server. Example:
Sub Grupo1_Click()
op = Application.SelectMenu("Oracle|Access|SQLServer")
If op = 1 Then
Application.GetObject("DBServer").SourceType = 0
MsgBox "Oracle server in use."
ElseIf op = 2 Then
Application.GetObject("DBServer").SourceType = 1
MsgBox "Access server in use."
ElseIf op = 3 Then
Application.GetObject("DBServer").SourceType = 2
MsgBox "SQL server in use."
End If
End Sub

TotalFailedWrites: Contains the total of current database failed writes.

UserName: Login used to connect to the Database. This is a read-only property.

UseTransaction: Defines whether the DBServer will use database transactions


or not. If True, each DB (Historic, Storage, Formulas and Alarms operations)
operation block (200 operations) will be executed at once, that is, in only one
transaction.

NOTE: This property is used only with Oracle, and has no effect with Microsoft
Access or Microsoft SQL Server.

/ " '

/ " '

ActiveAlarms: Determines the number of active alarms in the area. If property’s


value is 0, all deactivated alarms are listed on ActiveNACKAlarms property. This
property is read-only. Default value is 0.

ActiveHighAlarms: Indicates the number of high severity active alarms. This


property is read-only.

294 Properties
E3 - Scripts - Reference Manual

ActiveHighNACKAlarms: Indicates the number of high severity


unacknowledged alarms. This property is read-only.

ActiveLowAlarms: Indicates the number of low severity active alarms. This


property is read-only.

ActiveLowNACKAlarms: Indicates the number of low severity


unacknowledged alarms. This property is read-only.

ActiveMedAlarms: Indicates the number of medium severity active alarms. This


property is read-only.

ActiveMedNACKAlarms: Indicates the number of medium severity


unacknowledged alarms. This property is read-only.

ActiveNACKAlarms: Indicates the number of unacknowledged alarms in the


area. This property is read-only.

Alarm: Establishes the existence of at least one active alarm in the area. If True,
the system has at least one active alarm in the area, and ActiveAlarms property will
read for the number of active alarms. Otherwise, ActiveNACKAlarms property will
read for the number of non- acknowledged alarms. This property is read-only.

AlarmVerify: Enables verification of all alarms in the area. Once verification is


enabled (True), if ActiveAlarms property has a value higher than 0, the system
checks for both active and unacknowledged alarms, listing these last ones on
ActiveNACKAlarms property. This property is useful to avoid the “avalanche” effect
of some systems, where one event can generate a great quantity of correlated alarms.

/ " '

NOTE: the specific properties from each alarm source type can be accessed directly
via scripts or links, as well as visualized in the object’s Property List, making their
edition via GetAlarm() method not mandatory anymore.

ActiveNACKAlarm: If True, indicates that the Source has not been


acknowledged since last activation. This property is read-only.

Alarm: If True, indicates active alarm condition.

AlarmVerify: If True, enables alarm source checking (that is, alarm generation).

Properties 295
E3 - Scripts - Reference Manual

CurrentSeverity: Indicates active alarm’s last severity level, i.e.: 0 = High


severity; 1 = Medium Severity; 2 = Low Severity.

CurrentSubConditionName: Determines the name of the last active alarm


condition. The available options are:

Available options for CurrentSubConditionName


OPTION DESCRIPTION
Dead Band Alarm
= Digital Alarm
-8 Variation Tax Alarm
Analog Alarm on LOLO band
Analog Alarm on LO band
E Analog Alarm on HI band
E E Analog Alarm on HIHI band

DoubleAckRequired: When True, it indicates the alarm can be acknowledged


either when active or inactive, that is, it can receive double acknowledgement. When
False, it indicates the alarm can only be acknowledged once, and after that it leaves
the alarm list. Alarms that do not require acknowledgment (AckAquired property)
cannot be customized with this option. Applications previous to version 2.5. have
this property configured as False.

Event: When True, it indicates the alarm is event type. An event-type alarm,
when activated, is acknowledged by “System” user. Thus, when it is acknowledged,
nothing happens (there is no effect); it also does not increment the number of active
or unacknowledged alarms. It cannot be altered in runtime.

Format: Specifies the type of format to be attributed to the object. It allows changing
the way data is presented without changing their value. You can edit this property
manually, or set it through the formatting window. Its use is similar to format codes on
spreadsheets, following the same basic syntax. The following datatype are supported:

Datatype supported by Format


DATA DESCRIPTION
;, $ Decimal, scientific, hexadecimal, binary, and octal output.
- % Texts in general.
Boolean values.
= / Gregorian calendar.

296 Properties
E3 - Scripts - Reference Manual

FormattedValue: Contains the alarm formatted value as specified in Format


property. This property is read-only.

RawAlarm: Indicates whether the alarm should be active, regardless of delay.


When delay is 0 (zero), RawAlarm’s value is the same as Alarm’s. This is a read-
only property.

Source: Contains the expression that should be evaluated to determine whether


alarm should occur.

Value: Contains the value that has been evaluated to determine whether alarm
occurs.

/ "" '

ActiveAlarms: Determines the total amount of active alarms in the system. This
is a read-only property.

ActiveHighAlarms: Indicates the number of high severity active alarms. This


property is read-only.

ActiveHighNACKAlarms: Indicates the number of high severity


unacknowledged alarms. This property is read-only.

ActiveLowAlarms: Indicates the number of low severity active alarms. This


property is read-only.

ActiveLowNACKAlarms: Indicates the number of low severity


unacknowledged alarms. This property is read-only.

ActiveMedAlarms: Indicates the number of medium severity active alarms. This


property is read-only.

ActiveMedNACKAlarms: Indicates the number of medium severity


unacknowledged alarms. This property is read-only.

ActiveNACKAlarms: Indicates the total amount of unacknowledged alarms in


the system (active or not). This is a read-only property.

BackupDiscardInterval: Indicates the time interval during which the backup data
will be kept until they are discarded. This property works along with
BackupDiscardTimeUnit property. Default value is 12 (twelve time units indicated
by BackupDiscardTimeUnit).

Properties 297
E3 - Scripts - Reference Manual

NOTE: The total amount of time indicated by the combination of the properties
BackupDiscardInterval and BackupDiscardTimeUnit must be longer than the time
indicated by the properties DiscardInterval e DiscardIntervalTimeUnit.

BackupDiscardTimeUnit: This property indicates the time unit to keep backup


data until they are discarded. The available options are: M>+ E , B hours;
9>+ = 4B days; :>+ 2= months (default); F>+ , = minutes. This
property works alongside BackupDiscardInterval property.

DataSource: Defines the Database to be used to record alarms data. Default value
is empty, i.e., there is no Database to store data.

DiscardInterval: This property works along with DiscardTimeUnit property.


DiscardInterval property indicates the time interval during which the alarm data will
be stored in the database table, until they are discarded. Default value is 1 (one time
unit indicated by DiscardTimeUnit). This property can be altered in runtime.

DiscardTimeUnit: This property works along with DiscardInterval property.


DiscardTimeUnit property indicates the time unit to store data on table until they are
discarded. The available options are: M>+ E ,: hours; 9>+ = 4 : days; :>+ 2:
months (default); and F>+ , : minutes.

EnableBackupTable: Creates a backup table where discarded data will be stored,


for safety. If True, the table is created; otherwise, it is not. Default value is True.

EnableDiscard: Indicates alarm data discard after a certain time. If False, data
are stored indefinitely on the table; otherwise, they are not. Default value is False.

Logging: Creates alarm information record in the Data Base specified by


DataSource property. If False, record is not created; otherwise, it is. Default value
is False.

VerificationInternal: This property works along with VerificationUnit property to


control the time interval E3 will check for the time data have existed, and then
discard them. Default value is 1 (one time unit indicated by VerificationUnit).

VerificationUnit: This property works along with VerificationInternal property.


VerificationUnit property indicates the time unit to verification for data discard. The
available options are: M>+ E ,: hours; 9>+ = 4 : days; :>+ 2: months
(default); and F>+ , : minutes.

298 Properties
E3 - Scripts - Reference Manual

/ $ )" '
NOTE: Some of properties use HIMETRIC unit system. In HIMETRIC system,
each unit is equivalent to a thousandth centimeter; that is, 1,000 units equals to 1
centimeter. So, this is the measurement pattern adopted for properties in this manual,
when necessary.

AlarmServer: Name of the single alarm server in the application.

AllowAckAll: Enables the E3Alarm pop-up menu option that allows to


acknowledge all alarms. The default value of this property is True.

AllowAckCurrentFilter: Enables the E3Alarm pop-up menu option that allows


to acknowledge all alarms of current filter. If there is no visible alarms, the property
has no effect. The default value of this property is True.

AllowAckSelected: Enables the E3Alarm pop-up menu option that allows to


acknowledge all selected alarms. If there is no selected alarms, the property has no
effect. The default value of this property is True.

AllowColumnClick: Enables/disables field selection and their order direction by


clicking E3Alarm’s column headers in runtime. If True, and header invisible (see
ColumnHeader property), when you click column title, data will be ordered with this
column as key. When you click same column title again, the order is reversed (from
ascending to descending, and vice-versa). When you click it with 2 key
pressed, the field is used as second key. As in the primary key, a second click with
2 pressed reverses the order of the secondary field.

ColumnHeader: When True, this property enables viewing E3Alarm’s header.


The header also reorders the data in the table visually (see AllowColumnClick
property). Default value is True.

Domain: Specifies the domain to which E3Alarm will connect. Default value is
empty, i.e., E3Alarm connects to the same domain of the Viewer where it is. For
example: “\\NameOfOther Server”.

Enabled: Enables the object ActiveX in the project. Default value is True.

Font: Determines E3Alarm’s header and lines font. This property is read-only,
and cannot be modified in runtime.

Filter: Controls visible alarm areas at E3Alarm. If its value is not empty, the
events whose area name start with the text typed in this field will be presented. For
example: if Filter is “Ana”, only the alarms of areas such as “Analog.Production" or

Properties 299
E3 - Scripts - Reference Manual

“Analysis” will be displayed, but not “Digital.Analysis” or “Digital.Production”.


When SimpleAreaFilter property is False, the alarm area will also allow the use of
wild cards (such as * or ?) for filtering.

Allowed wild cards are:

"*": takes no or any amount of characters.

"?": takes any character.

"#": takes any digit.

"[ ]": allows specifying a cluster of characters. Ex:

"[ab]": takes a character if it is “a” or “b”.

"[f-h]": takes a character between “f” and “h”.

"[!cz]": takes a character which is neither “c” nor “z”.

"[!m-p]": takes any character as long as it is not between “m” and “p”.

Default value is empty, i.e., there will be no filter per area (see also
ShowHighPriority, ShowMediumPriority and ShowLowPriority properties).

FilterType: Performs alarm filters. The available options are: 9> 4


0 :
displays only alarms; :> 4 !& : displays only events; and F>
0 0 +!& , displays both alarms and events.

Frame: Returns the object’s parent frame. This property is available in runtime
only.

GridBkColor: Determines E3Alarm’s background color. Default value is white


(RGB (255,255,255)).

HasFocus: Determines whether the selected object has focus. This property is
available in runtime only.

Height: Defines object height, in Himetric units.

Layer: Shows objects on the Screen, according to the layers they are in. For
Screen objects, you can define up to 32 layers, so that they can be clustered logically
(e.g.: hydraulic layer objects, electric layer objects etc.), and shown/hidden just by
modifying the mask of the Screen’s Layer property. For the object to appear on the

300 Properties
E3 - Scripts - Reference Manual

Screen, Layer property should contain at least 1 bit set at the same position where
the Screen layer is.

MouseOver: Tells whether mouse cursor is on Screen. If so, the property is


enabled. Otherwise, it is False. This property is read-only, and its default value is
False. This property is available in runtime only.

MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. This property is available in runtime only.

PopupMenu: Enables a pop-up menu on E3Alarm. Default value is True.

PrimarySortAscending: When False, primary field events order is descending.


Otherwise, it is ascending. Default value is False.

PrimarySortField: Determines the primary field for ordering events at E3Alarm.


The field name should always be in English (see alarm field table appended in this
manual). Default value is "EventTime". When this option is empty,
SecundarySortField property does not have any effect.

SecondarySortAscending: When False, secondary field events order is


descending. Otherwise, it is ascending. Default value is False.

SecondarySortField: Determines the secondary field for ordering events at


E3Alarm. Field name should always be in English (see alarm field table appended in
this manual). Default value is "EventTime". This property does not have any effect
when PrimarySortField property is empty.

ShowHighPriority: Filters the alarms to be displayed, according to their severity.


If True, high severity alarms are shown; otherwise, these are hidden. Default value is
True.

ShowLowPriority: Filters the alarms to be displayed, according to their severity.


If True, low severity alarms are shown; otherwise, these are hidden. Default value is
True.

ShowMediumPriority: Filters the alarms to be displayed, according to their


severity. If True, medium severity alarms are shown; otherwise, these are hidden.
Default value is True.

SimpleAreaFilter: When True, filter behavior per alarm area name is based only
in total coincidence of the initial part of the name. When False, you can also use
wild-cards. See Filter property, which specifies filters per area name.

Properties 301
E3 - Scripts - Reference Manual

TabStop: Determines whether -0 key can be used in the system. If True,


TAB key use is enabled. Otherwise, the key cannot be used.

Tip: Shows a popup text when the mouse is over the execution object for a brief
moment. Example:
Sub RetanguloArr1_MouseUp(nButton, nShiftState, x, y)
Tip = "This is a test!"
End Sub

Visible: Defines the object’s visibility. If True, the object is visible, as long as the
following factors are also present: visible object’s parent-object, and object’s Layer
property present on Screen layer.

Width: Determines object’s width.

X: Defines object’s left horizontal coordinate, in HIMETRIC units.

Y: Defines object’s upper vertical coordinate, in HIMETRIC units.

/ . =

BackupDiscardInterval: Indicates the time interval during which the backup data
will be kept until they are discarded. This property works alongside
BackupDiscardTimeUnit property. Default value is 12 (twelve time units indicated
by BackupDiscardTimeUnit).

NOTE: The total amount of time indicated by the combination of the properties
BackupDiscardInterval and BackupDiscardTimeUnit must be longer than the time
indicated by the properties DiscardInterval e DiscardIntervalTimeUnit.

BackupDiscardTimeUnit: This property indicates the time unit to keep backup


data until they are discarded. The available options are: M>+ E , B hours;
9>+ = 4B days; :>+ 2= months (default); F>+ , = minutes. This
property works alongside BackupDiscardInterval property.

CacheSize: Defines the number of registers that should be read by the Historic
before being sent to the DataBase. For example, if a Historic’s CacheSize = 4, it will
send every 4 registers to the associated DBServer. Valid values for this property
range from 1 to 4. Default value is 1.

CompressedTable: Enables the use of dead band for data recording. Default
value is False.
302 Properties
E3 - Scripts - Reference Manual

DBServer: Indicates the Database used in the Historic to create tables and data
registers. Default value is empty.

DeadBand: This property works alongside CompressedTable property. It


indicates the calculated value on the last recorded value (in percentage) that defines
whether this new value is to be recorded. If the recorded value is not numerical, its
modification causes all values to be recorded.

DiscardInterval: This property works alongside DiscardTimeUnit property.


DiscardInterval property indicates the time interval during which the Historic data
will be stored in the database table, until they are discarded. Default value is 1 (one
time unit indicated by DiscardTimeUnit). This property can be altered in runtime.

DiscardTimeUnit: This property works alongside DiscardInterval property.


DiscardTimeUnit property indicates the time unit to store data on table until they are
discarded. The available options are: M>+ E ,Whours; 9>+ = 4 : days; :>+ 2:
months (default); and 3-+ , : minutes.

EnableBackupTable: Creates a backup table where discarded data will be stored,


for safety. If True, the table is created; otherwise, it is not. Default value is False.

EnableDiscard: Indicates Historic data discard after a certain time. If False, data
are stored indefinitely on the table; otherwise, they are not. Default value is False.

EnableQualityLogs: If this property is True, when the Historic starts E3 saves a


copy of the first collected record, with quality bad (0) and timestamp equals to one
second earlier.

ScanTime: Defines time interval variation for the Historic to acquire and save a
new register on the table, in milliseconds. Use this property if you wish a larger or
smaller amount of data generated per second. Default value is 1000.

TableName: Defines the name of the table used in the Historic.

UserTable: If True, identifies the historic as the user’s (data on the table were
imported from the database). Otherwise, it is a common E3’s Historic. This is a
read-only property.

UseTagQuality If True, the Historic will use the tag source’s quality value;
otherwise, the early method will be used (0 = uncertain value; 1 = good value).

VerificationInternal: This property works alongside VerificationUnit property to


control the time interval E3 will check for the time data have existed, and then
discard them. Default value is 1 (one time unit indicated by VerificationUnit).

Properties 303
E3 - Scripts - Reference Manual

VerificationUnit: This property works alongside VerificationInternal property.


VerificationUnit property indicates the time unit to check for data discard. The
available options are: M>+ E ,: hours; 9>+ = 4 : days; :>+ 2: months
(default); and F>+ , : minutes.

/ / !

BackupDiscardInterval: Indicates the time interval during which the backup


data will be kept until they are discarded. This property works alongside
BackupDiscardTimeUnit property. Default value is 12 (twelve time units indicated
by BackupDiscardTimeUnit).

NOTE: The total amount of time indicated by the combination of the properties
BackupDiscardInterval and BackupDiscardTimeUnit must be longer than the time
indicated by the properties DiscardInterval e DiscardIntervalTimeUnit.

BackupDiscardTimeUnit: This property indicates the time unit to keep backup


data until they are discarded. The available options are: M>+ E , B hours;
9>+ = 4B days; :>+ 2= months (default); F>+ , = minutes. This
property works alongside BackupDiscardInterval property.

CacheSize: Defines the number of registers that should be read by the Storage
before being sent to the DataBase. For example, if a Storage’s CacheSize = 4, it will
send every 4 registers to the associated DBServer. Default value is 10.

CompressedTable: Enables the use of dead band for data recording. Default
value is False.

CompressionRate: Shows the current data compression rate.

DBServer: Indicates the Database used in the Storage to create tables and data
registers. Default value is empty.

DeadBand: This property works alongside CompressedTable property. It


indicates the calculated value on the last recorded value (in percentage) that defines
whether this new value is to be recorded. If the recorded value is not numerical, its
modification causes all values to be recorded.

DiscardInterval: This property works alongside DiscardTimeUnit property.


DiscardInterval property indicates the time interval during which the data will be
stored in the database table, until they are discarded. Default value is 1 (one time
unit indicated by DiscardTimeUnit). This property can be altered in runtime.
304 Properties
E3 - Scripts - Reference Manual

DiscardTimeUnit: This property works alongside DiscardInterval property.


DiscardTimeUnit property indicates the time unit to store data on table until they are
discarded. The available options are: M>+ E ,Whours; 9>+ = 4 : days; :>+ 2:
months (default); and 3-+ , : minutes.

EnableBackupTable: Creates a backup table where discarded data will be


stored, for safety. If True, the table is created; otherwise, it is not. Default value is
False.

EnableDiscard: Indicates the data discard after a certain time. If False, data are
stored indefinitely on the table; otherwise, they are not. Default value is False.

StringFieldSize: This property specifies the maximum size of the Storage’s


string fields (this size will be used in creation of the strings table Value field).

TableName: Defines the name of the table used in the Storage.

VerificationInternal: This property works alongside VerificationUnit property


to control the time interval E3 will check for the time data have existed, and then
discard them. Default value is 1 (one time unit indicated by VerificationUnit).

VerificationUnit: This property works alongside VerificationInternal property.


VerificationUnit property indicates the time unit to check for data discard. The
available options are: M>+ E ,: hours; 9>+ = 4 : days; :>+ 2: months
(default); and F>+ , : minutes.

/ 0 )"; -
NOTE: It is not advisable accessing these properties directly via scripts. You should
access E3Query object, passing parameters through SetVariableValue() method and
modifying filters or fields through the collection returned with GetE3QueryFields()
method.

CursorLocation: Defines the place where the query will be generated and
handled, from the DMS (Database Management System) point of view. The
available options are: M>$ & : the query will be generated in the DMS (server);
and 9>$ : the query will be generated in the E3 Server (client). The default
value of this property is M>$ & . See also CursorType property.

NOTE: System performance can be compromised by using the option 9>$ J


because the query will be generated at E3 Server. Choosing this option, then, implies
in a certain attention to this process.

Properties 305
E3 - Scripts - Reference Manual

CursorType: Defines the type of query according to data view. The available
options are:

Available options for CursorType


OPTION DESCRIPTION
M> $< 4 Any change in records initially returned by the query is viewed
(Default).
9> $ $ No change in records initially returned by the query is viewed.
:> $=4 $ All new records added to the query are viewed, besides the
changes in records initially returned by the query.

DataSource: Indicates the Database or Storage object that will be used in the
query. This is a read-only property, but it can be modified in runtime.

Fields: Text with the fields to be viewed in the query, separated by commas. It
corresponds to the argument of SELECT clause in query’s SQL code. When blank, it
determines that the query should display all the fields of the table. This is a read-
only property, but it can be modified in runtime.

Frame: Returns the object’s parent frame. This property is available in runtime
only.

FunctionType: Specifies the function that defines the E3Query data. Some
functions have subfunctions that may be indicated in FunctionSubType property.
FunctionType is valid in the case of a Storage object is the source of E3Query (it is
indicated in DataSource property). The property can assume the following values:

Available options for FunctionType


OPTION DESCRIPTION
>9> ; 1, $ There is no function defined.
M> 8, Returns the last value stored in DataBase.
9> 0$ 2&+8 , Returns a stored value in relation to a
predefined time instant defined at the
TimeStamp variable. The type of relation is
specified in FunctionSubType.
:> - .0 ", Returns a Tag attribute, defined in
FunctionSubType.
F> ' += ;8 , Returns, for a single Tag, N values defined at
the variable NumVals, from an initial time,
defined at the variable StartTime.
I> ' += ! +- Returns, for a single Tag, the values at the
interval between the variables StartTime and
EndTime.
306 Properties
E3 - Scripts - Reference Manual

OPTION DESCRIPTION
L> ' += Returns, for one or more tags, the interpolated
values (i.e. estimated) at the interval between
the variables StartTime and EndTime, in fixed
intervals defined by the variable TimeInterval.
> $
, += Returns, for one or more tags, the result of the
math operation (specified in FunctionSubType)
applied to data at the interval between the
variables StartTime and EndTime, in fixed
intervals defined by the variable TimeInterval.

NOTE: The variables can also be defined in runtime through SetVariableValue()


method of E3Query.

FunctionSubType: Specifies the subtype of the function indicated in


FunctionType property. Only the options 9 > 0$ 2&+8 , , : > - .0 ",
and > $, += have subtype. For the other functions, FunctionSubType
assumes >9 > ; ,"-4 ' . The following table shows the possible property values
according the chosen function in FunctionType property:

Subtypes for ArchivedValue function (FunctionType = 1)


SUBTYPE DESCRIPTION
M> & ,0$ 2&+8 , Value right before the informed
TimeStamp.
9> ' +0$
2&+8 , Calculated value based of previous and
next values.
:> ; %0$
2&+8 , Value right after the informed
TimeStamp.
F> !%$0$
2&+8 , If a value is found at the exact informed
TimeStamp.

Subtypes for TagAttribute function (FunctionType = 2)


SUBTYPE DESCRIPTION
M> - .0 ", = $ ' Tag meaning/description.
9> - .0 ", ,$ Tag path.
:> - .0 ", -4' Datatype: double, Boolean, string.
F> - .0 ", !6 Engineering units.
I> - .0 ", !. Lower limit.
L> - .0 ", E.2! . Upper limit.
> - .0 ", = + + Recording Dead Band.
O> - .0 ", = + +6 Dead Band unit (absolute or percentage).
K> - .0 ", $
- Minimum recording time (variations in
smaller intervals are not recorded).
Properties 307
E3 - Scripts - Reference Manual

P> - .0 ", % $
- Maximum recording time (the absence of
values at this interval forces a recording).

Subtypes for CalculatedData function (FunctionType = 6)


SUBTYPE DESCRIPTION
M> - $, += Total of values.
9> , $, += Minimum value.
:> % , $, += Maximum value.
F> + + $ , += Standard deviation.
I> . $ , += Range of values.
L> $, += Mean of values.
> + $, += Median of values.

GroupBy: Text corresponding to the argument of GROUPBY clause in query’s SQL


code. This is a read-only property, but it can be modified in runtime.

HasFocus: Determines whether the selected object has focus. This property is
available in runtime only.

Having: Text corresponding to the argument of HAVING clause in query’s SQL


code. This property is usually used alongside Groupby property. This is a read-only
property, but it can be modified in runtime.

MouseOver: Tells whether mouse cursor is on Screen. If so, the property is


enabled. Otherwise, it is False. This property is read-only, and its default value is
False. This property is available in runtime only.

MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. This property is available in runtime only.

OrderBy: Text corresponding to the argument of ORDERBY clause in query’s SQL


code. This is a read-only property, but it can be modified in runtime.

Screen: Returns the object’s parent Screen. This property is available in runtime
only.

SQL: Finishes the SQL code specified for query. This is a read-only property, but
it can be modified in runtime.
308 Properties
E3 - Scripts - Reference Manual

Table: Contains the tables to be consulted (for example, Alarms is the


alarms/events table). It corresponds to the argument of FROM clause in query’s SQL
code. This is a read-only property, but it can be modified in runtime.

Where: Determines the query condition that filters the table records to be viewed,
that is, only the records that meet the conditions are viewed. It corresponds to WHERE
argument in the query’s SQL code. This is a read-only property, but it can be
modified in runtime.

/ 6 )"+ 2

AllowColumnResize: Enables/disables object’s grid column size configuration, in


runtime. If False, column size is fixed, and cannot be modified.

AllowRowResize: Enables/disables object’s grid row size configuration, in


runtime. If False, row size is fixed, and cannot be modified.

ColumnWidth: Determines E3Browser’s columns width, in pixels.

CurSel: Indicates E3Browser cursor’s current position, that is, the line index
where it is placed.

E3Query: Returns E3Browser’s Query, so that its properties can be accessed.


Enabled: Enables/disables E3Browser. If True, scroll can be used, and rows can be
selected. Otherwise, no click on E3Browser will have any effect.
Fields: Returns the Collection that contains the list of all the table fields, making
it possible its reference through the items of this collection. Default value is empty.
Example:
Sub E3Browser1_Click()
' Changes the color of Field1
Set fields = Screen.Item("E3Browser").Fields
Set Field1 = fields.Item("Field1")
field1.BkColor = RGB(255, 0, 0) ' Red
' Shows how many fields E3Browser has
MsgBox fields.Count
' Shows E3Browser’s number of fields
For Each Fields In fields
MsgBox fields.Name
Next

Properties 309
E3 - Scripts - Reference Manual

End Sub

Available options for Fields

OPTION DESCRIPTION
; Retrieves field’s name.
Retrieves criteria changing current query.
Retrieves field’s sorting: ASC (ascendent) o
DESC (descendent).
8 " Retrieves field’s visibility status.
1 Retrieves field’s value format.
5 + 2 Retrieves field’s width.
Retrieves field’s text color.
( Retrieves field’s background color..

FixedBkColor: Specifies E3Browser’s first column background color. Default


value is beige (RGB (236, 233, 216)).

FixedColumnWidth: Specifies E3Browser’s first column width (in pixels).


Default value is 30.

FixedRowFont: Determines the font to be used at E3Browser’s header line. This


property cannot be used in scripts and/or links, and is configured only via Studio.
Default value is Arial.

FixedRowHeight: Determines E3Browser’s header line height (in pixels).


Default value is 20.

FixedTextColor: Changes E3Browser’s header color.

Frame: Returns the object’s parent frame. This property is available in runtime
only.

GridBkColor: Determines E3Browser’s data area background color. Default


value is white (RGB (255, 255, 255)).

GridFont: Determines the font to be used at E3Browser’s data area texts. Default
value is Arial. This property cannot be used in scripts and/or links, being configured
only via Studio.

310 Properties
E3 - Scripts - Reference Manual

GridLineColor: Determines E3Browser’s data grid line color. Default value is


gray (RGB (192, 192, 192)).

GridLinesType: Determines the type of lines to be drawn on E3Browser’s data


grid.

Available options for GridLinesType


OPTION DESCRIPTION
M > ; No grid lines.
9 > E 3 Only horizontal grid lines (default).
: > 8 Only vertical grid lines.
F > 2 Horizontal and vertical grid lines.

HasFocus: If True, it indicates that E3Browser has keyboard focus.

Height: Determines object’s height, in HIMETRIC units.

Layer: Indicates the number of the layer where E3Browser is placed.

MouseOver: Tells whether mouse cursor is on Screen. If so, the property is


enabled. Otherwise, it is False. This property is read-only, and its default value is
False. This property is available in runtime only.

MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. It is a read-only property, available in runtime.

RefreshTime: Specifies query’s refresh time in relation to the specific database.


Through this property it is possible to verify data update at the related Historic
referring to a specific stipulated time (in milliseconds). When RefreshTime property
is 0, there is no data update, and data remains unchanged.

RowHeight: Defines E3Browser’s rows height, in pixels. Default value is 20.

Screen: Contains a reference to the Screen object where E3Browser is placed.

SelectRow: Determines whether it is possible to select E3 Browser’s rows. If


True, these rows can be selected; otherwise, row selection is disabled.

Properties 311
E3 - Scripts - Reference Manual

SourceQuery: Contains a reference to the E3Query to which E3Browser is


connected.

NOTE: To change E3Browser’s query via scripts (in case the new query modifies
the fields of the original query), in addition to changing SourceQuery property, you
must use RetrieveE3QueryFields() and Requery() methods.

TabStop: Indicates whether E3Browser will have keyboard focus when the user
uses [Tab] key to browse fields on a Screen.

TextBkColor: Specifies E3Browser’s data cells background color. Default value


is white (RGB (255, 255, 255)).

TextColor: Specifies E3Browser’s text color. Default value is black (RGB


(0,0,0)).

Tip: Contains a help text presented as a “tip” when the user places the mouse
pointer on the object.

TitleTipBkColor: Specifies E3Browser’s tip background color. Default value is


black (RGB (0, 0, 0)).

TitleTipTextColor: Specifies E3Browser’s tip text color. Default value is gray


(RGB (204, 204, 204)).

ToolbarBkColor: Specifies E3Browser’s toolbar background color. Default


value is beige (RGB (236, 233, 216)).

ToolbarFont: Determines E3Browser’s toolbar text font. This property cannot be


used in scripts and/or links, being configured only via Studio.

ToolbarForecolor: Specifies E3Browser’s toolbar foreground color. Default


value is black (RGB (0, 0, 0)).

Visible: Enables/disables visibility in a selected field at E3Browser. If True, the


field is visible; otherwise, the field is not visible, in runtime. Default value is True.

Width: Determines object’s width, in HIMETRIC units.

X: Defines object’s left horizontal coordinate, in HIMETRIC units.


312 Properties
E3 - Scripts - Reference Manual

Y: Defines object’s upper vertical coordinate, in HIMETRIC units.

/ 7 )"

Axes: Returns E3Chart’s axes collection. From this point, collection’s properties
can be modified.

BackColor: Determines E3Chart’s background color. For this color to be


displayed, ShowBackground property must be set to True. Default value is beige
(RGB (236, 233, 216)).

Enabled: Enables ActiveX in the project. Default value is True.

ForeColor: Determines E3Chart’s foreground color. Default value is black


(RGB (0, 0, 0)).

Frame: Returns the object’s parent frame. This property is available in runtime
only.

GridBkColor: Determines E3Chart’s grid background color. Default value is


white (RGB (255, 255, 255)).

HasFocus: If True, it indicates that E3Chart has keyboard focus.

Height: Determines object’s height, in HIMETRIC units.

HorAxisTitle: Determines main horizontal axis title.

HorGrid: Determines the type of line that will be applied to E3Chart’s horizontal
grid.

Available options for HorGrid


OPTION DESCRIPTION
0- Solid Applies a solid type line to E3Chart’s horizontal grid.
1- Dash Applies a dash type line to E3Chart’s horizontal grid.
2- Dot Applies a dot type line to E3Chart’s horizontal grid (default)
3- Dashdot Applies a dash-dot type line to E3Chart’s horizontal grid.
4- Dashdotdot Applies a dash-dot-dot type line to E3Chart’s horizontal grid.
5- Invisible Applies an invisible line to E3Chart’s horizontal grid.

HorGridColor: Determines E3Chart’s horizontal grid color. Default value is


gray (RGB (192, 192, 192)).

Properties 313
E3 - Scripts - Reference Manual

HorMinorTicks: Determines the number of minor ticks on the grid’s horizontal


scale. Default value is 1. Example:
Sub CommandButton1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
Old = E3Chart1.HorMinorTicks
For i = 0 to 5
E3Chart1.HorMinorTicks = i
MsgBox "Próximo valor"
Next
E3Chart1.HorMinorTicks = old
End Sub

HorScaleBegin: Determines the initial value to be applied on the grid’s main


horizontal scale. This value can either be numerical (for XY E3Charts) or Data (for
fixed time scale E3Charts). For real-time E3Charts, the property does not apply, and
you should use TimeSpan property instead.

HorScaleEnd: Determines the final value to be applied on the grid’s main


horizontal scale. This value can either be numerical (for XY E3Charts) or Data (for
fixed time scale E3Charts). For real-time E3Charts, the property does not apply, and
you should use TimeSpan property instead.

314 Properties
E3 - Scripts - Reference Manual

HorScaleFormat: Contains a text representing a mask inside which the horizontal


scale values are displayed, This mask can represent several types of values:

General: Has no specific formatting, adapting itself automatically to the specified


value.

Number: Presents both whole and decimal numbers. The user can opt for up to 15
decimal places, for separating thousands or not, and for how to signal negative
numbers. For either too small or too large numbers, use Scientific format.

Date: Presents numerical values for date and time (when it applies). To display
time only, use the equivalent format.

Time: Presents numerical values for time and date (when it applies). To display
date only, use the equivalent format.

Percent: Multiplies the number by 100 and adds the percentile symbol (%) to it. It
may have up to 15 decimal places.

Scientific: Presents a number with exponent and mantissa notation. Ideal for
number with varied magnitude. It may have up to 15 decimal places.

Special: Allows formatting whole numbers in non-decimal bases (hexadecimal,


octal, or binary, for example).

Other: Allows editing any formatting code directly in this field, or then select a
format created previously.

These formats’s masks, as instanced in the field Type, will be displayed in the
Properties List (Ex: M/d/yy H:mm, 0E-00, etc.).

HorTickUnit: Determines the number of tick units on the grid. When value is 0, the
spacing is automatic.

Layer: Indicates the number of the layer where E3Chart is placed.

Legend: Returns E3Chart’s legend. From this point, legend’s properties can be
modified.

MouseOver: Tells whether mouse cursor is on Screen. If so, the property is


enabled. Otherwise, it is False. This property is read-only, and its default value is
False. This property is available in runtime only.

Properties 315
E3 - Scripts - Reference Manual

MouseOverChild: Tells whether mouse cursor is over one of the objects inserted
in Screen. If so, the property is enabled. Otherwise, it is False. This property is read-
only, and its default value is False. This property is available in runtime only.

Pens: Returns the E3Chart’s Pen Collection. The object Pens Collection is used
to insert/remove and stop the pens available at E3Chart. This property is read-only.

Queries: Returns Queries Collection inside E3Chart. This Collection is used to


insert/remove/access the queries available at E3Chart. This property is read-only.

RefreshTime: Determines E3Chart’s refresh time.

ScaleFont: Determines the font used on the grid’s text. Example:


Sub CommandButton1_Click()
Screen.Item("E3Chart1").ScaleFont = "Times New Roman"
Screen.Item("E3Chart1").ScaleFont.Size = 12
Screen.Item("E3Chart1").ScaleFont.Italic = true
End Sub

Screen: Contains a reference to the Screen object where E3Chart is placed.

ShowBackground: Shows/hides graphic’s background. If True, graphic’s


background is visible; otherwise, background is transparent. The color chosen in
BackColor property will not be displayed if this property is set to False (default
value).

ShowBottomScale: If True, the main horizontal scale is shown in the bottom of


the grid. Otherwise, it is not shown. Default value is True. Example:
Sub CommandButton1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
oldBottomScale = E3Chart1.ShowBottomScale
MsgBox "Display axis"
E3Chart1.ShowBottomScale = True
MsgBox "Hide axis"
E3Chart1.ShowBottomScale = False
MsgBox "Return..."
E3Chart1.ShowBottomScale = oldBottomScale
End Sub

316 Properties
E3 - Scripts - Reference Manual

ShowGridBackground: Shows/hides grid’s background. If True (default), grid’s


background is visible; otherwise, background is transparent. The color chosen in
GridBkColor property will not be displayed if this property is set to False.

ShowLeftScale: If True, the main vertical scale is shown on the left of the grid.
Otherwise, it is invisible. Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Chart.ShowLeftScale = not Chart.ShowLeftScale
End Sub

ShowRightScale: If True, the main vertical scale is shown on the right of the grid.
Otherwise, it is invisible. Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Chart.ShowRightScale= not Chart.ShowRightScale
End Sub

ShowTitle: If True, E3Chart’s main title is visible. Otherwise, it is not displayed.


Title property contains the title to be shown at E3Chart. Example:
Sub CommandButton1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
oldTitle = E3Chart1.Title
oldShowTitle = E3Chart1.ShowTitle
E3Chart1.Title = "test!"
MsgBox "Mostrar"
E3Chart1.ShowTitle = True
MsgBox "Hide"
E3Chart1.ShowTitle = False
MsgBox "Return"
E3Chart1.Title = oldTitle
E3Chart1.ShowTitle = oldShowTitle
End Sub

Properties 317
E3 - Scripts - Reference Manual

ShowTopScale: If True, the main horizontal scale is shown in the top of the grid.
Otherwise, it is not shown. Default value is False. Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Chart.ShowToptScale= not Chart.ShowTopScale
End Sub

TabStop: Determines whether -0 key can be used in the system. If True,


-0 key use is enabled. Otherwise, the key cannot be used.

TimeSpan: Indicates time scale on E3Chart’s main horizontal axis when it is


configured to show real-time scale. This property’s value always represents seconds.
Default value is 60.

Tip: Contains a help text presented as a “tip” when the user places the mouse
pointer on the object.

Title: Determines E3Chart’s main title. For this title to be visible on the chart,
ShowTitle property must be set to True.

TitleFont: Determines E3Chart’s main title font. Example:


Sub CommandButton1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
E3Chart1.Title = "Test"
E3Chart1.ShowTitle = True
MsgBox "Changes font"
E3Chart1.TitleFont = "Times New Roman"
MsgBox "Troca tamanho"
E3Chart1.TitleFont.Size = 20
End Sub

VerAxisTitle: Determines main vertical axis’ title.

VerGrid: Determines the type of line that will be applied to E3Chart’s vertical
grid.

318 Properties
E3 - Scripts - Reference Manual

Available options for VerGrid


OPTION DESCRIPTION
0- Solid Applies a solid type line to E3Chart’s vertical grid.
1- Dash Applies a dash type line to E3Chart’s vertical grid.
2- Dot Applies a dot type line to E3Chart’s vertical grid
(default)
3- Dashdot Applies a dash-dot type line to E3Chart’s vertical
grid.
4- Dashdotdot Applies a dash-dot-dot type line to E3Chart’s vertical
grid.
5- Invisible Applies an invisible line to E3Chart’s vertical grid.

VerGridColor: Determines E3Chart’s vertical grid color. Default value is gray


(RGB (192, 192, 192)).

VerMinorTicks: Determines the number of minor ticks on the grid’s vertical


scale. Default value is 1.

VerScaleBegin: Determines the value at the top of E3Chart grid’s main vertical
axis. Default value is 100.

VerScaleEnd: Determines the value at the bottom of E3Chart grid’s main


vertical axis. Default value is -100.

VerScaleFormat: Contains a text representing a mask inside which the vertical


scale values are displayed. This mask can represent several types of values:

General: Has no specific formatting, adapting itself automatically to the specified


value.

Number: Presents both whole and decimal numbers. The user can opt for up to 15
decimal places, for separating thousands or not, and for how to signal negative
numbers. For either too small or too large numbers, use Scientific format.

Date: Presents numerical values for date and time (when it applies). To display
time only, use the equivalent format.

Time: Presents numerical values for time and date (when it applies). To display
date only, use the equivalent format.

Percent: Multiplies the number by 100 and adds the percentile symbol (%) to it. It
may have up to 15 decimal places.

Properties 319
E3 - Scripts - Reference Manual

Scientific: Presents a number with exponent and mantissa notation. Ideal for
number with varied magnitude. It may have up to 15 decimal places.

Special: Allows formatting whole numbers in non-decimal bases (hexadecimal,


octal, or binary, for example).

Other: Allows editing any formatting code directly in this field, or then select a
format created previously.

These formats’s masks, as instanced in the field Type, will be displayed in the
Properties List (Ex: M/d/yy H:mm, 0E-00, etc.).

VerTickUnit: Determines the number of tick units on the grid. When value is 0, the
spacing is automatic.

Visible: Enables/disables visibility in a selected field at E3Chart. If True, the field


is visible; otherwise, the field is not visible, in runtime. Default value is True.

Width: Determines object’s width, in HIMETRIC units.

X: Defines object’s left horizontal coordinate, in HIMETRIC units.

Y: Defines object’s upper vertical coordinate, in HIMETRIC units.

/ 7

AutoQuery: Determines pen’s auto query. If True, the pen will use auto query.
Otherwise, it will not be used. Auto query cannot be used in the following situations:
when SQL is customized by the user; when Storage is being used; or when several
tables are being used.

BkColor: Determines the background color used in an area type pen. Default
value is empty.

BufferSize: Determines the number of points kept at the real-time pen. After this
value, the oldest data are discharged. This property has no effect with historic pens.
This property is considered only after pen connection. For further information, see
Connect() method. Default value is 10,000, and it must always be higher than 0.

Color: Determines E3Chart’s pen line color. Default value is empty.

320 Properties
E3 - Scripts - Reference Manual

DataSourceType: Determines pen'


s data source. The options available for this
property are:

Available options for DataSourceType


OPTION DESCRIPTION
M> - Indicates the pen is connected to a tag updated in real-
time.
9> E $ Indicates the pen is connected to data coming from a
query.
:> %+ Indicates the pen is connected to real-time tag and
historic data simultaneously.

When DataSourceType property is 0 (Real-Time), XLink and YLink properties


inform the links to be used; or then UseTimeStamp property informs that YLink
property’s timestamp will be used, instead of XLink. When DataSourceType is 1
(Historic), XField and YField properties inform the fields to be used in the table.
QueryName property indicates the name of the table being used. When
DataSourceType is 2 (Mixed), both options 0 and 1 will work simultaneously for the
pen.

NOTE: In runtime, if the property is updated and the real-time data is not shown,
the method Connect() must be called to show the real-time data again.

Example:
Sub CommandButton1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
MsgBox "Click OK to create the pen"
Set Pen = E3Chart1.Pens.AddPen("Pen1")
Pen.DataSourceType = 0 'real-time
Pen.YLink = "Data.TagDemo1"
Pen.UseTimeStamp = True 'uses timestamp in X
Pen.Color = RGB(255,0,0)
Pen.Docstring = "test"
MsgBox "Click OK to connect"
Pen.Connect() 'starts getting data
MsgBox "Click OK to frame"
E3Chart1.FitPen(0)
MsgBox "Click OK to remove pen"
E3Chart1.Pens.Remove(Pen.Name)
End Sub

DigitalData: Determines digital plotting style. If True, the digital plotting system
will assume that data variation is digital, that is, its value varied instantly in relation
Properties 321
E3 - Scripts - Reference Manual

to the last one. Otherwise, the variation is considered linear and a straight-line
segment unites the points. Default value is True.

DocString: Allows associating an explanatory text for pen documentation.

EnableHighLimit: Enables/disables high limit checking.

EnableLowLimit: Enables/disables low limit checking.

HighLimit: Determines alarm’s high limit.

LimitPenColor: Determines pen color when in alarm.

LimitPenBkColor: Determines pen’s background color when in alarm.

LowLimit: Determines alarm’s low limit.

Name: Determines the name of the pen.

PenLineStyle: Determines pen line style. The available options are:

Available options for PenLineStyle


OPTION DESCRIPTION
M> + Solid line.
9> = 2 Dash type line.
:> = Dot type line.
F> = 2= Dash-dot type line.
I> = 2= = Dash-dot-dot type line.
L> ;, No line.

PenType: Specifies the pen drawing type (0= line; 1= dot; 2= dot-line; 3= area).
Example:
Sub CommandButton1_Click()
Set Pen1 = Screen.Item("E3Chart1").Pens.Item("Pen1")
Pen1.PenType = 1
End Sub

QueryName: Determines the name of the query being used by the pen. Use this
property if DataSourceType property is set for 1 (Historic).

ScaleX, ScaleY: These properties indicate to which E3Chart’s X and Y scales the
pen is associated, respectively. The scale configured for ScaleX is horizontally
322 Properties
E3 - Scripts - Reference Manual

oriented, that is, it is placed either at E3Chart’s top or base. The scale configured for
ScaleY is vertically oriented; it is placed either on the object’s left or right side.
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Set Pen = Chart.Pens.AddPen("DemoTagPen2")
Pen.YLink = "Data.TagDemo2"
Pen.UseTimeStamp = True
' Scale must be pre-existent.
Pen.ScaleY = "ScaleForDemoTag2"
Pen.Connect
End Sub

ScanValue: Defines the expected reading time of the real-time pen' s tag. This
value is considered in the analogical design mode. When the value exceeds the value
determined by ScanValue, it is considered that tag value is was not altered in the
interval. Otherwise, when ScanValue value is zero, pen data are always connected to
a straight line uniting these two points as if value varied linearly. Property’ value are
represented in milliseconds.

UseTimeStamp: Determines the use, for the horizontal axis, of the timestamp
value associated to the vertical axis. See example at DataSourceType property.

Visible: Determines whether the pen is visible at E3Chart. If True, the pen is
visible in runtime. Otherwise, the pen is invisible. Example:
Sub CommandButton1_Click()
Set Pen1 = Screen.Item("E3Chart1").Pens.Item("Pen1")
Pen1.Visible = Not Pen1.Visible
End Sub

Width: Determines pen line width. Example:


Sub CommandButton1_Click()
Set Pen1 = Screen.Item("E3Chart1").Pens.Item("Pen1")
Pen1.Width = 10
End Sub

XField: Query field used to plot data on a horizontal scale. Used for historic
pens.

XLink: Link used to plot data on a horizontal scale. When this property’s value is
altered, the pen is automatically disconnected. After the configuration, you need to
call Connect() method for the pen to start receiving data relating to this link. Used
for real-time pens.
Properties 323
E3 - Scripts - Reference Manual

YField: Query field used to plot data on a vertical scale. Used for historic pens.

YLink: Link used to plot data on a vertical scale. When this property’s value is
altered, the pen is automatically disconnected. After the configuration, you need to
call Connect() method for the pen to start receiving data relating to this link. Used
for real-time pens.

/ 7 -

Count: Contains the total number of pens inserted in E3Chart. This is a red-only
property.

/ 7" ; - -

Count: Contains E3Chart’s total number of queries. This is a read-only property.

/ 7$ '

Caption: Defines a title for the column.

Column: Returns the column identifier. See column identification table.

Format: Configures the format used in the column.

Index: Returns column position in the Legend.

Name: Determines column name. Column names can be seen in column


identification table.

TextAlign: Returns column text alignment. The options available for this
property:

Available options for TextAlign


OPTION DESCRIPTION
M> Left alignment.
9> .2 Right alignment.
:> Center alignment.

324 Properties
E3 - Scripts - Reference Manual

Width: Returns column width.

/ 7. 4 !

Count: Returns the total number of columns in the legend.

LegendPos: Indicates legend position at E3Chart.

Available options for LegendPos


OPTION DESCRIPTION
M> .- ' Shows the legend at the top.
9> . Shows the legend to the left.
:> . Shows the legend at the bottom.
F> . .2 Shows the legend to the right..

ShowAllPens: When the property is True, all E3Chart pens are shown in legend.
The property Visible of the pen is ignored. When ShowAllPens is False, only the
pens with Visible = True are shown.

Example:
Sub CommandButton1_Click()
Set E3Chart1 = Screen.Item("E3Chart1")
E3Chart1.Legend.ShowAllPens = not E3Chart1.Legend.ShowAllPens
End Sub

ShowHeader: Determines header’s visibility. If True, header is shown.


Otherwise, it is hidden.

Size: Determines legend size. This size can stand for either height or width,
depending on the legend'
s orientation.

Visible: Determines legend’s visibility. If True, the legend is visible at E3Chart.


Otherwise, it is hidden.

/ 7/

Note: HorAxis and VerAxis are axes properties that access default horizontal
and vertical axis, respectively. For example, instead of typing
Chart.Axes.Item("HorizontalAxis"), you can type Chart.Item.HorAxis.
Further user-generated axes will have their own names, depending on the case.

Properties 325
E3 - Scripts - Reference Manual

Color: Determines axis’ main color.

Count: Returns the total number of axes at E3Chart, including the two main axes
(horizontal and vertical).

Format: Determines axis value format.

GridColor: Determines grid’s line color.

GridStyle: Determines grid’s line style. The available options are the following:

Available options for GridStyle


OPTION DESCRIPTION
M> + Solid line.
9> = 2 Dash type line.
:> = Dot type line.
F> = 2+ W Dash-dot type line.
I> = 2+ + W Dash-dot-dot type line.
L> &" W No line (invisible).

Inverse: Inverts the order of minimum and maximum values in a numerical scale.
Usually, in vertical scales, the minimum value is placed at the bottom, whereas the
maximum value is at the top of the scale. In horizontal scales, the minimum value is
at the left side of the scale, while the maximum value is placed at its right side.
When Inverse property is True, however, this order is inverted: maximum values at
the bottom or the left, minimum values at the top or the right.

MinorTicks: Determines the total number of minor ticks.

Mirror: Indicates axis’ mirror effect. If True, the axis is mirrored at the opposite
side of the original axis. Otherwise, the axis remains in the same position.

Name: Determines axis name.

Position: Determines axis position in relation to E3Chart’s grid. The available


options are the following:

Available options for Position


OPTION DESCRIPTION
M> %' The axis is at the left of the scale.
9> %' .2 The axis is at the right of the scale.

326 Properties
E3 - Scripts - Reference Manual

'- ' The axis is at the top of the scale.


:> %
F> %' The axis is at the bottom of the scale.

ScaleType: Determines the type of scale shown by the axis. The options available
for this item are:

Available options for ScaleType


OPTION DESCRIPTION
M> ;, " $ Numerical scale.
9> + Shows last period (Real-time)
:> + Time interval (Historic)

Example:
Sub CommandButton1_Click()
Set Chart = Screen.Item("E3Chart1")
Set newAxis = Chart.Axes.AddAxis("")
For i = 0 to 2
MsgBox "clique ok para mudar o tipo de escala"
newAxis.ScaleType = i
Next
MsgBox "Remove axis"
Chart.Axes.Remove(newAxis.Name)
End Sub

ShowGrid: Determines grid lines visualization. If True, grid lines are shown.
Otherwise, grid lines are hidden.

Title: Determines axis title.

Visible: Determines axis visibility on the grid. If True, axis is visible in the grid.
Otherwise, it is hidden.

/ 70
Count: Returns E3Chart’s total number of axes, including the two main axes
(horizontal and vertical).
HorAxis: Returns main horizontal axis. This axis is also a part of the axes lines.
Item: Returns the axis via its name or index. Index = 0 always stands for the main
horizontal axis, and index = 1 always stands for the main vertical axis.
VerAxis: Returns main vertical axis. This axis is also a part of the axes lines.

Properties 327
E3 - Scripts - Reference Manual

/ < 1 '

DBServer: Indicates the name of the Database where the information of the
formula (its units and sets of values) will be recorded. Default value is empty.
TableName: Indicates the name of the tables where the information of the
formulas will be recorded. Default value is empty.

/ 8 8

Public: When an ElipseX property is public (True), it will be visible outside the
library. Otherwise, the property will be internal, and only visible for the object.
Default value is True. Public properties are represented by the icon.

Type: Determines the type of value the property accepts (e.g.: Boolean, Double,
Integer, Variant, etc). When the type of object is specified (e.g.: DemoTag, IOTag,
XObject, etc), the property behaves as follows:

a) In case ElipseX is disabled: this property works as a string, which specifies the
configured object’s instance path.

b) In case ElipseX is enabled: in writing, the property works the same way as when
the object is deactivated. However, in reading, the property returns the specified
object, in case it exists. If the path does not point to an existing object, the property
returns Nothing.

/
NOTE: The object Report encapsulates the object ActiveReports (or "AR"), which
is the report itself.
To create scripts in Reports, we use the Scripts Editor of the report itself. To
manipulate the report object, we use the following syntax:
Report.Sections("<SectionName>").Controls("<ObjectName>")._
<PropertyName> = <Value>
where <SectionName> is the name of the section in the report; <ObjectName> is the
name of the object that is inside the specified section; <PropertyName> is the name
of the object'
s property; <Value> are values that the property is going to receive.
For example:

328 Properties
E3 - Scripts - Reference Manual

Report.Sections("PageHeader").Controls("E3Chart1")._
GridBkColor= RGB (255, 0, 255).

Caption: Contains the report title in the preview window title bar. Default value
is empty.

/ 4 -

NOTE: The properties described here are part of the ActiveReport (or “AR”) object
encapsulated in the Report object. These properties are valid within the scope of the
AR, and cannot be accessed outside this object.

_PageBottomMargin: Determines report’s page bottom margin, in twips


(1 twip = 1/1440 inch). Default value is 1440 (1 inch, or 2,54 cm).

_PageLeftMargin: Determines report’s page left margin, in twips


(1 twip = 1/1440 inch). Default value is 1440 (1 inch, or 2,54 cm)

_PageRightMargin: Determines report’s page right margin, in twips


(1 twip = 1/1440 inch). Default value is 1440 (1 inch, or 2,54 cm)

_PageTopMargin: Determines report’s page top margin, in twips


(1 twip = 1/1440 inch). Default value is 1440 (1 inch, or 2,54 cm).

AllowSplitters: Allows report’s view Screen to be split in two. This property is


only available in runtime. If False (default value), the split bar does not appear in the
Screen.

documentName: Determines document’s name for the report. This name appears
in the printing manager and can be used to easily identify the report. Default value is
"ActiveReports Document".

MaxPages: Establishes the maximum number of pages for the report. When this
number is reached, E3 stops processing the document. Default value is 10.

ParentReport: This property is a variable for internal use in the system, and
contains a reference to the Report. This is a red-only property, and it is valid only for
DataInitialize and ReportEnd events.

PrintWidth: Determines report print area width, in twips. If you change report
size in runtime, print width should also be adjusted to make sure the report occupies

Properties 329
E3 - Scripts - Reference Manual

the whole print area. Print area size should also include margins width, so that the
report is not larger then the size of the paper. If this happens, the error will be
signaled by a red dotted line printed in each page of the report.

RulerVisible: If True, both a vertical and a horizontal ruler will be displayed on


the report’s preview window. Otherwise, these rulers remain hidden.

ScriptDebuggerEnabled: Enables/disables the ActiveReports debugger (JIT),


which debugs the scripts associated to reports. This debugger is not available for all
E3, only for reports.

ScriptLanguage: Indicates the language used to interpret the scripts associated to


a report. Default language is VBScript, but JScript can also be used.

ShowParameterUI: This property enables/disables the parameters of Query’s


dialogue box, which appears when the report is being executed. If True, these
parameters are shown; otherwise, they are hidden.

Status: Returns report status. The options available for this property are:

Available options for Status


OPTION DESCRIPTION
M> == + Report is idle.
9> == , . Report is running.
:> == ' + Report is completed.
F> == $ + Report has been cancelled.

TOCEnabled: Enables/disables report’s table of contents. If True, the table is enabled;


otherwise, the report has no table of contents. Default value is True.

TOCVisible: Determines report’s table of contents visibility. If True, the table of


contents is visible; otherwise, it is hidden. Default value is True.

ToolbarVisible: Enables/disables a toolbar on Report’s print preview window. If True,


the tool bar is enabled; otherwise, there will be no toolbar in this window.

UserData: Sets or returns user’s specified information. This property is similar to


Visual Basic’s Tag property, but will be exported and saved into the .rpx file. It can
be used to save and load any custom information needed in the report designer.

Version: Returns the product’s version number.


330 Properties
E3 - Scripts - Reference Manual

WaterMark: Adds a specified image to the report’s background (watermark).


Watermarks are texts or pictures placed under the document’s text, which help make
the document visually more interesting. Default value is empty (no image).

Picture 28: Example of Watermarks

WaterMarkAlignment: Determines watermark’s alignment in the report. The


options available are:

Available options for WaterMarkAlignment


OPTION DESCRIPTION
M> ++ 0- ' Aligns the image to the top and left.
9> ++ 0- ' .2 Aligns the image to the top and right.
:> ++ 0 Aligns the image to the center. (Default).
F> ++ 0 Aligns the image to the bottom and left.
I> ++ 0 .2 Aligns the image to the bottom and right.

WaterMarkPrintOnPages: Sets or returns a value indicating the specific pages to


which the watermark should be added. The syntax can include a single page, page
range, or a combination of both. For example: 1, 5-8, 9, 10-15. Default value is
empty.

WaterMarkSizeMode: Sets or returns how the watermark will be sized when the
image is rendered on canvas. The available options are:

Available options for WaterMarkSizeMode


OPTION DESCRIPTION
M> ++ $' Clips the image. (Default).
9> ++ $2 Stretches the image to fill the print area.
:> ++ X Zooms in on the image.

Properties 331
E3 - Scripts - Reference Manual

BackColor: Specifies the section’s background color. This color is only visible
when BackStyle property is set to 1-ddBKNormal. Default value is white (RGB
(255, 255, 255)).

BackStyle: Specifies the section’s background style. The options available for
this property are: 0- ddBKTransparent: transparent background; and
1- ddBKNormal: normal background.

CanGrow: Determines the text’s ability to stretch to page’s size. If True, the text
follows any height or width variation in the object when it grows in size. Otherwise,
text default configurations are maintained. Default value is True.

CanShrink: Determines the text’s ability to shrink to page’s size. If True, the text
follows any height or width variation in the object when it reduces its size.
Otherwise, text default configurations are maintained. Default value is False.

height: Determines report page section’s height. Default value is 360.

IsRepeating: If True, determines section repetition on report’s last page.


Otherwise, there is no repetition.

Name: Indicates report section’s name.

Type: Returns section type. The options available are:

Available options for Type


OPTION DESCRIPTION
M> ' E + Report header.
9> ' 1 Report footer.
:> . E + Page header.
F> . 1 Page footer.
I> ,'E + Group header.
L> ,'1 Group footer.
>= Detail.

Visible: Enables/disables report section’s visibility. If True, the section is visible


in the report. Otherwise, it is hidden. Default value is True.

332 Properties
E3 - Scripts - Reference Manual

/ " > =

ColumnLayout: Determines whether Group Header uses the same layout as the
columns defined at “Detail” section. If True, the number The ColumnLayout property
specifies report column layout. If the property is configured for True, the number of
columns in the “Detail” section will be reflected in the group of page headers and footers.
Otherwise, it is not used.

DataField: The DataField property returns the report fields data. Defines an
obligatory field for a group inside the Detail object content. This value is adjusted in the
name of all fields at the report data source or at a name of a customized field that is
inserted in the field collection. When this property is adjusted, the report will create a new
group every time the field value change in the detail data registrations.

GrpKeepTogether: Determines if the section group header will be printed as a


sole block at the same report page. The default value of this property is 0- GrpNone.
The available options are the following:

Available options for GrpKeepTogether


OPTION DESCRIPTION
M> '; The page can be broken immediately after a group
header.
9> '1 = The group header will be printed with the first “Detail”
section of the same page, column of the report.
:> '0 The group header, detail and group footer will be
printed together in the same page of the report.

KeepTogether: The KeepTogether property determines if the sections of the report


will print as an only block in the same page. The options available for this property are the
following:

Available options for KeepTogether


OPTION DESCRIPTION
0 - ddGrpNone There is a page break after the report.
1- ddGrpFirstDetail The report will press the “Detail” section in the
same page or column.

NewColumn: The NewColumn property inserts a new column break before or


after the report section printing. The default value of this property is M> ++; ; .
The options available for this property are the following:

Properties 333
E3 - Scripts - Reference Manual

Available options for NewColumn


OPTION DESCRIPTION
M> ++; ; There is no page break in this section.
9> ++; Starts the printing section in a new page.
:> ++; 0 Starts a new page after the section printing.
F> ++; 0 Starts printing in a new page and a new page after
printing the section.

NewPage: The NewPage property inserts a page break in the report. The default
value of this property is M- ddNPNone. The options available for this property are
the following:

Available options for NewPage


OPTION DESCRIPTION
M> ++; ; There is no page break in this section.
9> ++; Starts printing in a new page.
:> ++; 0 Starts a new page after the section printing.
F> ++; 0 Starts printing in a new page and a new page after
printing the section.

Repeat: The Repeat property determines if the group header will be printed again
after being associated to the “Detail” section whenever there are multiple pages,
columns or page breaks in the report. The default value of this property is 0-
ddRepeatNone. The available options are the following:

Available options for Repeat


OPTION DESCRIPTION
M> ++ ' ; There is no header group printing.
9> ++ ' . Print the header group at the top of the page
according to the “Detail” section specifications.
:> ++ ' , Print the header group at the top of the column of
the report page according to the “Detail” section
specifications.
F> ++ ' 0 Print the header group and other objects at the top
of the column of the report page according to the
“Detail” section specifications.

UnderlayNext: The UnderlayNext property determines if the section should print


a section after the other, consecutively. If the property is configured for True, the
following section will start printing from the superior coordinate of the section in the
report page. Otherwise this feature is not used. The default value of this property is
False.
334 Properties
E3 - Scripts - Reference Manual

/ $ ! ,

ColumnCount: The CollumCount property determines the number of columns in the


page of report. The width of each column must be equal to report printable area divided by
the number of columns. The default value of this property is 1.

ColumnDirection: The CollumnDirection property determines the direction of the


page details. The available options are the following:

Available options for ColumnDirection


OPTION DESCRIPTION
M> ++ == 0$ Print each report section below each column and
followed by the next right column.
9> ++ =0$ = Print each report section on the right from the
first line and followed by the second line, and so
on.

Layout specified according to the option configured:

ColumnSpacing: This property specifies the column spacing in the page details.
The default value of this property is 0.

/ . > 1

ColumnLayout: The ColumnLayout property specifies report column layout. If


the property is set up as True, Header/Footer column layout will be the same as
defined for the “Detail” section. Otherwise, it is not used. The default value of this
property is True.

PrintAtBottom: Determines if the GroupFooter or the ReportFooter will be


printed in the background of the page. If the property is configured for True and the
report contains a PageFooter, the report GroupFooter and the ReportFooter will be
printed above the “PageFooter” section. Configuring more than a section to print
Properties 335
E3 - Scripts - Reference Manual

the report background, will make the following “Footer” sections be printed in
separate pages.

/ / ,

BackColor: This property specifies object background color in the report. The
effect of this property will only be visible if BackStyle property is enabled to option
9> ++ <; . You can use any whole number representing a valid color. It is
also possible to set the color through red, green and blue components of the RGB
function. The value of each component is a whole number whose interval varies
from 0 to 255. For example, a greenish blue can be specified with the whole value
4966415 or 15, 200,75, as red, green and blue components, as shown in the example.
The default value of this property is white (RGB 255, 255, 255).

BackStyle: This property specifies the style of background of the report section,
as follows: M> ++ <- ' = transparent background; 9> ++ <; =
normal background (default).

Height: This property specifies the height of the report object. The default value of
this property is 360.

Left: The left property returns the left positioning value of the report object. The
default value of this property is empty.

Name: The Name property specifies the object name. the default value of this
property is empty.

Tag: The Tag returns the type of tag associated to the object, i.e., whether it is Boolean,
string, integer, etc.

top: The top property returns the value of the top of the object. The default value of
this property is 0.

Visible: The Visible property specifies object visibility in the report. If the option
is setup to True, the object is visible in the report. Otherwise, the object is not
visible. The default value of this property is True.

336 Properties
E3 - Scripts - Reference Manual

/ 0 +

Alignment: This property specifies the object'


s text alignment in the report. The
available options are the following:

Available options for Alignment


OPTION DESCRIPTION
M> ++ % Align the text at the object'
s left.
9> ++ % .2 Align the text at the object'
s right.
:> ++ % Align the text at the object'
s center.

BarWidth: The BarWidth property is the bar width of bar codes. Setting the width to
1, the object's bar is expanded up to 15 points, and so on. The higher the number the
property is set, the wider the bar code'
s bar. the default value of this property is 1.

CaptionPosition: The CaptionPosition property specifies the text position in the


object. Aligned text is the content specified in the Caption property. The default value of
this property is 0-ddbcCaptionNone. The options available for this property are the
following:

Available options for CaptionPosition


OPTION DESCRIPTION
M> ++"$ ' ; Text is shown as it has been created in the
object.
9> ++"$ ' 0" & Text is positioned above object'
s bar code.
:> ++"$ ' Text is positioned below object'
s bar code.

Direction: The Direction property returns the report' s data field. The default
value of this property is 0- ddbcLefttoRight. The options available in this property
are the following:

Available options for Direction


OPTION DESCRIPTION
0- ddbcLefttoRight Bar code is horizontally directed from left to
right.
1- ddbcRighttoLeft Bar code is horizontally directed from right to
left.
2- ddbcToptoBottom Bar code is vertically directed from top to
bottom.

EnableCheckSum: Enable/Disable the reading of CheckSum value (bar code control


character). If the property is enabled to False, only codes with CheckSum will be
affected.
Properties 337
E3 - Scripts - Reference Manual

Font: The Font property specifies the object'


s font. The default value of this property
is empty.

NOTE: This property is not used in script and/or associations.

ForeColor: The ForeColor property specifies the object'


s fore color. In the scripts,
use VBScript RGB function to create the color to be associated to this property. The
default value of this property is black (RGB (0, 0, 0)).

Style: The Style property specifies the bar code'


s style. The available options are
the following:

Available options for Style


OPTION DESCRIPTION
M> ++"$; Bar code' s default style.
9> ++"$0 FP Bar code' s ANSI 3 of 9 style (Code 39). Use
letters, numbers, -,*, $, /, +, %, etc.
:> ++"$
0 FP% Bar code' s extended ANSI 3 of 9 style (Extended
code 39). Use complete characters ASCII.
F> ++"$ + T:T TL Bar code' s style.2 of 5 Use only numbers.
I> ++"$ + :L & Bar code' s collated style 2 of 5. Use only
numbers.
L> ++"$ + :L Bar code' s Matrix 25 style.
> ++"$ + FP Bar code' s style Code 39, use letters, numbers, -
,*, $, /, +, %, etc.
O> ++"$ + FP% Bar code' s style Extended code 39. Use complete
characters ASCII.
K> ++"$ + T9:KT Bar code' s 128 A style. Use numbers,
punctuation, or letters.
P> ++"$ + T9:KT" Bar code' s 128 B style. Use strings, numbers,
punctuation, or letters.
9M> ++"$ + T9:KT$ Bar code' s 128 C style. Use only numbers.
99> Bar code' s 128 Automatic style. Use complete
++"$ + T9:K , characters ASCII. Automatically select codes
among the 128 A, B and C to set the lowest value
to the bar code.
9:> ++"$ + TPF Bar code' s style Code 93. Use letters, numbers, -
,*, $, /, +, %, etc.
9F> ++"$ + TPF% Bar code' s style Extended code 93. Use complete
characters ASCII.
9I> ++"$ Bar code' s style MSI Code . Use only numbers.
9L> ++"$ ; Bar code' s PostNet style. Use only numbers with
a verification digit.

338 Properties
E3 - Scripts - Reference Manual

OPTION DESCRIPTION
9 > ++"$ + " Bar code' s style. Use A, B, C, D, +, -, :, /, or
numbers.
9O> ++"$!0;TK Bar code' s EAN-8 style. Use only numbers (7
numbers and a verification digit).
9K> ++"$!0;T9F Bar code' s EAN-13 style. Use only numbers (12
numbers and a verification digit).
9P> ++"$6 T0 Bar code' s UPC-A style. Use only numbers (11
numbers and a verification digit).
:M> ++"$6 T! Bar code' s UPC-E1 style. Use only numbers.
Used for UPC zero-compression symbols. In
Caption property, it is possible to input either a 6-
digit or 11-digit UPC-E code. If a 11-digit code is
input, bar code converts it to a 6-digit UPC-E, as
far as possible. Otherwise, 11-digit UPC-E is
converted to 6-digit UPC-E and nothing is
shown.
:9> ++"$6 T!9 Bar code' s UPC-E1 style. Use only numbers.
U.P.C E1' s data input width is 6 numerical
characters.
::> ++"$ I Bar code' s style Royal Mail RM4SCC. Use only
letters and numbers (with a verification digit).
This bar code is used in the United Kingdom.
:F> ++"$ 6 !0;9:K Bar code' s UCC/EAN_128 style. Use complete
characters ASCII. Code 128 special version is
used in the HIBC application.

/ 6 ) : ! !

LineColor: The LineColor property specifies page object'


s line color. the default
value of this property is black (RGB 0,0,0).

LineStyle: The LineStyle property specifies object'


s line style. The default value of
this property is 9> ++ +. The options available for this property are the following:

Available options for LineStyle


OPTION DESCRIPTION
M> ++ - ' Line gets transparent in the object.
9> ++ + Line appears solid in the object.
:> ++ = 2 Line gets dashed in the object.
F> ++ = Line gets dotted in the object.
I> ++ = 2= Line gets dashed and dotted in the object.
L> ++ = 2= = Line gets dotted, dashed and dotted in the object.

Properties 339
E3 - Scripts - Reference Manual

LineWeight: The LineWeight property specifies object' s line width. Setting the
width to 1, the object'
s line is expanded up to 15 points, and so on. The higher the
number set in the property, the wider the object. The default value of this property is
1.

Shape: The Shape property specifies the object'


s shape. The available options are
the following:

Available options for Shape


OPTION DESCRIPTION
0- ddSHRectangle Rectangular shape.
1- ddSHEllipse Elliptical or Circular shape.
2- ddSHRoundRect Round Rectangular shape.

/ 7 1! -

DataField: The DataField property sets/returns the data field associated to the object.
Datum associated may be:
• A table field in the database supplied by E3Query.
• A mathematical expression with Query fields and VBScript functions.
In this case the field shall be preceded by the equal symbol ‘=‘.
• An E3 tag/property. In this case current variable value will be showed
when printing.
NOTE: Server must be executed in order for the variable value to be captured. The
default value of this property is empty.

ForeColor: The ForeColor property specifies the object' s fore color. In the
scripts, use VBScript RGB function to create the color to be associated to this
property. The default value of this property is black (RGB (0, 0, 0)).

hyperlink: The hyperlink property specifies the link to be assigned to the text. In
order to use this feature use Hyperlink event. The default value of this property is
empty.

LineColor: The LineColor property specifies page object'


s line color. The default
value of this property is black (RGB 0,0,0).

LineStyle: The LineStyle property specifies object'


s line style. The default value
of this property is 1-ddLSSolid. The options available for this property are the
following:

340 Properties
E3 - Scripts - Reference Manual

Available options for LineStyle


OPTION DESCRIPTION
M> ++ - ' Line gets transparent in the object.
9> ++ + Line appears solid in the object.
:> ++ = 2 Line gets dashed in the object.
F> ++ = Line gets dotted in the object.
I> ++ = 2= Line gets dashed and dotted in the object.
L> ++ = 2= = Line gets dotted, dashed and dotted in the object.

LineWeight: The LineWeight property specifies object' s line width. Setting the width
to 1, the object'
s line is expanded up to 15 points, and so on. The higher the number set in
the property, the wider the object. The default value of this property is 1.

Picture: The Picture property specifies the picture file for the object. The file
extensions allowed are: bmp, gif, jpg cur, ico, emf and Wmf. the default value of this
property is empty.

PictureAlignment: The PictureAlignment property specifies the object' s picture


alignment. The default value of this property is :> ++ 0 . The available options
are the following:

Available options for PictureAlignment


OPTION DESCRIPTION
M> ++ 0- ' Align the picture at the object'
s left top.
9> ++ 0- ' .2 Align the picture at the object'
s right top.
:> ++ 0 Align the picture at the object'
s center top.
F> ++ 0 Align the picture at the object'
s left.
I> ++ 0 .2 Align the picture at the object'
s right.

SizeMode: The SizeMode property specifies the object size. The available options are
the following:

Available options for SizeMode


OPTION DESCRIPTION
M> ++ ' Show the object in its current size. If the object is
copies, its width is defined according to its settings.
9> ++ 2 Adjust the object according to its area.
$
:> ++ X Adjust the object' s image height and width within
specified area without distorting it.

Properties 341
E3 - Scripts - Reference Manual

/ <

Alignment: Specify the text alignment in the object, as follows: M> = left
alignment (default); 9> .2 = right alignment and :> = centered alignment.

ClassName: Show object'


s class.

DataField: Specify the tag to be associated to the object.

Font: This property specifies the object' s text font. The default value of this
property is empty. This property cannot be used in scripts and/or associations.

ForeColor: The ForeColor property specifies the object' s fore color. In the
scripts, use VBScript RGB function to create the color to be associated to this
property. the default value of this property is black (RGB (0, 0, 0)).

Hyperlink: The Hyperlink property specifies the link to be assigned to the text. In
order to use this feature use Hyperlink event.

Multiline: This property indicates whether the text will have multiple lines (True)
or be a simple text box (False). It can be viewed when Viewer is running. Default
value is False.

OutputFormat: Enable/disable the string used for text formatting.

Style: Show text style configured in the object.

SummaryDistinctField: Specifies the field name to be used by the function


selected in the SummaryFunc property. This property is only valid if the function
defined in SummaryFunc is from the “Distinct Summary” functions group, which
comprehends functions from number 9 to 15.

SummaryFunc: Specifies the function type to be used to process field values


specified in DataField property, as listed below.

342 Properties
E3 - Scripts - Reference Manual

Available options for SummaryFunc


OPTION DESCRIPTION
M> , Calculates the sum of all values within the interval of totals
specified (group or page or report).
9> 0&
. Calculates the average of all values within the interval of totals
specified (group or page or report).
:> , Counts the number of values within the interval of totals
specified (group or page or report).
F> Show the lowest value (minimum value) within the interval of
totals specified (group or page or report).
I> % Show the highest value (maximum value) within the interval of
totals specified (group or page or report).
L> 8 Calculates the values variation within the interval of totals
specified (group or page or report).
>8 Calculates population variation of values within the interval of
totals specified (group or page or report).
O> = & Calculates the default deviation of the values within the interval
of totals specified (group or page or report).
K> = & Calculates population default deviation of the values within the
interval of totals specified (group or page or report).
P> = , Calculates the sum of all different values within the interval of
totals specified (group or page or report).
9M> =0&
. Calculates the average based on different values within the
interval of totals specified (group or page or report).
99> = , Counts the number of different values within the interval of
totals specified (group or page or report).
9:> =8 Calculates variation of different values within the interval of
totals specified (group or page or report).
9F> =8 Calculates population variation of different values within the
interval of totals specified (group or page or report).
9I> == & Calculates the default deviation of the values within the interval
of totals specified (group or page or report).
9L> == & Calculates population default deviation of the different values
within the interval of totals specified (group or page or report).

SummaryGroup: This property is valid only when the SummaryType property is


equal to “3-SubTotal”. SummaryGroup indicates which name of the
“GroupHeader” section will be used to control the subtotals, i.e. at each value
change in GroupHeader, the summation restarts.

NOTE: When this property is used, CanShrink and CanGrow properties are
disabled.

Properties 343
E3 - Scripts - Reference Manual

SummaryRunning: Specify if the total of cum sums will be done according to


the following options: M>; = it does not make the total; 9> ,'= calculate
cum totals to each interval of totals specified; :>0 = calculate the cum total for all
values of the report, regardless the group.

SummaryType: Specify the type or level of total to be generated. The available


options are the following:

Available options for SummaryType


OPTION DESCRIPTION
M> ; No summation generation.
9> +- Specify that all report content will be totaled.
:> . - Specify that will be generated one subtotal per page.
F> ,"- Specify that will be generated one subtotal to each
group defined in the SummaryGroup property.
I> . , Specify the page counter.

Text: Specify the text to be assigned to the object.

VerticalAlignment: Specify the object'


s vertical alignment, as follows:
M>- '= alignment at the top; 9> ++ = alignment at the center;
:> = alignment at the base.

WordWrap: Enables/disables line breaks in the text, in case the area available for
the text overrides the limits determined in the object. For this property to work,
Multiline property must be True.

Alignment: The Alignment property specifies the text alignment, as follows:


M>++ % = alignment to left; 9>++ % .2 = alignment to right and
:>++ % = alignment to center (default value).

Angle: The Angle property indicates the angle of the text. Property value shall be
specified in tenth degrees, i.e. in order for the text to be shown in a 45 degree angle
the value shall be equal to 450. The default value of this property is 0 (horizontal
positioning).

Caption: The Caption property consisted of the object'


s text itself. the default
value of this property is empty.

344 Properties
E3 - Scripts - Reference Manual

ClassName: The ClassName property allows specifying a global CSS class


(indicated in an external CSS style sheet) to be applied to the text. A CSS class is a
formatting default that specifies the type and size of the letter or paragraph
alignment and spacing, among other features. Through CSS, we can apply a
predefined format default to a text, speeding up and unifying text presentation. In
order to apply a specific style, it is possible to use the Style property. Default values
of this property are the “Normal” style.

Font: This property indicates the font name (type of the letters) of the text. the
default value of this property is empty (E3 will use system default).

NOTE: This property can not be used in scripts and/or associations. it only can be
changed at the setting time.

Fore color: The ForeColor property specifies the object' s fore color. In the
scripts, use VBScript RGB () function to create the color to be associated to this
property. the default value of this property is black (RGB (0,0,0)).

Hyperlink: The Hyperlink property specifies a link to be assigned to object as a


whole. In order to use this feature use Hyperlink event. The default value of this
property is empty.

Multiline: This property indicates whether the text will have multiple lines (True)
or be a simple text box (False). It can be viewed when Viewer is running. Default
value is False.

Style: The Style property allows specifying a CSS style for the text substituting
global style. Property value must be a valid CSS string, otherwise the property is
ignored. The default value of this property is empty (E3 will use system default).

VerticalAlignment: The VerticalAlignment property specifies the text'


s vertical
alignment, as follows: M>++-%
- '= alignment at the top (default); 9>++-% ++ =
alignment at center; :>++-% = alignment at the base.

WordWrap: Enables/disables line breaks in the text, in case the area available for
the text overrides the limits determined in the object. For this property to work,
Multiline property must be True. If it is False, “white-space:nowrap” setting will
appear in the Style property.

/ 4

LineColor: The LineColor property specifies page object'


s line color. The default
value of this property is black (RGB 0,0,0).

Properties 345
E3 - Scripts - Reference Manual

LineStyle: This property specifies the object'


s line style. The default value of this
property is 1-ddLSSolid. The other options available for this property are the
following:

Available options for LineStyle


OPTION DESCRIPTION
0- ddLSTransparent Line gets transparent in the object.
1- ddLSSolid Line appears solid in the object.
2- ddLSDash Line gets dashed in the object.
3- ddLSDot Line gets dotted in the object.
4- ddLSDashDot Line gets dashed and dotted in the object.
5- ddLSDashDotDot Line gets dotted, dashed and dotted in the object.

LineWeight: The LineWeight property specifies object' s line width. Setting the
width to 1, the object'
s line is expanded up to 15 points, and so on. The higher the
number set in the property, the wider the object. The default value of this property is
1.

X1: The X1 property enables/disables the position of line initial point of the line in the
axis X.

X2: The X2 property specifies the position of line final point of axis X. The
default value of this property is empty.

Y1: The Y1 property specifies the position of line initial point of axis Y. The
default value of this property is empty.

Y2: The Y2 property specifies the position of line final point of axis Y. The
default value of this property is empty.

/ " ! + #

Enabled: The Visible property specifies object enabling in the report. If the
option is setup to True, the object is enabled in the report. Otherwise the object
remains disabled. The default value of this property is True.

Tag: The Tag property specifies the type of tag to be aggregated to the object.
The default value of this property is empty.

Top: The top property returns the value of the top of the object. The default value
of this property is 0.
346 Properties
E3 - Scripts - Reference Manual

/ $

CloseButton: The CloseButton property specifies the addition of Close button in the
Viewer. If the option is setup to True, Close button will be disabled in the Viewer and will
be possible to close project viewing. Otherwise the Viewer will start without this option.
The default value of this property is True.

Left: The left property returns the left positioning value of the report object. the default
value of this property is empty.

Properties 347

You might also like