Rocket wIntegrate
Object Model Reference
Version 6.4.0
February 2016WIN-640-OM-RM-01
2
NoticesEdition
Publication date: February 2016Book number: WIN-640-OM-RM-01Product version: Version 6.4.0
Copyright© Rocket Software, Inc. or its affiliates 1996-2016. All Rights Reserved.
Trademarks
Rocket is a registered trademark of Rocket Software, Inc. For a list of Rocket registered trademarks goto: www.rocketsoftware.com/about/legal. All other products or services mentioned in this documentmay be covered by the trademarks, service marks, or product names of their respective owners.
Examples
This information might contain examples of data and reports. The examples include the names ofindividuals, companies, brands, and products. All of these names are fictitious and any similarity tothe names and addresses used by an actual business enterprise is entirely coincidental.
License agreement
This software and the associated documentation are proprietary and confidential to Rocket Software,Inc. or its affiliates, are furnished under license, and may be used and copied only in accordance withthe terms of such license.
Note: This product may contain encryption technology. Many countries prohibit or restrict theuse, import, or export of encryption technologies, and current use, import, and export regulationsshould be followed when exporting this product.
3
Corporate informationRocket Software, Inc. develops enterprise infrastructure products in four key areas: storage, networks,and compliance; database servers and tools; business information and analytics; and applicationdevelopment, integration, and modernization.
Website: www.rocketsoftware.com
Rocket Global Headquarters77 4th Avenue, Suite 100Waltham, MA 02451-1468USA
To contact Rocket Software by telephone for any reason, including obtaining pre-sales informationand technical support, use one of the following telephone numbers.
Country Toll-free telephone number
United States 1-855-577-4323Australia 1-800-823-405Belgium 0800-266-65Canada 1-855-577-4323China 800-720-1170France 08-05-08-05-62Germany 0800-180-0882Italy 800-878-295Japan 0800-170-5464Netherlands 0-800-022-2961New Zealand 0800-003210South Africa 0-800-980-818United Kingdom 0800-520-0439
Contacting Technical Support
The Rocket Customer Portal is the primary method of obtaining support. If you have currentsupport and maintenance agreements with Rocket Software, you can access the Rocket CustomerPortal and report a problem, download an update, or find answers to in the U2 Knowledgebase.To log in to the Rocket Customer Portal or to request a Rocket Customer Portal account, go towww.rocketsoftware.com/support.
In addition to using the Rocket Customer Portal to obtain support, you can send an email [email protected] or use one of the following telephone numbers.
Country Telephone number
North America +1 800 729 3553United Kingdom/France +44 (0) 800 773 771 or +44 (0) 20 8867 3691Europe/Africa +44 (0) 20 8867 3692Australia +1 800 707 703 or +61 (0) 29412 5450New Zealand +0800 505 515
4
Contents
Notices................................................................................................................................................................................... 2
Corporate information......................................................................................................................................................... 3
Chapter 1: wIntegrate overview.......................................................................................................................................... 9wIntegrate features.................................................................................................................................................. 9
Chapter 2: Objects.............................................................................................................................................................. 10Application.............................................................................................................................................................. 10AutoBridgeRx...........................................................................................................................................................11AutoBridgeTx...........................................................................................................................................................11AutoData..................................................................................................................................................................11AutoFileTransfer......................................................................................................................................................11AutoImportTarget................................................................................................................................................... 11AutoWindow............................................................................................................................................................ 11Capture.................................................................................................................................................................... 12DataWatch............................................................................................................................................................... 13DisplayArea..............................................................................................................................................................14DockBar................................................................................................................................................................... 15HotSpot....................................................................................................................................................................15HotSpots.................................................................................................................................................................. 16Selection.................................................................................................................................................................. 17Session.....................................................................................................................................................................17Trigger......................................................................................................................................................................20Triggers.................................................................................................................................................................... 20
Chapter 3: Properties......................................................................................................................................................... 22AlwaysOnTop...........................................................................................................................................................22AppName (Session).................................................................................................................................................22AppTitle (Session)................................................................................................................................................... 22Attribute...................................................................................................................................................................23Attributes................................................................................................................................................................. 23BackColor (HotSpot)...............................................................................................................................................24BackColor (HotSpots)............................................................................................................................................. 24Bottom..................................................................................................................................................................... 25Busy (Session)......................................................................................................................................................... 25Caption.................................................................................................................................................................... 25CaretPosition...........................................................................................................................................................26CaretShape.............................................................................................................................................................. 26CommandBars.........................................................................................................................................................27ContainerFlags (Session)........................................................................................................................................27Count (Capture)...................................................................................................................................................... 27Count (HotSpots).................................................................................................................................................... 28Count (Triggers)...................................................................................................................................................... 28DisplayHorizontalScrollBar.................................................................................................................................... 28DisplayOn................................................................................................................................................................ 29DisplayStatusBar.....................................................................................................................................................29DisplayUpdate.........................................................................................................................................................29DisplayVerticalScrollBar......................................................................................................................................... 30Enabled....................................................................................................................................................................30FileName..................................................................................................................................................................30ForeColor (HotSpot)............................................................................................................................................... 31ForeColor (HotSpots)..............................................................................................................................................31FoundCount.............................................................................................................................................................31
Contents
5
FullName (Session)................................................................................................................................................. 32Height.......................................................................................................................................................................32HotSpots.................................................................................................................................................................. 32Id (DockBar)............................................................................................................................................................ 33Id (Session).............................................................................................................................................................. 33Index........................................................................................................................................................................ 33Information..............................................................................................................................................................34Item (HotSpots).......................................................................................................................................................34Item (Triggers).........................................................................................................................................................35Left........................................................................................................................................................................... 35Length...................................................................................................................................................................... 35MouseIcon............................................................................................................................................................... 36MousePointer.......................................................................................................................................................... 36MousePosition.........................................................................................................................................................36Name (Session)....................................................................................................................................................... 37Pattern..................................................................................................................................................................... 37Paused..................................................................................................................................................................... 38RequiredHeight (DockBar)..................................................................................................................................... 38Right.........................................................................................................................................................................38Running....................................................................................................................................................................39ScreenArea...............................................................................................................................................................39ScrollArea (DisplayArea)......................................................................................................................................... 39ScrollArea (Window)............................................................................................................................................... 40Selected................................................................................................................................................................... 40Selection.................................................................................................................................................................. 40Session.....................................................................................................................................................................41Setting......................................................................................................................................................................41SettingsDialog......................................................................................................................................................... 42StatusBarText..........................................................................................................................................................42Style (HotSpot)........................................................................................................................................................42Style (HotSpots)...................................................................................................................................................... 43Text (Capture)......................................................................................................................................................... 43Text (DataWatch).................................................................................................................................................... 43Text (DisplayArea)...................................................................................................................................................44Text (Selection)....................................................................................................................................................... 44Text (Window)......................................................................................................................................................... 45TextFormat.............................................................................................................................................................. 45Top........................................................................................................................................................................... 46Triggers.................................................................................................................................................................... 46Type (Selection)...................................................................................................................................................... 46Type (Trigger)..........................................................................................................................................................47Variable....................................................................................................................................................................47Version..................................................................................................................................................................... 47Visible.......................................................................................................................................................................48WHeight (Session)...................................................................................................................................................48WLeft (Session)........................................................................................................................................................48WState (Session)..................................................................................................................................................... 49WTop (Session)....................................................................................................................................................... 49WWidth (Session).................................................................................................................................................... 50Width........................................................................................................................................................................50Window.................................................................................................................................................................... 50WindowState........................................................................................................................................................... 51Word.........................................................................................................................................................................51hWnd (Session)....................................................................................................................................................... 52
Chapter 4: Methods............................................................................................................................................................ 53AboutBox (Session).................................................................................................................................................53
Contents
6
Add (HotSpots)........................................................................................................................................................53Add (Triggers)..........................................................................................................................................................54AppendText............................................................................................................................................................. 54AttachDockBar (Session)........................................................................................................................................ 55AttributeFill..............................................................................................................................................................55Box........................................................................................................................................................................... 56CanExit (Session).................................................................................................................................................... 56CanRestore (Session)..............................................................................................................................................57Capture.................................................................................................................................................................... 57CharacterFill............................................................................................................................................................ 58Clear (Capture)........................................................................................................................................................58Clear (Selection)......................................................................................................................................................58Continue.................................................................................................................................................................. 59Copy......................................................................................................................................................................... 59Copy (Session).........................................................................................................................................................59CopySpecial (Session)............................................................................................................................................ 60DataWatch............................................................................................................................................................... 60DisplayArea..............................................................................................................................................................61DisplayAttribute...................................................................................................................................................... 61DisplayCommand....................................................................................................................................................62DisplayText.............................................................................................................................................................. 62Exit (Session)........................................................................................................................................................... 63Extension (Session).................................................................................................................................................63GetSessionScript (Session).....................................................................................................................................63Inflate.......................................................................................................................................................................64InvokeDialog............................................................................................................................................................64MoveCaret................................................................................................................................................................65Open (Session)........................................................................................................................................................ 65OpenScript (Session).............................................................................................................................................. 66Paste (Session)........................................................................................................................................................66Pause....................................................................................................................................................................... 67Quit.......................................................................................................................................................................... 67Remove.................................................................................................................................................................... 67RemoveAll................................................................................................................................................................67Resize....................................................................................................................................................................... 68RunScriptCommand............................................................................................................................................... 68RunScriptFile........................................................................................................................................................... 68Save (Session)......................................................................................................................................................... 69ScrollAll (Session)................................................................................................................................................... 69ScrollLine (Session).................................................................................................................................................70ScrollPage (Session)............................................................................................................................................... 70Select....................................................................................................................................................................... 70SelectAll................................................................................................................................................................... 71SelectWindow..........................................................................................................................................................71Send......................................................................................................................................................................... 72SetEnd......................................................................................................................................................................72SetStart....................................................................................................................................................................73SetStatusBar (Session)........................................................................................................................................... 73SetupOpen (Session).............................................................................................................................................. 74SetupSave (Session)............................................................................................................................................... 74ShowDialog..............................................................................................................................................................74SnapToSize (Session)............................................................................................................................................. 75Start......................................................................................................................................................................... 75Stop..........................................................................................................................................................................75StoreSetting.............................................................................................................................................................76UpdateSettings....................................................................................................................................................... 76
Contents
7
Chapter 5: Events................................................................................................................................................................78About (Session)....................................................................................................................................................... 78Another (Session)....................................................................................................................................................78CaptionChanged (Session)..................................................................................................................................... 78Change..................................................................................................................................................................... 78Click..........................................................................................................................................................................78DblClick....................................................................................................................................................................79Exit (Session)........................................................................................................................................................... 79Found....................................................................................................................................................................... 79Full........................................................................................................................................................................... 79HeightChanged (DockBar)......................................................................................................................................79Open (Session)........................................................................................................................................................ 80Opened (Session).................................................................................................................................................... 80RequestAlwaysOnTop (Session)............................................................................................................................ 80RequestEnable (Session)........................................................................................................................................81RequestLockSize (Session).....................................................................................................................................81RequestResize (Session).........................................................................................................................................81RequireDockBar (Session)......................................................................................................................................82Save (Session)......................................................................................................................................................... 82SaveAs (Session)..................................................................................................................................................... 82ShowStatusBar (Session)....................................................................................................................................... 83
Chapter 6: Enumerations................................................................................................................................................... 84wAttributeTypeEnum..............................................................................................................................................84wBoxStyleEnum...................................................................................................................................................... 84wCaptureFormatEnum........................................................................................................................................... 85wCaptureOptionsEnum.......................................................................................................................................... 85wCaptureTargetEnum............................................................................................................................................ 86wCaptureTextFormatEnum....................................................................................................................................86wCaretShapeEnum................................................................................................................................................. 87wCursorShapeEnum............................................................................................................................................... 87wDisplayUpdateEnum............................................................................................................................................ 87wHotSpotStyleEnum...............................................................................................................................................88wMousePositionEnum............................................................................................................................................ 88wPositionEnum....................................................................................................................................................... 89wScrollAreaEnum....................................................................................................................................................89wSelectionFormatEnum......................................................................................................................................... 89wSelectionInfoEnum...............................................................................................................................................90wSelectionTextEnum.............................................................................................................................................. 90wSelectionTypeEnum............................................................................................................................................. 91wSendOptionsEnum............................................................................................................................................... 91wTextColorEnum.....................................................................................................................................................91wTextEffectEnum.................................................................................................................................................... 92wTextFormatEnum................................................................................................................................................. 92wTextLayoutEnum.................................................................................................................................................. 93wTriggerTypeEnum.................................................................................................................................................93wWindowStateEnum.............................................................................................................................................. 93wWordOptionsEnum...............................................................................................................................................94
Chapter 7: Accessing the object model.............................................................................................................................95Overview of the main objects in the object model.............................................................................................. 95Examples................................................................................................................................................................. 95
Setting the show state of the application................................................................................................ 96Setting up the Session............................................................................................................................... 96Retrieving text from the screen................................................................................................................. 96Displaying text on the screen.................................................................................................................... 97Finding out when part of the screen changes..........................................................................................97
Contents
8
Sending data to the host........................................................................................................................... 98Retrieving and recording data sent from the host...................................................................................98Waiting for a specific piece of data to be received.................................................................................. 98
Appendix A: Serial control................................................................................................................................................100
Appendix B: Windows Sockets control............................................................................................................................102
9
Chapter 1: wIntegrate overviewwIntegrate is a connectivity tool that integrates host-based applications with the desktop. Theinitial interface is a terminal emulator with data transfer features designed for the multi-valuedenvironments of UniVerse, UniData, D3, and mvBase. You can share data with popular Windowsapplications, including Microsoft Word and Excel.
For developers, a comprehensive programming language enables a range of options for integratinghost environments with the desktop. You can add GUI features incrementally or create full GUIapplications driven from the host.
A suite of host-based subroutines is supplied to control the PC. These subroutines are created formulti-valued environments, but the techniques used can be adapted to any host.
Developer tools include the Editor and a Tools menu with useful utilities. You can choose to displaythe Tools menu in Setup > Preferences. Select the Scripts tab and then use the Menu Bar Scriptdrop-down list.
wIntegrate featuresAll wIntegrate features are supported with Rocket’s UniVerse, UniData, D3, and mvBase databases.
With wIntegrate, you can do the following tasks:
▪ Run concurrent sessions
▪ Customize a wIntegrate session
▪ Control any aspect of the application using powerful scripting language
▪ Optionally deploy a thin client on Windows or Java
▪ Run scripts from supplied host-based subroutines
▪ Define terminal emulations
▪ Export files from your PC to a host computer
▪ Import host computer files to your PC
▪ Transfer files from one host computer to another host computer
▪ Simplify deployment through optional thin client and browser interfaces
10
Chapter 2: ObjectsThis section describes the objects in the object model.
Creating a document object or getting a document object from a wIntegrate configuration file returnsan Application object. The object for a wIntegrate session control is the Session object. This canalso be retrieved through the Session property of the Application object.
The following shows the object model hierarchy:
Application → Session → AutoWindow → DisplayArea
HotSpots → HotSpot
Selection
Triggers → Trigger
Capture
DataWatch
ApplicationThis object represents a wIntegrate application.
Properties
The following table describes the properties for the Application object:
Property Description
AlwaysOnTop Represents the always-on-top state of a wIntegrate application windowCaption Represents the caption or title text of a wIntegrate objectDisplayStatusBar Represents the visible state of a wIntegrate application window status barHeight Represents the height of a wIntegrate objectLeft Represents the horizontal position of a wIntegrate objectSession Returns the Session object associated with a wIntegrate applicationStatusBarText Represents the text associated with a wIntegrate application window
status barTop Represents the vertical position of a wIntegrate objectVersion Returns the wIntegrate version numberVisible Represents the visible state of a wIntegrate objectWidth Represents the width of a wIntegrate objectWindowState Represents the window state of a wIntegrate application window, such as
maximized or minimized
Methods
The following table describes the methods for the Application object:
Method Description
Quit Quits wIntegrateResize Resizes a wIntegrate application window
AutoBridgeRx
11
AutoBridgeRxThis object is for internal use only and is subject to change.
Do not use.
AutoBridgeTxThis object is for internal use only and is subject to change.
Do not use.
AutoDataThis object is for internal use only and is subject to change.
Do not use.
AutoFileTransferThis object is for internal use only and is subject to change.
Do not use.
AutoImportTargetThis object is for internal use only and is subject to change.
Do not use.
AutoWindowThis object represents a wIntegrate session window.
Only one window object per wIntegrate session can exist.
Properties
The following table describes the properties for the AutoWindow object:
Property Description
Attribute Returns the text attribute at a specified location within a wIntegratesession window
Attributes Returns the text attribute at a specified location within a wIntegratesession window
Caption Represents the caption or title text of a wIntegrate objectCaretPosition Represents the position of the text cursor or caretCaretShape Represents the shape of the text cursor or caretDisplayHorizontalScrollBar Represents the visible state of a wIntegrate session window horizontal
scroll bar
Chapter 2: Objects
12
Property Description
DisplayOn Represents the display state of a Window objectDisplayUpdate Represents the update state of the Window objectDisplayVerticalScrollBar Represents the visible state of a wIntegrate session window vertical
scroll barEnabled Represents the active state of a wIntegrate objectMouseIcon Represents the shape of the custom mouse cursor associated with a
wIntegrate session windowMousePointer Represents the shape of the mouse cursor associated with a wIntegrate
session windowMousePosition Represents the position of the mouse cursor when over a wIntegrate
session windowScreenArea Returns a DisplayArea object that covers the entire display screen of
the Window objectScrollArea (Window) Returns a DisplayArea object that covers the area of the Window
object in which text will scrollText (Window) Returns the text at a specified location within a wIntegrate session
windowWord Returns the word or highlighted character of the word at a specified
location within the wIntegrate session window
Methods
The following table describes the methods for the AutoWindow object:
Method Description
DisplayArea Creates a new DisplayArea object that represents a rectangularsection of the Window object
DisplayAttribute Sets the terminal emulation text attribute at the current text cursor orcaret position in a wIntegrate session window
DisplayCommand Runs the emulation command specifiedDisplayText Displays text in a wIntegrate session window at the current text cursor or
caret positionMoveCaret Moves the text caret to the new column and row
See Also
Window
CaptureThis object represents a Capture object that is associated with a wIntegrate session.
wIntegrate sessions can have many Capture objects. A new Capture object is created using theSession capture method.
When a capture object is created, a buffer size is used. When the amount of data reaches the buffersize, the Full event is generated, and the buffer is cleared (unless the wCaptureOptionsShift optionwas specified).
DataWatch
13
Properties
The following table describes the properties for the Capture object:
Property Description
Count (Capture) Describes the amount of data currently captured in a wIntegrate captureobject
FileName Represents the name of the file that receives captured data for awIntegrate capture object
Length Describes the amount of data to capture for a wIntegrate capture objectPaused Represents the paused state of a capture objectRunning Represents the running state of a capture objectText (Capture) Represents the text in a wIntegrate capture objectTextFormat Represents the format that the text in a wIntegrate capture object should
be returned
Methods
The following table describes the methods for the Capture object:
Method Description
AppendText Appends text to the data recorded in a Capture objectClear (Capture) Removes or clears all captured data from a wIntegrate Capture objectContinue Continues a capture after is has been paused with the Pause method of a
wIntegrate Capture objectPause Pauses a captureStart Starts a Capture object recordingStop Stops the recording for a Capture object
Events
The following table describes the events for the Capture object:
Event Description
Full Called when a wIntegrate capture object is full of data
See Also
Capture
DataWatchThis object represents a DataWatch object that is associated with a wIntegrate session, which firesan event whenever the specified text is received from the host.
wIntegrate sessions can have many DataWatch objects. A new DataWatch object is created usingthe Session DataWatch method.
Properties
The following table describes the properties for the DataWatch object:
Chapter 2: Objects
14
Property Description
Enabled Represents the active state of a wIntegrate objectFoundCount Represents the number of times the text in a DataWatch object is foundText (DataWatch) Represents the text to be found in a wIntegrate DataWatch object
Events
The following table describes the events for the DataWatch object:
Event Description
Found Called when a wIntegrate DataWatch object matches its text against theincoming data from the host
See Also
DataWatch
DisplayAreaThis object represents a rectangular area of the wIntegrate window.
Properties
The following table describes the properties for the DisplayArea object:
Property Description
Bottom Represents the bottom vertical position of a wIntegrate objectHeight Represents the height of a wIntegrate objectLeft Represents the horizontal position of a wIntegrate objectRight Represents the horizontal position of the right edge of a wIntegrate objectScrollArea (DisplayArea) Represents the scroll area type of a display area objectText (DisplayArea) Returns all the text within a display area objectTop Represents the vertical position of a wIntegrate objectWidth Represents the width of a wIntegrate object
Methods
The following table describes the methods for the DisplayArea object:
Method Description
AttributeFill Fills the area of the Window represented by a DisplayArea object withthe specified attribute
Box Draws a box in the rectangle area defined by a DisplayArea objectCharacterFill Fills the area of a DisplayArea object with the specified characterInflate Increases the size of a DisplayArea object by adding an amount to its
sides
DockBar
15
See Also
DisplayArea, ScrollArea (Window)
DockBarThis object is used with the session control in a third-party container, for example, a web page.
By linking the docking bar control to the session with the session control’s AttachDockBar method,the docking bar is populated with the menus and toolbars that are defined by the session or withscript commands.
The DockBar object is the interface for the wIntegrate DockBar control.
Properties
The following table describes the properties for the DockBar object:
Property Description
Id (DockBar) Provides the identifier required for the AttachDockBar method on thesession object
RequiredHeight(DockBar)
Returns the minimum height required for the docking bar to show all thetoolbars currently on it
Events
The following table describes the events for the DockBar object:
Event Description
HeightChanged(DockBar)
Occurs when a toolbar is added or removed from a docking bar
Version
5.2.0 Supported
See Also
AttachDockBar (Session)
HotSpotThis object represents a HotSpot object in a wIntegrate session.
wIntegrate sessions can have many HotSpot objects that are maintained by a HotSpots collectionobject.
Properties
The following table describes the properties for the HotSpot object:
Property Description
BackColor (HotSpot) Represents the background color of a wIntegrate HotSpot objectForeColor (HotSpot) Represents the foreground color of a wIntegrate HotSpot
Chapter 2: Objects
16
Property Description
Index Represents the index of a wIntegrate object within a collectionStyle (HotSpot) Represents the style of a wIntegrate HotSpot objectLeft Represents the horizontal position of a wIntegrate objectTop Represents the vertical position of a wIntegrate objectWidth Represents the width of a wIntegrate objectHeight Represents the height of a wIntegrate object
Events
The following table describes the events for the HotSpot object:
Event Description
Click Called when a wIntegrate object is clickedDblClick Called when a wIntegrate object is double-clicked
See Also
HotSpots, Add (HotSpots), Item (HotSpots)
HotSpotsThis object represents a collection of HotSpot objects in a wIntegrate session window.
Only one HotSpots object is allowed in a wIntegrate session, and one is always associated with asession. There is no need to create the object.
Properties
The following table describes the properties for the HotSpots object:
Property Description
BackColor (HotSpots) Represents the default background color of a HotSpots collection objectCount (HotSpots) Represents the number of items in a collection of HotSpot objectsEnabled Represents the active state of a wIntegrate objectForeColor (HotSpots) Represents the foreground color of a HotSpots collection objectItem (HotSpots) Represents a HotSpot item in a HotSpots collectionStyle (HotSpots) Represents the style of a HotSpots collection object
Methods
The following table describes the methods for the HotSpots object:
Method Description
Add (HotSpots) Adds a new hot spot to a wIntegrate sessionRemove Removes a specific object from a collection of wIntegrate objectsRemoveAll Removes all objects from a collection of wIntegrate objects
Selection
17
See Also
HotSpots, HotSpot
SelectionThis object represents a selected or highlighted area of a wIntegrate session window.
Only one Selection object is allowed in a wIntegrate session, and one is always associated with asession. There is no need to create the object.
Properties
The following table describes the properties for the Selection object:
Property Description
Information Returns information about a SelectionSelected Specifies whether an area has been highlighted by a selection or notText (Selection) Represents the text highlighted by a selectionType (Selection) Describes the type of a selection
Methods
The following table describes the methods for the Selection object:
Method Description
Clear (Selection) Clears or removes the highlighted area of a Selection objectCopy Copies the text associated with a Selection object to the clipboardSelect Selects an area of a wIntegrate session windowSelectAll Selects all of the data in the current screen and backpage memory of the
current sessionSelectWindow Selects all of the visible data in a wIntegrate session windowSetStart Sets the start positionSetEnd Sets the end position
SessionThis object represents a wIntegrate session.
Only one Session object is allowed in a wIntegrate application, and one is always associated with anapplication. There is no need to create the object.
The events from the Session object are used as a session control inside a container application.They are mainly requests from the session control for services that must be controlled or implementedby the container.
Properties
The following table describes the properties for the Session object:
Property Description
AppName (Session) The name of the executable containing the session control
Chapter 2: Objects
18
Property Description
AppTitle (Session) The title of the applicationBusy (Session) Returns non-zero if the session is busyCommandBars ReservedContainerFlags (Session) Controls how the session control deals with the File and Exit handling
when used in another applicationFullName (Session) Full name of the file that opened this sessionHotSpots Returns the HotSpots object associated with a wIntegrate sessionId (Session) The numeric ID for the sessionName (Session) Represents the internal name of a wIntegrate sessionSelection Returns the selection object associated with a wIntegrate sessionSetting Allows the setting of variables that are saved in a wIntegrate session or the
variable associated with a dialog to be set or interrogatedSettingsDialog Represents the name of the wIntegrate dialog to use with the Setting
property or StoreSetting methodTriggers Returns the triggers object associated with a wIntegrate sessionVariable Represents the global script variableWHeight (Session) The session’s internal heightWLeft (Session) The session’s internal left positionWState (Session) The session’s internal show stateWTop (Session) The session’s internal top positionWWidth (Session) The session’s internal widthWindow Returns the window object associated with a wIntegrate sessionVersion Returns the wIntegrate version numberhWnd (Session) The Windows window handle of the session
Methods
The following table describes the methods for the Session object:
Method Description
AboutBox (Session) Shows the session control About boxAttachDockBar (Session) Used in an external container application, for example, to attach a
docking bar control to a sessionCanExit (Session) Internal method to check if the session can exitCanRestore (Session) Checks if it is OK to restore the session from minimizedCapture Creates a new Capture object to record data from the wIntegrate
sessionCopy (Session) Copies the current selection to the clipboardCopySpecial (Session) Copies the current Selection object to the clipboard using the format
defined in the Edit > Copy Special to menu optionDataWatch Creates a new DataWatch object that fires an event when the specified
text is received from the hostExit (Session) Asks the session to exitExtension (Session) An internal method to return an extensionGetSessionScript(Session)
Creates and returns a string that contains the session configuration script
Session
19
Method Description
InvokeDialog Invokes the functionality behind a Session dialog boxOpen (Session) Opens a script fileOpenScript (Session) Runs a session configuration script file on the current session, using the
received script textPaste (Session) Pastes data from clipboard to the session windowRunScriptCommand Runs a wIntegrate script commandRunScriptFile Runs a wIntegrate script fileSave (Session) Saves session parameters as a scriptScrollAll (Session) Scrolls the display to the top or the bottom of the backpage memoryScrollLine (Session) Scrolls the display back or forward one lineScrollPage (Session) Scrolls the display up or down one pageSend Sends data to a remote host as if the user had typed the data in a
wIntegrate sessionSetStatusBar (Session) The internal method to setup the status barSetupOpen (Session) Shows the open dialog boxSetupSave (Session) Shows the save as dialog boxShowDialog Displays a Session dialog boxSnapToSize (Session) Internal method to implement snap to sizeStoreSetting Allows the value session setting variable to be stored for update by a
following UpdateSettings commandUpdateSettings Updates all of the session settings that have been stored by the
StoreSetting method at once
Events
The following table describes the events for the Session object:
Event Description
About (Session) Requests that the container of a session control shows its About dialogbox
Another (Session) Fired when the user selects the File > Another menu option or runs itthrough a script
CaptionChanged (Session) Fired whenever the session title changesExit (Session) Sent when the Exit or Exit all menu options are selected or are ran
through the script languageOpen (Session) Sent by the session control when the File > Open menu option is
selected or is ran through a scriptOpened (Session) Obsolete and no longer generated by the session controlRequestAlwaysOnTop(Session)
Fired when the session control is set to be always-on-top through themenus or script language
RequestEnable (Session) Fired through the session control when a script command wants theentire container application to be enabled or disabled
RequestLockSize (Session) Requests that the container does not allow the user to change its sizeRequestResize (Session) Sent from the session control to request that it is moved, resized, or
changed its stateRequireDockBar (Session) Internal event requesting a docking bar
Chapter 2: Objects
20
Event Description
Save (Session) Runs when the File > Save menu option or script command is run torequest that the container of the session control saves its configuration
SaveAs (Session) Runs when the File > Save As menu option is selected or run froma script to request the container of the session control to save theconfiguration with the specified file name
ShowStatusBar (Session) Requests that a status bar is shown
Version
5.2.0 ContainerFlags property added
See Also
Session
TriggerThis object represents a Trigger object in a wIntegrate session. A trigger causes a notification eventwhen received data changes.
Many Trigger objects can exist in a wIntegrate session. They are maintained by a Trigger’s collectionobject.
Properties
The following table describes the properties for the Trigger object:
Property Description
Height Represents the height of a wIntegrate objectLeft Represents the horizontal position of a wIntegrate objectPattern Represents the pattern or text monitored by a wIntegrate trigger objectTop Represents the vertical position of a wIntegrate objectType (Trigger) Describes the type of a wIntegrate trigger objectWidth Represents the width of a wIntegrate object
Events
The following table describes the events for the Trigger object:
Event Description
Change Called when the data associated with a wIntegrate trigger changes
See Also
Triggers, Add (Triggers), Item (Triggers)
TriggersThis object represents a collection of Trigger objects in a wIntegrate session. A trigger causes anotification event when received data changes.
Triggers
21
Only one Triggers object can exist for a wIntegrate session.
Properties
The following table describes the properties for the Triggers object:
Property Description
Count (Triggers) Represents the number of items in a collection of Trigger objectsItem (Triggers) Represents a trigger item in a Triggers collection
Methods
The following table describes the methods for the Triggers object:
Method Description
Add (Triggers) Adds a new Trigger object to a wIntegrate session
22
Chapter 3: PropertiesThis section contains a list of the properties in the object model.
AlwaysOnTopThis property represents the always-on-top state of a wIntegrate application window. When thewIntegrate application window is always-on-top, all other windows appear behind it.
Syntax
AlwaysOnTop
Property Value
Read/Write Boolean. The always-on-top state of the session window.
Applies to
Application
AppName (Session)This property is the name of the executable containing the session control.
This property should only be set by applications that contain the session control. It is not required thatthis property is set.
Syntax
AppName
Property Value
Read/Write String. Name of the executable for the application.
Applies to
Session
AppTitle (Session)This property is the title of the application.
This property should only be set by applications that contain the session control. It is used in the scriptlanguage or in message boxes where the application name is displayed.
Syntax
AppTitle
Attribute
23
Property Value
Read/Write String. The title of the application.
Applies to
Session
AttributeThis property returns the text attribute at a specified location within a wIntegrate session window.
If any of the Left, Top, and Page arguments are omitted, their values are those of the current textcursor or caret position. If all of them are omitted, the current attribute is returned. In other words, theattribute that is applied to the next text character is displayed.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Syntax
Attribute Type, [Left], [Top], [Page]
Parameters
The following table describes the parameters of the Attribute property:
Parameter Type Description
Type wAttributeTypeEnum The attribute typeLeft Variant or Long The column number of the attribute (default: 0)Top Variant or Long The row number of the attribute (default: 0)Page Variant or Long The page number of the attribute (default: the first
page)
Property Value
Read-only Long. The required text attribute.
Applies to
AutoWindow
AttributesThis property returns the text attribute at a specified location within a wIntegrate session window.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Syntax
Attributes Type, [Left], [Top], [Right], [Bottom], [Layout],[StartPage], [EndPage]
Chapter 3: Properties
24
Parameters
The following table describes the parameters of the Attributes property:
Parameter Type Description
Type wAttributeTypeEnum The attribute typeLeft Variant or Long The column number of the top left of the associated
text (default: 0)Top Variant or Long The row number of the top left of the associated text
(default: 0)Right Variant or Long The column number of the bottom right of the
associated text (default: the right of the sessionwindow)
Bottom Variant or Long The row number of the bottom right of the associatedtext (default: the bottom of the session window)
Layout Variant orwTextLayoutEnum
The layout of the associated text (default:wTextLayoutLines)
StartPage Variant or Long The page number of the top left of the associated text(default: the first page)
EndPage Variant or Long The page number of the bottom right of the associatedtext (default: 0)
Property Value
Read-only Long Array. The required text attributes.
Applies to
AutoWindow
BackColor (HotSpot)This property represents the background color of a wIntegrate HotSpot object.
The color cannot be applied to an object if its style does not allow it. See Style (HotSpot), on page42.
Syntax
BackColor
Property Value
Read/Write wTextColorEnum. A value representing a color.
Applies to
HotSpot
BackColor (HotSpots)This property represents the default background color of a HotSpots collection object. It applies toall HotSpot objects in the HotSpots collection that do not have an individual style.
Bottom
25
The color is only applied to the hot spot when the style allows it. See Style (HotSpots), on page 43.
Syntax
BackColor
Property Value
Read/Write wTextColorEnum. A value representing a color.
Applies to
HotSpots
BottomThis property represents the bottom vertical position of a wIntegrate object.
Syntax
Bottom
Property Value
Read/Write Long. The vertical position of the object in pixels.
Applies to
DisplayArea
Busy (Session)This property returns non-zero if the session is busy.
Currently, this property checks if a file transfer is in progress.
Syntax
Busy
Property Value
Read-only Boolean. True if the session object is busy.
Applies to
Session
CaptionThis property represents the caption or title text of a wIntegrate object.
Chapter 3: Properties
26
When this property is set, the special characters from the Setup > Preference dialog box for the titlecan be used to represent the current port name, number, and more. When this property is retrieved,the caption includes the current value of these parameters.
Syntax
Caption
Property Value
Read/Write String. The caption text.
Applies to
Application, AutoWindow
CaretPositionThis property represents the position of the text cursor or caret.
Syntax
CaretPosition Plane
Parameters
The following table describes the parameters of the CaretPosition property:
Parameter Type Description
Plane wPositionEnum The plane of the caret position
Property Value
Read/Write Long. The caret position.
Applies to
AutoWindow
CaretShapeThis property represents the shape of the text cursor or caret.
Syntax
CaretShape
Property Value
Read/Write wCaretShapeEnum. The caret shape.
CommandBars
27
Applies to
AutoWindow
CommandBarsThis property is reserved for future use. It currently returns a null object.
Syntax
CommandBars
Applies to
Session
ContainerFlags (Session)This property controls how the session control deals with the File and Exit handling when used inanother application.
By default, these menu options send an event to the container so that it can process these menuoptions itself. These flags allow the session control to process these options.
Syntax
ContainerFlags
Property Value
Read/Write Long. Sets the File menu options that are handled by the session control. The valueis either 0 to let the container handle the menu options, or a combination of one or more of thefollowing:
▪ 1 - File Open
▪ 2 - File Another
▪ 4 - File Save As
▪ 8 - File Save
▪ 16 - File Exit/Exit All
Applies to
Session
Version
5.2 Original version
Count (Capture)This property describes the amount of data currently captured in a wIntegrate capture object.
Chapter 3: Properties
28
Syntax
Count
Property Value
Read-only Long. The amount of data captured.
Applies to
Capture
Count (HotSpots)This property represents the number of items in a collection of HotSpot objects.
Syntax
Count
Property Value
Read-only Short. The number of items in the collection.
Applies to
HotSpots
Count (Triggers)This property represents the number of items in a collection of Trigger objects.
Syntax
Count
Property Value
Read-only Long. The number of items in the collection.
Applies to
Triggers
DisplayHorizontalScrollBarThis property represents the visible state of a wIntegrate session window horizontal scroll bar.
Syntax
DisplayHorizontalScrollBar
DisplayOn
29
Property Value
Read/Write Boolean. The session window horizontal scroll bar display state.
Applies to
AutoWindow
DisplayOnThis property represents the display state of a Window object. When the display is turned off, thecontents of the window are hidden.
Syntax
DisplayOn
Property Value
Read/Write Boolean. The display state.
Applies to
AutoWindow
DisplayStatusBarThis property represents the visible state of a wIntegrate application window status bar.
Syntax
DisplayStatusBar
Property Value
Read/Write Boolean. The session window status bar display state.
Applies to
Application
DisplayUpdateThis property represents the update state of the Window object. This allows the update of the displayto be temporarily stopped to decrease screen flashing. The DisplayUpdate property should only beturned off for short periods of time.
Syntax
DisplayUpdate
Chapter 3: Properties
30
Property Value
Read/Write wDisplayUpdateEnum. The update state.
Applies to
AutoWindow
DisplayVerticalScrollBarThis property represents the visible state of a wIntegrate session window vertical scroll bar.
Syntax
DisplayVerticalScrollBar
Property Value
Read/Write Boolean. The session window vertical scroll bar display state.
Applies to
AutoWindow
EnabledThis property represents the active state of a wIntegrate object. For a window object, the state isactive when output appears in the window and inactive when no output appears.
Syntax
Enabled
Property Value
Read/Write Boolean. The active state.
Applies to
AutoWindow, DataWatch, HotSpots
FileNameThis property represents the name of the file that receives captured data for a wIntegrate captureobject. The capture target must be set to wCaptureTargetFile for capturing data to a file.
Syntax
FileName
ForeColor (HotSpot)
31
Property Value
Read-only String. The capture data file name.
Applies to
Capture
ForeColor (HotSpot)This property represents the foreground color of a wIntegrate HotSpot.
The color cannot be applied to an object if its style does not allow it. See Style (HotSpot), on page42.
Syntax
ForeColor
Property Value
Read/Write wTextColorEnum. A value representing a color.
Applies to
HotSpot
ForeColor (HotSpots)This property represents the foreground color of a HotSpots collection object. It applies to allHotSpot objects in the HotSpots collection that use the default style.
The color cannot be applied to an object if its style does not allow it. See Style (HotSpots), on page43.
Syntax
ForeColor
Property Value
Read/Write wTextColorEnum. A value representing a color.
Applies to
HotSpots
FoundCountThis property represents the number of times the text in a DataWatch object is found. The count isautomatically reset to zero if a disabled DataWatch object is then enabled.
Chapter 3: Properties
32
Syntax
FoundCount
Property Value
Read/Write Long. The number of times the text from the DataWatch object is found.
Applies to
DataWatch
FullName (Session)This property is the full name of the file that opened this session.
Setting this property only changes the name internally.
Syntax
FullName
Property Value
Read/Write String. Full name of the file that opened this session.
Applies to
Session
HeightThis property represents the height of a wIntegrate object.
Syntax
Height
Property Value
Read/Write Long. The height of the object in pixels.
Applies to
Application, DisplayArea, HotSpot, Trigger
HotSpotsThis property returns the HotSpots object associated with a wIntegrate session.
Syntax
HotSpots
Id (DockBar)
33
Property Value
Read-only HotSpots. The HotSpots object.
Applies to
Session
Id (DockBar)This property provides the identifier required for the AttachDockBar method on the session object.
Syntax
Id
Applies to
DockBar
Version
5.2.0 First supported
Id (Session)This property is the numeric ID for the session. Each session is assigned a unique ID.
Syntax
Id
Property Value
Read-only Long. The ID for the session.
Applies to
Session
IndexThis property represents the index of a wIntegrate object within a collection.
The index can change during the lifetime of the object as other objects are added to or removed fromthe collection.
Syntax
Index
Chapter 3: Properties
34
Property Value
Read-only Long. The index of the object.
Applies to
Capture, HotSpot
InformationThis property returns information about a Selection. The information depends on the specifiedargument.
Syntax
Information Type
Parameters
The following table describes the parameters of the Information property:
Parameter Type Description
Type wSelectionInfoEnum The type of information that is required
Property Value
Read-only Variant. The required information. The actual value type depends on the Type argument.
Applies to
Selection
Item (HotSpots)This property represents a HotSpot item in a HotSpots collection.
This is the default property of the HotSpots collection.
Syntax
Item Index
Parameters
The following table describes the parameters of the Item property:
Parameter Type Description
Index Variant or Long The index of the item required
Property Value
Read-only HotSpot. The required collection item.
Item (Triggers)
35
Applies to
HotSpots
Item (Triggers)This property represents a trigger item in a Triggers collection.
This is the default property for the Triggers collection.
Syntax
Item Index
Parameters
The following table describes the parameters of the Item property:
Parameter Type Description
Index Variant or Long The index of the item required
Property Value
Read-only Trigger. The required collection item.
Applies to
Triggers
LeftThis property represents the horizontal position of a wIntegrate object.
Syntax
Left
Property Value
Read/Write Long. The horizontal position of the object in pixels.
Applies to
Application, DisplayArea, HotSpot, Trigger
LengthThis property describes the amount of data to capture for a wIntegrate capture object. When theamount of data received reaches the length, a Full event is generated.
Chapter 3: Properties
36
Syntax
Length
Property Value
Read-only Long. The capture data length.
Applies to
Capture
MouseIconThis property represents the shape of the custom mouse cursor associated with a wIntegrate sessionwindow. Custom cursors can be defined and stored in a file that should be called wCursor.dll andplaced in the wIntegrate folder. All the custom cursors should be given names; these names are usedto set the mouse cursor shape. To set the mouse cursor to a custom cursor shape, set the MouseIconproperty to the required cursor then set the MousePointer property to the custom cursor value.
Syntax
MouseIcon
Property Value
Read/Write String. The name of the custom mouse cursor shape.
Applies to
AutoWindow
MousePointerThis property represents the shape of the mouse cursor associated with a wIntegrate sessionwindow. It can be used to set the mouse cursor to one of the standard Windows shapes or, with theMouseIcon property, a custom shape.
Syntax
MousePointer
Property Value
Read/Write wCursorShapeEnum. The mouse cursor shape.
Applies to
AutoWindow
MousePositionThis property represents the position of the mouse cursor when over a wIntegrate session window.
Name (Session)
37
Syntax
MousePosition Parameter
Parameters
The following table describes the parameters of the MousePosition property:
Parameter Type Description
Parameter wMousePositionEnum The mouse position information required
Property Value
Read-only Long. The required information.
Applies to
AutoWindow
Name (Session)This property represents the internal name of a wIntegrate session. wIntegrate ensures that eachsession has a unique name. Although the property can be changed, doing so is not recommended.
Syntax
Name
Property Value
Read/Write String. wIntegrate session internal name.
Applies to
Session
PatternThis property represents the pattern or text monitored by a wIntegrate trigger object.
For trigger types that do not include a pattern or text, an empty string is returned.
Syntax
Pattern
Property Value
Read-only String. The monitored text.
Applies to
Trigger
Chapter 3: Properties
38
PausedThis property represents the paused state of a capture object.
Syntax
Paused
Property Value
Read-only Boolean. The paused state of the capture.
Applies to
Capture
RequiredHeight (DockBar)This property returns the minimum height required for the docking bar to show all the toolbarscurrently on it.
It is usually used on the receipt of a HeightChanged event from the docking bar to find out the bestheight to resize the docking bar to.
Syntax
RequiredHeight
Applies to
DockBar
Version
5.2.0 Added
RightThis property represents the horizontal position of the right edge of a wIntegrate object.
Syntax
Right
Property Value
Read/Write Long. The horizontal position of the object in pixels.
Applies to
DisplayArea
Running
39
RunningThis property represents the running state of a capture object.
Syntax
Running
Property Value
Read-only Boolean. The running state of the capture.
Applies to
Capture
ScreenAreaThis property returns a DisplayArea object that covers the entire display screen of the Windowobject.
Syntax
ScreenArea
Property Value
Read-only DisplayArea. The DisplayArea object that covers the screen area.
Applies to
AutoWindow
Examples
The following example puts a border around the edge of the screen region.
Session.Window.ScreenArea.Box wBoxStyleSingleBorder
ScrollArea (DisplayArea)This property represents the scroll area type of a display area object. Only one scroll area can exist, sosetting a new scroll area cancels an existing one. The scroll area is linked to the area of the screen, somoving or resizing the DisplayArea object can change this property.
Syntax
ScrollArea
Property Value
Read/Write wScrollAreaEnum. The type of the scroll area.
Chapter 3: Properties
40
Applies to
DisplayArea
ScrollArea (Window)This property returns a DisplayArea object that covers the area of the Window object in which textwill scroll.
Syntax
ScrollArea
Property Value
Read-only DisplayArea. The DisplayArea object that covers the scroll area
Applies to
AutoWindow
Examples
The following example clears the current scroll region.
Session.Window.ScrollArea.ScrollArea = wScrollAreaNo
SelectedThis property specifies whether an area has been highlighted by a selection or not.
Syntax
Selected
Property Value
Read-only Boolean. The selected state.
Applies to
Selection
SelectionThis property returns the selection object associated with a wIntegrate session.
Syntax
Selection
Session
41
Property Value
Read-only Selection. The selection object.
Applies to
Session
SessionThis property returns the Session object associated with a wIntegrate application.
Syntax
Session
Property Value
Read-only Session. The session object
Applies to
Application
SettingThis property allows the setting of variables that are saved in a wIntegrate session or the variableassociated with a dialog to be set or interrogated. The SettingsDialog property can be used to specifythe dialog to use.
To see the available dialog menu option names, see the information about script menu options in theClient Scripting Reference.
Syntax
Setting Name
Parameters
The following table describes the parameters of the Setting property:
Parameter Type Description
Name String The name of the setting to use
Property Value
Read/Write String. The value of the setting.
Applies to
Session
Chapter 3: Properties
42
Examples
The following example sets the emulation to VT100.
wApp.Session.Setting("Emulation") = "vt100"
SettingsDialogThis property represents the name of the wIntegrate dialog to use with the Setting property orStoreSetting method. For global session variables, this value does not need to be set.
To see the available dialog menu option names, see the information about script menu options in theClient Scripting Reference.
Syntax
SettingsDialog
Property Value
Read/Write String. wIntegrate dialog name.
Applies to
Session
StatusBarTextThis property represents the text associated with a wIntegrate application window status bar.
Syntax
StatusBarText
Property Value
Read/Write String. The session window status bar text.
Applies to
Application
Style (HotSpot)This property represents the style of a wIntegrate HotSpot object.
Syntax
Style
Style (HotSpots)
43
Property Value
Read/Write wHotSpotStyleEnum. A value representing a HotSpot style.
Applies to
HotSpot
Style (HotSpots)This property represents the style of a HotSpots collection object. It applies to all HotSpot objectsin the HotSpots collection.
Syntax
Style
Property Value
Read/Write wHotSpotStyleEnum. A value representing a HotSpot style.
Applies to
HotSpots
Text (Capture)This property represents the text in a wIntegrate capture object. The format that the text is returned incan be specified using the TextFormat property. The default format strips out character zero fromthe returned text.
Syntax
Text
Property Value
Read-only String. The captured text.
Applies to
Capture
Text (DataWatch)This property represents the text to be found in a wIntegrate DataWatch object.
Syntax
Text
Chapter 3: Properties
44
Property Value
Read-only String. The text that is watched for.
Applies to
DataWatch
Text (DisplayArea)This property returns all the text within a display area object.
Syntax
Text [Format]
Parameters
The following table describes the parameters of the Text property:
Parameter Type Description
Format wTextFormatEnum The format of the required text (default:wTextFormatNone)
Property Value
Read-only String. The required text.
Applies to
DisplayArea
Text (Selection)This property represents the text highlighted by a selection.
Syntax
Text Format
Parameters
The following table describes the parameters of the Text property:
Parameter Type Description
Format wSelectionTextEnum The required format
Property Value
Read-only String. The selected text.
Text (Window)
45
Applies to
Selection
Text (Window)This property returns the text at a specified location within a wIntegrate session window.
This is the default property for the Window object.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Syntax
Text [Left], [Top], [Right], [Bottom], [Layout], [Format], [StartPage],[EndPage]
Parameters
The following table describes the parameters of the Text property:
Parameter Type Description
Left Variant or Long The column number of the top left of the required text(default: 0)
Top Variant or Long The row number of the top left of the required text(default: 0)
Right Variant or Long The column number of the bottom right of therequired text (default: the right of the session window)
Bottom Variant or Long The row number of the bottom right of the requiredtext (default: the bottom of the session window)
Layout Variant orwTextLayoutEnum
The layout of text required (default:wTextLayoutLines)
Format Variant orwTextFormatEnum
The format of the required text (default:wTextFormatNone)
StartPage Variant or Long The page number of the top left of the required text(default: the first page)
EndPage Variant or Long The page number of the bottom right of the requiredtext (default: 0)
Property Value
Read-only Variant. The required text.
Applies to
AutoWindow
TextFormatThis property represents the format that the text in a wIntegrate capture object should be returned.The default value is wCaptureTextFormatStripZeroes.
Chapter 3: Properties
46
Syntax
TextFormat
Property Value
Read/Write wCaptureTextFormatEnum. The format to return the captured text.
Applies to
Capture
TopThis property represents the vertical position of a wIntegrate object.
Syntax
Top
Property Value
Read/Write Long. The vertical position of the object in pixels.
Applies to
Application, DisplayArea, HotSpot, Trigger
TriggersThis property returns the triggers object associated with a wIntegrate session.
Syntax
Triggers
Property Value
Read-only Triggers. The triggers object.
Applies to
Session
Type (Selection)This property describes the type of a selection.
Syntax
Type
Type (Trigger)
47
Property Value
Read/Write wSelectionTypeEnum. The selection type.
Applies to
Selection
Type (Trigger)This property describes the type of a wIntegrate trigger object.
Syntax
Type
Property Value
Read-only wTriggerTypeEnum. The trigger type.
Applies to
Trigger
VariableThis property represents the global script variable. This allows you to set and get variables that can beused by scripting.
Syntax
Variable Name
Parameters
The following table describes the parameters of the Variable property:
Parameter Type Description
Name String The name of the global script variable
Property Value
Read/Write String. The value of the global script variable.
Applies to
Session
VersionThis property returns the wIntegrate version number.
Chapter 3: Properties
48
Syntax
Version
Property Value
Read-only String. The version number.
Applies to
Application, Session
VisibleThis property represents the visible state of a wIntegrate object.
Syntax
Visible
Property Value
Read/Write Boolean. The visible state.
Applies to
Application
WHeight (Session)This property is the session’s internal height.
This property is for internal use only and is subject to change.
Do not use.
Syntax
WHeight
Property Value
Read/Write Long. Session’s height.
Applies to
SessionThis object represents a wIntegrate session.
WLeft (Session)This property is the session’s internal left position.
This property is for internal use only and is subject to change.
WState (Session)
49
Do not use.
Syntax
WLeft
Property Value
Read/Write Long. Left position.
Applies to
Session
WState (Session)This property is the session’s internal show state.
This property is for internal use only and is subject to change.
Do not use.
Syntax
WState
Property Value
Read/Write Short. The internal state.
Applies to
Session
WTop (Session)This property is the session’s internal top position.
This property is for internal use only and is subject to change.
Do not use.
Syntax
WTop
Property Value
Read/Write Long. Top position.
Applies to
Session
Chapter 3: Properties
50
WWidth (Session)This property is the session’s internal width.
This property is for internal use only and is subject to change.
Do not use.
Syntax
WWidth
Property Value
Read/Write Long. Internal width.
Applies to
Session
WidthThis property represents the width of a wIntegrate object.
Syntax
Width
Property Value
Read/Write Long. The width of the object in pixels.
Applies to
Application, DisplayArea, HotSpot, Trigger
WindowThis property returns the window object associated with a wIntegrate session.
Syntax
Window
Property Value
Read-only AutoWindow. The window object.
Applies to
Session
WindowState
51
WindowStateThis property represents the window state of a wIntegrate application window, such as maximized orminimized.
Syntax
WindowState
Property Value
Read/Write wWindowStateEnum. The wIntegrate session window state.
Applies to
Application
WordThis property returns the word or highlighted character of the word at a specified location within thewIntegrate session window.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Syntax
Word [Left], [Top], [Options], [Delimiter], [Page]
Parameters
The following table describes the parameters of the Word property:
Parameter Type Description
Left Variant or Long The column number of the top left of the requiredword (default: current text cursor position)
Top Variant or Long The row number of the top left of the required word(default: current text cursor position)
Options Variant orwWordOptionsEnum
Specifies what to retrieve (default:wDataWordOptionsWord)
Delimiter Variant or Long The delimiting character used to determine thelocation of the end of the word (default: " ")
Page Variant or Long The page number of the required word (default:current text cursor position)
Property Value
Read-only String. The required text.
Applies to
AutoWindow
Chapter 3: Properties
52
Examples
The following example gets the word at the current text cursor position:
MyApp = CreateObject("wIntegrate.Document")MyWord = MyApp.Session.Window.Word
The following example gets the word from the start of the current page that is delimited by a comma:
MyApp = CreateObject("wIntegrate.Document")MyWord = MyApp.Session.Window.Word(0, 0, wDataWordOptionsDelimiter, ",")
hWnd (Session)This property is the Windows window handle of the session.
Syntax
hWnd
Property Value
Read-only Long. The window handle.
Applies to
Session
53
Chapter 4: Methods
AboutBox (Session)This method shows the session control About box.
Syntax
AboutBox
Applies to
Session
Add (HotSpots)This method adds a new hot spot to a wIntegrate session. A hot spot must be removed with Removeor RemoveAll method when it is no longer required.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
The ForeColor and BackColor arguments only apply if the wHotSpotStyleColored enumerator is used inthe Style argument.
Syntax
Add Left, Top, Right, Bottom, [Style], [ForeColor], [BackColor]
Parameters
The following table describes the parameters of the Add method:
Parameter Type Description
Left Long Specifies the column number of the top left of the hotspot
Top Long Specifies the row number of the top left of the hot spotRight Long Specifies the column number of the bottom right of
the hot spotBottom Long Specifies the row number of the bottom right of the
hot spotStyle Variant or
wHotSpotStyleEnumSpecifies the style for this hot spot. Defaults to use thestyle from the HotSpots collection
ForeColor Variant orwTextColorEnum
Specifies the foreground color
BackColor Variant orwTextColorEnum
Specifies the background color
Chapter 4: Methods
54
Applies to
HotSpots
Add (Triggers)This method adds a new Trigger object to a wIntegrate session.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Triggers can be applied to incoming data or to data that appears in the session window, depending onthe value of the Type argument. If the Left, Top, Right, and Bottom position values are specified, thenthe trigger is activated by changes in text on the screen. Otherwise, it is activated by incoming data.
Syntax
Add Pattern, [Type], [Left], [Top], [Right], [Bottom]
Parameters
The following table describes the parameters of the Add method:
Parameter Type Description
Pattern String Specifies the text pattern used to cause the triggerType Variant or
wTriggerTypeEnumSpecifies the type of trigger
Left Variant or Long Specifies the column number of the top left of thetrigger
Top Variant or Long Specifies the row number of the top left of the triggerRight Variant or Long Specifies the column number of the bottom right of
the triggerBottom Variant or Long Specifies the row number of the bottom right of the
trigger
Applies to
Triggers
Examples
The following example adds a trigger to detect the select prompt at 10,22.
Set PromptTrig = MyTriggers.Add("Select option:",wTriggerTypeText, 10, 22, 35, 10)
AppendTextThis method appends text to the data recorded in a Capture object.
Syntax
AppendText Text
AttachDockBar (Session)
55
Parameters
The following table describes the parameters of the AppendText method:
Parameter Type Description
Text String The text to append to the recording
Applies to
Capture
AttachDockBar (Session)This method is used in an external container application, for example, to attach a docking bar controlto a session.
Once a docking bar control is attached, it is updated with the appropriate script commands in thesession.
Syntax
AttachDockBar DockBarId, Where, Attached
Parameters
The following table describes the parameters of the AttachDockBar method:
Parameter Type Description
DockBarId Long Docking bar IDWhere Long Location of the docking bar in respect to the session. 0
is above the session; 1 is below the sessionAttached Boolean True if the dock bar was attached correctly
Applies to
Session
Examples
See the example in the Example\HTML\WintJS.htm location.
Version
5.2.0 First supported
AttributeFillThis method fills the area of the Window represented by a DisplayArea object with the specifiedattribute.
Chapter 4: Methods
56
Syntax
AttributeFill Type, Attribute
Parameters
The following table describes the parameters of the AttributeFill method:
Parameter Type Description
Type wAttributeTypeEnum The attribute typeAttribute wTextEffectEnum or
wTextColorEnumSpecifies the value of the attribute, which depends onthe attribute type
Applies to
DisplayArea
BoxThis method draws a box in the rectangle area defined by a DisplayArea object. If theDisplayArea object has a width or depth of 1, a line is drawn.
Syntax
Box Style
Parameters
The following table describes the parameters of the Box method:
Parameter Type Description
Style wBoxStyleEnum The style to use for the box drawing
Applies to
DisplayArea
CanExit (Session)This method is an internal method to check if the session can exit.
This method is for internal use and subject to change.
Do not use.
Syntax
CanExit Flags
Parameters
The following table describes the parameters of the CanExit method:
CanRestore (Session)
57
Parameter Type Description
Flags Long * Input/Output flags
Return Value
Boolean. True if OK to exit.
Applies to
Session
CanRestore (Session)This method checks if it is OK to restore the session from minimized.
This method checks if a restore script has been set for the session, runs it, and returns False if it has;otherwise, it returns True.
This is an internal method used to help implement the Event OnRestore script command.
Syntax
CanRestore
Return Value
Boolean. Returns true if it is OK to restore a minimized session.
Applies to
Session
CaptureThis method creates a new Capture object to record data from the wIntegrate session.
If capturing data to a file, both the FileName and Target arguments must be set appropriately.
Syntax
Capture [Target], [Format], [Options], [Length], [FileName], [Widths]
Parameters
The following table describes the parameters of the Capture method:
Parameter Type Description
Target Variant orwCaptureTargetEnum
Specifies the target or destination for the captureddata
Format Variant orwCaptureFormatEnum
Specifies the format of the captured data
Options Variant orwCaptureOptionsEnum
Specifies the type of capture
Chapter 4: Methods
58
Parameter Type Description
Length Variant or Long Specifies the length of the buffer used to capture thedata
FileName Variant or String Specifies the file name to capture the data toWidths Variant or String Specifies a comma-separated list of the field widths for
the wCaptureFormatTable capture
Return Value
Capture. The capture object representing this capture.
Applies to
Session
CharacterFillThis method fills the area of a DisplayArea object with the specified character.
Syntax
CharacterFill Character
Parameters
The following table describes the parameters of the CharacterFill method:
Parameter Type Description
Character String The character to fill the area with
Applies to
DisplayArea
Clear (Capture)This method removes or clears all captured data from a wIntegrate Capture object.
Syntax
Clear
Applies to
Capture
Clear (Selection)This method clears or removes the highlighted area of a Selection object.
Continue
59
Syntax
Clear
Applies to
Selection
ContinueThis method continues a capture after is has been paused with the Pause method of a wIntegrateCapture object.
Syntax
Continue
Applies to
Capture
CopyThis method copies the text associated with a Selection object to the clipboard.
Syntax
Copy Format
Parameters
The following table describes the parameters of the Copy method:
Parameter Type Description
Format wSelectionFormatEnum Specifies the clipboard format
Applies to
Selection
Copy (Session)This copies the current selection to the clipboard.
This method is obsolete and no longer supported. Use the Selection.Copy method instead.
Syntax
Copy
Chapter 4: Methods
60
Applies to
Session
CopySpecial (Session)This method copies the current Selection object to the clipboard using the format defined in theEdit > Copy Special to menu option.
This method is obsolete and no longer supported. Use the Selection.Copy method or theSession.InvokeDialog(“EditCopySpecial”) method instead.
Syntax
CopySpecial
Applies to
Session
DataWatchThis method creates a new DataWatch object that fires an event when the specified text is receivedfrom the host.
Syntax
DataWatch Text, [Type]
Parameters
The following table describes the parameters of the DataWatch method:
Parameter Type Description
Text String The text to watch forType Variant Reserved. Set to 0. (Short)
Return Value
DataWatch. The DataWatch object created.
Applies to
Session
Examples
The following example set a data watch on the text “Login.”
' Declare object to watch for the text "Login"Dim WithEvents LoginWatch As DataWatch...' Set up object (probably in Form_Load subroutine)
DisplayArea
61
Set LoginWatch = wApp.Session.DataWatch("Login:")
DisplayAreaThis method creates a new DisplayArea object that represents a rectangular section of theWindow object.
Syntax
DisplayArea Left, Top, Right, Bottom
Parameters
The following table describes the parameters of the DisplayArea method:
Parameter Type Description
Left Long The left column of the areaTop Long The top row of the areaRight Long The right column of the areaBottom Long The bottom row of the area
Return Value
DisplayArea. A DisplayArea object covering the specified rectangle.
Applies to
AutoWindow
Examples
The following example fills an area of the window with asterisks.
Session.Window.DisplayArea(10,10,70,12).CharacterFill "*"
DisplayAttributeThis method sets the terminal emulation text attribute at the current text cursor or caret position in awIntegrate session window. The effect of the new attribute is not visible until new text is displayed.
Syntax
DisplayAttribute Type, Attribute
Parameters
The following table describes the parameters of the DisplayAttribute method:
Parameter Type Description
Type wAttributeTypeEnum Specifies the attribute type
Chapter 4: Methods
62
Parameter Type Description
Attribute wTextEffectEnum orwTextColorEnum
Specifies the value of the attribute, which depends onthe attribute type
Applies to
AutoWindow
DisplayCommandThis method runs the emulation command specified.
Syntax
DisplayCommand Name, [Param1], [Param2]
Parameters
The following table describes the parameters of the DisplayCommand method:
Parameter Type Description
Name String The name of the emulation command to runParam1 String The first parameter for an emulation command that
requires one or more parametersParam2 String The second parameter for an emulation command
that requires two parameters
Applies to
AutoWindow
Examples
This example clears the screen.
Window.DisplayCommand("FormFeed")
DisplayTextThis method displays text in a wIntegrate session window at the current text cursor or caret position.
Syntax
DisplayText Text
Parameters
The following table describes the parameters of the DisplayText method:
Parameter Type Description
Text String Specifies the text to display
Exit (Session)
63
Applies to
AutoWindow
Exit (Session)This method asks the session to exit. If an exit script is defined, the exit script runs, and the methodreturns False. Otherwise, the exit event is fired, and the session return True.
This method is for internal use and subject to change.
Do not use.
Syntax
Exit
Return Value
Boolean. Returns True if exit event was fired, otherwise False.
Applies to
Session
Extension (Session)This method is an internal method to return an extension.
This method is for internal use and subject to change.
Do not use.
Syntax
Extension Id
Parameters
The following table describes the parameters of the Extension method:
Parameter Type Description
Id Variant Extension identifier
Return Value
Long. Extension object or null. For internal use only.
Applies to
Session
GetSessionScript (Session)This method creates and returns a string that contains the session configuration script.
Chapter 4: Methods
64
This is the text of a script that, when run, sets the session back to its current state.
Syntax
GetSessionScript
Return Value
String. The text of the configuration script
Applies to
Session
InflateThis method increases the size of a DisplayArea object by adding an amount to its sides.
Syntax
Inflate X, Y
Parameters
The following table describes the parameters of the Inflate method:
Parameter Type Description
X Long The amount to remove from the left side and addto the right sides. A negative value reduces theDisplayArea object
Y Long The amount to remove from the top and add tothe bottom sides. A negative value reduces theDisplayArea object
Applies to
DisplayArea
InvokeDialogThis method invokes the functionality behind a Session dialog box.
To see the available dialog menu option names, see the information about script menu options in theClient Scripting Reference.
Syntax
InvokeDialog Dialog
Parameters
The following table describes the parameters of the InvokeDialog method:
MoveCaret
65
Parameter Type Description
Dialog Variant Specifies the name of the dialog to display (String)
Applies to
Session
MoveCaretThis method moves the text caret to the new column and row. This is a shortcut to using theCaretPosition property twice.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Syntax
MoveCaret Column, Row
Parameters
The following table describes the parameters of the MoveCaret method:
Parameter Type Description
Column Long The new column for the caretRow Long The new row for the caret
Applies to
AutoWindow
Open (Session)This method opens a script file. This method runs a session configuration script file on the currentsession using the name of the file. The following scripts are run:
▪ The PreSessionOpen script (from Setup > Application) is run if it exists.
▪ The session configuration script with the passed file name is run.
▪ Any LoadScripts defined in the session configuration script are run (from Setup > Preferences).
▪ The PostSessionOpen script (from Setup > Application) is run if it exists.
You can also use the following alternative approaches from the Object method:
▪ Use the RunScriptFile method, as this method runs the specified script without any other sideeffects.
▪ Use the Setting property (or the StoreSetting/UpdateSettings methods) to set thesession variables. To see the available dialog menu option names, see the information about scriptmenu options in the Client Scripting Reference.
Syntax
Open Filename
Chapter 4: Methods
66
Parameters
The following table describes the parameters of the Open method:
Parameter Type Description
Filename String The name of the script file to open
Applies to
Session
OpenScript (Session)This method is runs a session configuration script file on the current session, using the received scripttext. The following scripts are run:
▪ The PreSessionOpen script (from Setup > Application) is run if it exists.
▪ The received session configuration script is run.
▪ Any LoadScripts defined in the session configuration script are run (from Setup > Preferences).
▪ The PostSessionOpen script (from Setup > Application) is run if it exists.
Syntax
OpenScript Script
Parameters
The following table describes the parameters of the OpenScript method:
Parameter Type Description
Script String The text of the script
Return Value
Long. The error code. Returns 0 if open process executed OK. The script error dialog box appears ifthere is an error in the script itself.
Applies to
Session
Paste (Session)This method pastes data from clipboard to the session window.
Syntax
Paste
Applies to
Session
Pause
67
PauseThis method pauses a capture. While the capture is paused, no data is recorded until the Continuemethod is called.
Syntax
Pause
Applies to
Capture
QuitThis method quits wIntegrate.
Syntax
Quit
Applies to
Application
RemoveThis method removes a specific object from a collection of wIntegrate objects.
Syntax
Remove Index
Parameters
The following table describes the parameters of the Remove method:
Parameter Type Description
Index Short The index of the item to be removed
Applies to
HotSpots
RemoveAllThis method removes all objects from a collection of wIntegrate objects.
Chapter 4: Methods
68
Syntax
RemoveAll
Applies to
HotSpots
ResizeThis method resizes a wIntegrate application window.
Syntax
Resize Width, Height
Parameters
The following table describes the parameters of the Resize method:
Parameter Type Description
Width Long The required window width in pixelsHeight Long The required window height in pixels
Applies to
Application
RunScriptCommandThis method runs a wIntegrate script command.
Syntax
RunScriptCommand Command
Parameters
The following table describes the parameters of the RunScriptCommand method:
Parameter Type Description
Command String Specifies the name of the script command to run
Applies to
Session
RunScriptFileThis method runs a wIntegrate script file.
Save (Session)
69
Syntax
RunScriptFile Command, [Argument]
Parameters
The following table describes the parameters of the RunScriptFile method:
Parameter Type Description
Command String Specifies the name of the script file to runArgument String Specifies optional arguments
Applies to
Session
Save (Session)This method saves session parameters as a script.
Syntax
Save FileName
Parameters
The following table describes the parameters of the Save method:
Parameter Type Description
FileName String The file name for the save. If this is "", then the Save Asdialog box is displayed.
Return Value
Long. Returns 0 if the save was successful, otherwise 1.
Applies to
Session
ScrollAll (Session)This method scrolls the display to the top or the bottom of the backpage memory.
Alternatively, use the InvokeDialog method with the ScrollTopPage or ScrollEndPage parameter.
Syntax
ScrollAll Direction
Parameters
The following table describes the parameters of the ScrollAll method:
Chapter 4: Methods
70
Parameter Type Description
Direction Short Direction to scroll. 0 down; 1 up.
Applies to
Session
ScrollLine (Session)This method scrolls the display back or forward one line.
Alternatively, use the InvokeDialog method with the ScrollUpLine or ScrollDownLine parameter.
Syntax
ScrollLine Direction
Parameters
The following table describes the parameters of the ScrollLine method:
Parameter Type Description
Direction Long Direction to scroll: 0 down, 1 up
Applies to
Session
ScrollPage (Session)This method scrolls the display up or down one page.
Alternatively, use the InvokeDialog method with the ScrollUpPage or ScrollDownPage parameter.
Syntax
ScrollPage Direction
Parameters
The following table describes the parameters of the ScrollPage method:
Parameter Type Description
Direction Short Direction to scroll: 0 - down, 1 - up.
Applies to
Session
SelectThis method selects an area of a wIntegrate session window.
SelectAll
71
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Syntax
Select Left, Top, Right, Bottom, Type, StartPage, EndPage
Parameters
The following table describes the parameters of the Select method:
Parameter Type Description
Left Long Specifies the column number of the top left of theselection
Top Long Specifies the row number of the top left of theselection
Right Long Specifies the column number of the bottom right ofthe selection
Bottom Long Specifies the row number of the bottom right of theselection
Type wSelectionTypeEnum Specifies the type of selectionStartPage Long Specifies the page number of the top left of the
selectionEndPage Long Specifies the page number of the bottom right of the
selection
Applies to
Selection
SelectAllThis method selects all of the data in the current screen and backpage memory of the current session.
Syntax
SelectAll
Applies to
Selection
SelectWindowThis method selects all of the visible data in a wIntegrate session window. If the visible window hasbeen scrolled up to display backpage memory, then this will be selected.
Syntax
SelectWindow
Chapter 4: Methods
72
Applies to
Selection
SendThis method sends data to a remote host as if the user had typed the data in a wIntegrate session.
If the Options argument is omitted, the default wSendOptionsEnum value is used.
Syntax
Send Data, [Options]
Parameters
The following table describes the parameters of the Send method:
Parameter Type Description
Data String The data to be sentOptions Variant or
wSendOptionsEnumSpecifies any send options
Applies to
Session
SetEndThis method sets the end position, for example, the bottom right corner of a highlighted selection. Themethod does nothing if the selection is not highlighted.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Syntax
SetEnd Right, Bottom, Page
Parameters
The following table describes the parameters of the SetEnd method:
Parameter Type Description
Right Long Specifies the column number of the bottom right ofthe selection
Bottom Long Specifies the row number of the bottom right of theselection
Page Long Specifies the page number of the bottom right of theselection
SetStart
73
Applies to
Selection
SetStartThis method sets the start position, for example, the top left corner of a highlighted selection. Themethod does nothing if the selection is not highlighted.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Syntax
SetStart Left, Top, Page
Parameters
The following table describes the parameters of the SetStart method:
Parameter Type Description
Left Long Specifies the column number of the top left of theselection
Top Long Specifies the row number of the top left of theselection
Page Long Specifies the page number of the top left of theselection
Applies to
Selection
SetStatusBar (Session)This method is the internal method to setup the status bar.
This method is for internal use and subject to change.
Do not use.
Syntax
SetStatusBar Object
Parameters
The following table describes the parameters of the SetStatusBar method:
Parameter Type Description
Object Long Status bar pointer
Chapter 4: Methods
74
Return Value
Long. Returns 0 if successful.
Applies to
Session
SetupOpen (Session)This method shows the open dialog box (for scripts only).
It is obsolete and no longer supported. Use ShowDialog("FileOpen") instead.
Syntax
SetupOpen
Applies to
Session
SetupSave (Session)This method shows the save as dialog box to create a script of the session configuration only.
It is obsolete and no longer supported. Use ShowDialog("FileSaveAs") instead.
Syntax
SetupSave
Applies to
Session
ShowDialogThis method displays a Session dialog box.
Dialog names correspond closely to wIntegrate menu options. For more information about thepossible values, see the Client Script Reference.
Syntax
ShowDialog Dialog
Parameters
The following table describes the parameters of the ShowDialog method:
Parameter Type Description
Dialog Variant Specifies the name of the dialog to display (String)
SnapToSize (Session)
75
Applies to
Session
SnapToSize (Session)This method is an internal method to implement snap to size.
This method is for internal use and subject to change.
Do not use.
Syntax
SnapToSize Snap
Parameters
The following table describes the parameters of the SnapToSize method:
Parameter Type Description
Snap Boolean True to snap to size, False to return the snap to sizeflag only
Return Value
Boolean. Returns current setting of the snap to size flag.
Applies to
Session
StartThis method starts a Capture object recording. A Capture object is automatically started when it iscreated, so this method only needs to be called after a recording is stopped using the Stop method.
Syntax
Start
Applies to
Capture
StopThis method stops the recording for a Capture object. If the capture is to a printer, the captured datais printed.
Syntax
Stop
Chapter 4: Methods
76
Applies to
Capture
StoreSettingThis method allows the value session setting variable to be stored for update by a followingUpdateSettings command. Use it to reduce screen refresh/window resizing when updating agroup of settings that do these updates once.
To see the available settings, see the information about script menu options in the Client ScriptReference.
Syntax
StoreSetting Name, Value
Parameters
The following table describes the parameters of the StoreSetting method:
Parameter Type Description
Name String The name of the setting to useValue String The value of the setting
Applies to
Session
Examples
The following example set lines, columns, and backpages for the screen.
With wApp.Session.StoreSetting "Lines", 24.StoreSetting "Columns", 132.StoreSetting "BackPages", 5.UpdateSettingsEnd With
UpdateSettingsThis method updates all of the session settings that have been stored by the StoreSetting methodat once.
Use this method with the StoreSetting method to reduce the screen refresh and window resizingwhen updating a group of settings.
Syntax
UpdateSettings
UpdateSettings
77
Applies to
Session
Examples
The following example set lines, columns, and backpages for the screen.
With wApp.Session.StoreSetting "Lines", 24.StoreSetting "Columns", 132.StoreSetting "BackPages", 5.UpdateSettingsEnd With
78
Chapter 5: Events
About (Session)This event requests that the container of a session control shows its About dialog box. It occurs whenthe Help > About menu option is selected or run from the script language.
Applies to
Session
Another (Session)This event is fired when the user selects the File > Another menu option or runs it through a script.
Parameters
The following table describes the parameters of the Another event:
Parameter Type Description
FileName String The file name for the new sessionShowPrompt Boolean True to prompt for the new session
Applies to
Session
CaptionChanged (Session)This event is fired whenever the session title changes. To get the new version of the caption, use theWindow.Caption property.
Applies to
Session
ChangeThis event is called when the data associated with a wIntegrate trigger changes.
Applies to
Trigger
ClickThis event is called when a wIntegrate object is clicked.
DblClick
79
Applies to
HotSpot
DblClickThis event is called when a wIntegrate object is double-clicked.
Applies to
HotSpot
Exit (Session)This event is sent when the Exit or Exit all menu options are selected or are ran through the scriptlanguage.
Applies to
Session
FoundThis event is called when a wIntegrate DataWatch object matches its text against the incoming datafrom the host. The FoundCount property is updated before this event is generated.
Applies to
DataWatch
FullThis event is called when a wIntegrate capture object is full of data. Use the Text property to retrievethe captured data.
Applies to
Capture
HeightChanged (DockBar)This event occurs when a toolbar is added or removed from a docking bar. It is used to inform thecontaining application (or web page) that the size of docking bar might need to be increased to showall of the toolbars currently on it, or decreased to prevent a blank space at the bottom of the toolbar.
On receipt of this event, the RequiredHeight (DockBar) property can be interrogated to get theappropriate height for the toolbar.
Chapter 5: Events
80
Applies to
DockBar
Version
5.2.0 First supported
Open (Session)This event is sent by the session control when the File > Open menu option is selected or is ranthrough a script.
Parameters
The following table describes the parameters of the Open event:
Parameter Type Description
FileName String The file name to openShowPrompt Boolean True if the session control would like the containing application
to show a prompt for the file name
Applies to
Session
Opened (Session)This event is obsolete and no longer generated by the session control.
Applies to
Session
RequestAlwaysOnTop (Session)The event is fired when the session control is set to be always-on-top through the menus or scriptlanguage.
This event is for internal use and subject to change.
Do not use.
Parameters
The following table describes the parameters of the RequestAlwaysOnTop event:
Parameter Type Description
OnTop Boolean True to put container always-on-top; False to turn off thealways-on-top status
Changed Boolean * Set to true in the event if the always-on-top status was changed.
RequestEnable (Session)
81
Applies to
Session
RequestEnable (Session)This event is fired through the session control when a script command wants the entire containerapplication to be enabled or disabled.
This event is for internal use and subject to change.
Do not use.
Parameters
The following table describes the parameters of the RequestEnable event:
Parameter Type Description
Enable Boolean True if the container should be enabled; False if the containershould be disabled
Applies to
Session
RequestLockSize (Session)This event is sent when the Session LockSize script command is used, and requests that thecontainer does not allow the user to change its size.
This event is for internal use and subject to change.
Do not use.
Parameters
The following table describes the parameters of the RequestLockSize event:
Parameter Type Description
LockSize Boolean True to lock the size, False to release the lock on the size
Applies to
Session
RequestResize (Session)This event is sent from the session control to request that it is moved, resized, or changed its state.
This event is for internal use and subject to change.
Do not use.
Chapter 5: Events
82
Parameters
The following table describes the parameters of the RequestResize event:
Parameter Type Description
x Long New X coordinatey Long New Y coordinatewidth Long New widthdepth Long New depthstate Long New show state
Applies to
Session
RequireDockBar (Session)This event is an internal event requesting a docking bar.
This event is for internal use and subject to change.
Do not use.
Parameters
The following table describes the parameters of the RequireDockBar event:
Parameter Type Description
Where Long Location for dock bar
Applies to
Session
Save (Session)This event runs when the File > Save menu option or script command is run to request that thecontainer of the session control saves its configuration.
Applies to
Session
SaveAs (Session)This event runs when the File > Save As menu option is selected or run from a script to request thecontainer of the session control to save the configuration with the specified file name.
Parameters
The following table describes the parameters of the SaveAs event:
ShowStatusBar (Session)
83
Parameter Type Description
FileName String The file name to save the session withShowPrompt Boolean True if the container should show a prompt to let the user select
the file name
Applies to
Session
ShowStatusBar (Session)This event requests that a status bar is shown.
This event is for internal use and subject to change.
Do not use.
Parameters
The following table describes the parameters of the ShowStatusBar event:
Parameter Type Description
Show Boolean * True to show the status bar, False to hide the status bar
Applies to
Session
84
Chapter 6: Enumerations
wAttributeTypeEnumThese enumerations are constants that refer to different displayed text attributes.
The values should not be added together for combined attributes.
Values
The following table describes the values of the wAttributeTypeEnum enumerator:
Value Description
wAttributeTypeFont FontwAttributeTypeBackColor Background colorwAttributeTypeForeColor Foreground colorwAttributeTypeColor Foreground and background colorswAttributeTypeUser User attributeswAttributeTypeAll All of the above attributeswAttributeTypeEffect Effect
Applies to
Attribute, Attributes, DisplayAttribute, AttributeFill
wBoxStyleEnumThese enumerations are constants that refer to the styles to use when drawing a box on aDisplayArea object.
Values
The following table describes the values of the wBoxStyleEnum enumerator:
Value Description
wBoxStyleSingleBorder A single-line borderwBoxStyleDoubleBorder A double-line borderwBoxStyleBlockBorder A shaded block borderwBoxStyleSolidBorder A solid block borderwBorderStyleSingleSideBorder Add to the previous style values to make the left and right borders a
single-line border.wBorderStyleDoubleSideBorder Add to the previous style values to make the left and right borders a
double-line border.wBorderStyleBlockSideBorder Add to the previous style values to make the left and right borders a
shaded block border.wBorderStyleSolidSideBorder Add to the previous style values to make the left and right borders a
solid block border.
wCaptureFormatEnum
85
Value Description
wBorderStyleNoFill Add to the above if the inside of the border should not be cleared tospaces
wBorderStyleMerge Add to the previous style values if the lines for the border should bemerged with lines already on the screen
wBoxStyleNoBorder Spaces are used for the border
Applies to
Box
wCaptureFormatEnumThese enumerations are constants that describe the data format of a wIntegrate Capture object.
Values
The following table describes the values of the wCaptureFormatEnum enumerator:
Value Description
wCaptureFormatKeys Outgoing keyboard keyswCaptureFormatScreens Screen by screenwCaptureFormatCodes Incoming control codeswCaptureFormatAll All incoming and outgoing data, formatted for displaywCaptureFormatTable Incoming data parsed into a tab-separated tablewCaptureFormatRawIn All incoming data, unformatted (default)
Applies to
Capture
wCaptureOptionsEnumThese enumerations are the constants that allow various options to be applied to modify how theCapture object runs.
The values can be added together.
Values
The following table describes the values of the wCaptureOptionsEnum enumerator:
Value Description
wCaptureOptionsShift When the capture buffers, the data is shifted in the buffer so that thelast half buffer characters are retained
wCaptureOptionsAutoOff The capture automatically stops when the buffer is fullwCaptureOptionsAppend The data for this capture is appended to the file (wCaptureTargetFile
only)wCaptureOptionsDirectPrint The data is sent directly to the printer with no formatting
(wCaptureTargetPrinter only)
Chapter 6: Enumerations
86
Value Description
wCaptureOptionsReadPrint The settings for the printer are read from the File > Printer Setupdialog (wCaptureTargetPrinter only)
wCaptureOptionsCharMapOff Switch off the emulations character mapping during the capturewCaptureOptionsNone No special options apply (default)
Applies to
Capture
wCaptureTargetEnumThese enumerations are constants that describe the data target for a wIntegrate capture object.
Use the Text property to retrieve data captured to memory. If capturing to a file, the FileNameproperty must be set to a valid file name.
Values
The following table describes the values of the wCaptureTargetEnum enumerator:
Value Description
wCaptureTargetFile Data is captured to filewCaptureTargetPrinter Data is captured to printerwCaptureTargetMemory Data is captured to memory (default)
Applies to
Capture
wCaptureTextFormatEnumThese enumerations are the constants that allow the format of the text that is returned from a captureobject to be varied.
The wCaptureFormatStripZeroes style can be added to the other formats.
Values
The following table describes the values of the wCaptureTextFormatEnum enumerator:
Value Description
wCaptureFormatBS Text that is returned in the wIntegrate backslash format, wherecertain characters are "escaped" out with a backslash character
wCaptureFormatHex Each character is represented as two hexadecimal digitswCaptureFormatStripZeroes Character zero is stripped from the returned textwCaptureFormatRaw Text that is returned as it was recorded
wCaretShapeEnum
87
Applies to
TextFormat
wCaretShapeEnumThese enumerations are constants that describe a wIntegrate session text cursor or caret.
Values
The following table describes the values of the wCaretShapeEnum enumerator:
Value Description
wCaretShapeLine A line shape at the bottom of a text character cellwCaretShapeBlock A block shape occupying a whole text character cell
Applies to
CaretShape
wCursorShapeEnumThese enumerations are constants that refer to the different shapes of a mouse cursor.
Values
The following table describes the values of the wCursorShapeEnum enumerator:
Value Description
wCursorShapeArrow Normal arrow cursorwCursorShapeUpArrow Upward-pointing arrow cursorwCursorShapeCross Cross-hair cursorwCursorShapeIBeam Windows I-beam cursorwCursorShapeHourglass Hourglass cursorwCursorShapeCustom Custom cursor (see MouseIcon, on page 36)wCursorShapeDefault Standard wIntegrate scaling I-beam cursor
Applies to
MousePointer
wDisplayUpdateEnumThese enumerations are constants that refer to the display update mode for the Window object.
Values
The following table describes the values of the wDisplayUpdateEnum enumerator:
Chapter 6: Enumerations
88
Value Description
wDisplayUpdateOff Do not update the display when the Window data changeswDisplayUpdateFormFeed Do not update the display until the next form feedwDisplayUpdateOn Update the display immediately when the Window data changes
Applies to
DisplayUpdate
wHotSpotStyleEnumThese enumerations are constants that refer to different styles of a HotSpot object.
The wHotSpotStyleColored style must be applied to a HotSpot object before its color can be set.
See the following properties:
▪ BackColor (HotSpot), on page 24
▪ ForeColor (HotSpot), on page 31
▪ BackColor (HotSpots), on page 24
▪ ForeColor (HotSpots), on page 31
The wHotSpotStyleColored style can be combined with any one of the other styles.
Values
The following table describes the values of the wHotSpotStyleEnum enumerator:
Value Description
wHotSpotStyleRaised The hot spot appears raisedwHotSpotStyleInset The hot spot appears inset or sunkenwHotSpotStyleTextBox The hot spot appears with a text box style borderwHotSpotStyleColored The hot spot’s color can be specifiedwHotSpotStyleDefault Use with an individual hot spot to use the default style and colors
from the hot spots collection.wHotSpotStyleTransparent The hot spot appears invisible against the wIntegrate session
window (default)
Applies to
Style (HotSpot), Style (HotSpots)
wMousePositionEnumThese enumerations are constants that refer to different characteristics of the mouse cursor position.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Values
The following table describes the values of the wMousePositionEnum enumerator:
wPositionEnum
89
Value Description
wMousePositionRow The character row number of the mouse cursorwMousePositionPage The page number of the mouse cursorwMousePositionColumn The character column number of the mouse cursor
Applies to
MousePosition
wPositionEnumThese enumerations are constants that refer to a location in a wIntegrate session window.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Values
The following table describes the values of the wPositionEnum enumerator:
Value Description
wPositionRow Row numberwPositionColumn Column number
Applies to
CaretPosition
wScrollAreaEnumThese enumerations are constants that refer to window ScrollArea property of a DisplayAreaobject.
Values
The following table describes the values of the wScrollAreaEnum enumerator:
Value Description
wScrollAreaUnconfinedCaret The text cursor or caret can be moved outside the scroll areawScrollAreaYes The area is a scroll areawScrollAreaNo Not a scroll area
Applies to
ScrollArea (DisplayArea)
wSelectionFormatEnumThese enumerations are constants that describe the required clipboard format of the contents of aSelection object.
Chapter 6: Enumerations
90
Values
The following table describes the values of the wSelectionFormatEnum enumerator:
Value Description
wSelectionFormatTable The selection text that is formatted into tab-separated columnswSelectionFormatBitmap The selected area as a bitmapwSelectionFormatText The unformatted text that is described by the selection
Applies to
Copy
wSelectionInfoEnumThese enumerations are constants that refer to different characteristics of a Selection object.
Rows and columns start at 0. The top left of a wIntegrate session window is row 0, column 0. Thecurrent page is 0, the previous page is 1, the page before that is 2, and so on.
Values
The following table describes the values of the wSelectionInfoEnum enumerator:
Value Description
wSelectionInfoTop The row number of the top left of the selectionwSelectionInfoRight The column number of the bottom right of the selectionwSelectionInfoBottom The row number of the bottom right of the selectionwSelectionInfoType The type of selectionwSelectionInfoStartPage The page number of the top left of the selectionwSelectionInfoEndPage The page number of the bottom right of the selectionwSelectionInfoLeft The column number of the top left of the selection
Applies to
Information
wSelectionTextEnumThese enumerations are constants that describe the required format of the text that is associated witha selection.
Values
The following table describes the values of the wSelectionTextEnum enumerator:
Value Description
wSelectionTextTable Text that is formatted into tab-separated columnswSelectionTextNormal Unformatted text
wSelectionTypeEnum
91
Applies to
Text (Selection)
wSelectionTypeEnumThese enumerations are constants that describe the selection type of a Selection object.
Values
The following table describes the values of the wSelectionTypeEnum enumerator:
Value Description
wSelectionTypeBlock The selection encloses a rectangular area of the session windowcontents
wSelectionTypeLines The selection includes whole lines of the session window contents
Applies to
Type (Selection)
wSendOptionsEnumThese enumerations are constants that describe the options for sending data to a remote host.
Values
The following table describes the values of the wSendOptionsEnum enumerator:
Value Description
wSendOptionsAppendCr Append a carriage return to sent data (default)wSendOptionsNone No options
Applies to
Send
wTextColorEnumThese enumerations are constants that refer to different text colors.
Values
The following table describes the values of the wTextColorEnum enumerator:
Value Description
wTextColorBlue BluewTextColorGreen GreenwTextColorCyan CyanwTextColorRed Red
Chapter 6: Enumerations
92
Value Description
wTextColorMagenta MagentawTextColorYellow YellowwTextColorWhite WhitewTextColorBright Add to the previous style values to give a brighter version of the
colorwTextColorBlack Black
Applies to
BackColor (HotSpots), ForeColor (HotSpots), BackColor (HotSpot), ForeColor (HotSpot)
wTextEffectEnumThese enumerations are constants that refer to different text emulation effects.
The styles can be added together for combined effects.
Values
The following table describes the values of the wTextEffectEnum enumerator:
Value Description
wTextEffectDim DimwTextEffectReverse ReversewTextEffectUnderline UnderlinewTextEffectFlash FlashwTextEffectBold BoldwTextEffectSecret HiddenwTextEffectNormal Normal
Applies to
DisplayAttribute, AttributeFill
wTextFormatEnumThese enumerations are constants that describe the required format of text that is retrieved from awIntegrate session window.
Values
The following table describes the values of the wTextFormatEnum enumerator:
Value Description
wTextFormatTable Text that is formatted into tab-separated columnswTextFormatNone Unformatted text
wTextLayoutEnum
93
Applies to
Text (Window)
wTextLayoutEnumThese enumerations are constants that describe the required layout of text that is retrieved from awIntegrate session window.
Values
The following table describes the values of the wTextLayoutEnum enumerator:
Value Description
wTextLayoutBlock The text encloses a rectangular area of the session windowwTextLayoutLines The text includes whole lines of the session window
Applies to
Attributes, Text (Window)
wTriggerTypeEnumThese enumerations are constants that refer to the different types of a wIntegrate trigger object.
Values
The following table describes the values of the wTriggerTypeEnum enumerator:
Value Description
wTriggerTypeText Notify when the display text equals the trigger Pattern (default)wTriggerTypeMatch Notify when the display text matches the trigger PatternwTriggerTypeLineText Notify when a line of the display text equals the trigger PatternwTriggerTypeLineMatch Notify when a line of the display text matches the trigger PatternwTriggerTypeDataText Notify when the incoming data contains text equal to the trigger
Pattern
wTriggerTypeAny Notify when the display text changes
Applies to
Type (Trigger), Add (Triggers)
wWindowStateEnumThese enumerations are constants that refer to the different states of a window.
Values
The following table describes the values of the wWindowStateEnum enumerator:
Chapter 6: Enumerations
94
Value Description
wWindowStateMaximized Maximized, filling the whole screenwWindowStateMinimized Minimized, iconizedwWindowStateNormal Normal state, neither maximized nor minimized
Applies to
WindowState
wWordOptionsEnumThese enumerations are constants that describe the options for retrieving a word from a wIntegratesession window.
Values
The following table describes the values of the wWordOptionsEnum enumerator:
Value Description
wWordOptionsLetter Get highlighted character in wordwWordOptionsDelimiter Get delimited wordwWordOptionsWord Get alphanumeric word
Applies to
Word
95
Chapter 7: Accessing the object modelThe object model is accessed through Automation to the wIntegrate application or by the use of thewIntegrate Session ActiveX control from a third-party application.
When you access the object model through Automation, the Automation object for the wIntegrateapplication is wIntegrate.document, which returns the application object. From the applicationobject, you can get the Session object.
When you access the object model from an ActiveX control, embedding the wIntegrate session controlinto an application gives direct access to a Session object.
When using any ActiveX object model for a .NET language, such as VB.NET, the objects can stay inmemory until a garbage collection cycle if you simply set the reference to the object to null. To free theobjects immediately, call the Dispose method before setting the reference to null.
Overview of the main objects in the object modelThe main objects that are used in the object model are the Application, Session, Window, andSelection objects.
Application object
The Application object allows you to control the way the wIntegrate application appears. It containsmethods and properties to show, hide, and reposition wIntegrate.
Session object
The Session object is the root object for the emulation session. You can control all the functionality ofthe session itself—including emulation, screen, scripting, and sending and receiving data to and fromthe host—through properties, methods, or subobjects. When wIntegrate is embedded as an ActiveXcontrol, this is the dispatch interface returned.
Window object
The Window object allows manipulation of the display of the session and contains functionality todisplay and read data directly to or from the screen. It also allows the shape to be set of the mouseand input cursors.
Selection object
The Selection object allows the control of the selection of an area of the wIntegrate screen to beinterrogated and manipulated.
ExamplesThe following section provides a brief summary of the main features of the object model, and how theobject model can be used for certain tasks.
In the following examples, wIntApp is an object variable holding the wIntegrate Application object.wIntSession is an object holding the wIntegrate session object, which could be retrieved as thedispatch pointer from a Session control or as wIntApp.Session.
Chapter 7: Accessing the object model
96
Example code is shown from Visual Basic, but applies equally to any other language that supportsActiveX controls or Automation.
Setting the show state of the application
The Application object contains the WindowState property that allows you to control whetherthe application appears minimized, maximized, or restored. You can also hide or show the wholewIntegrate application with the Visible property.
Example
' Minimize wIntegratewIntApp.WindowState = wWindowStateMinimized
Setting up the Session
The parameters for the session are set up using the Setting property. You can also set up awhole group of parameters by putting them all in a wIntegrate script and running it using theRunScriptFile method.
Example
' Set up the emulation and hostWith wIntSession.Setting("Emulation") = "vt100".Setting("Port") = "Windows Sockets".Setting("Host") = "myserver"' open the port.Setting("PortOpen") = "1"EndWith
Retrieving text from the screen
Text can be retrieved from the screen using the Text (Window) property or Text (DisplayArea)property that is created from part of the Window. You can also use the Word property to return a wordfrom the screen.
Example
' Get all the text including the back pagestext = wIntSession.Window.Text' Get the first five characters of the current screentext = wIntSession.Window.Text(0,0,4,0,0,0,0,0)' Get a block of text formatted into a table from' column 5 row 10 to column 20 row 12text = wIntSession.Window.Text(5,10,20,12, wTextLayoutBlock,wTextFormatTable, 0,0)' Same text as above but using a display areatext = wIntSession.Window.DisplayArea(5, 10, 20,
Displaying text on the screen
97
12).Text(wTextFormatTable)
Displaying text on the screen
The Window object allows you to display text on the screen at any position and with any color orattribute. Use the MoveCaret method to position the text cursor. The DisplayAttribute methodallows you to change the color or attribute, and the DisplayText method puts the text on thescreen.
Example
' Put some red text on the top right of the screenWith wIntSession.Window.MoveCaret 72,0.DisplayAttribute wAttributeTypeColor, wTextColorRed.DisplayText "ABCDEF"EndWith
Finding out when part of the screen changes
Screen triggers can be set up using the triggers collection on the Session object to monitor an areaof the screen until the text within it changes. These triggers will then send an event when the triggercondition is met. For more information, see Triggers.
Example
' Declare objects with events to hold the triggersDim WithEvents Trigger1 As TriggerDim WithEvents Trigger2 As Trigger...' Add the triggers, the first for any change in an area of thescreen' the second to look for the word wIntegrate at a specificlocationSet Trigger1 = wIntSession.Triggers.Add("", wTriggerTypeAny, 5,5, 20, 7)Set Trigger2 = wIntSession.Triggers.Add("wIntegrate",wTriggerTypeText, 5, 8, 14, 8)...' Process the event from trigger1Private Sub Trigger1_Change()EventsReceived.AddItem ("Trigger 1 has been activated")EventsReceived.ListIndex = EventsReceived.ListCount - 1End Sub...' Finally release the triggers when no longer requiredSet Trigger1 = Nothing
Chapter 7: Accessing the object model
98
Set Trigger2 = Nothing
Sending data to the host
Data can be sent to the host using the Send method of the object model. This method has an optionalparameter that specifies whether a carriage return (ASCII 13) character is appended to the text.
Example
' Send a ECL command to list the ORDERS file to the sessionwIntSession.Send "LIST WIN.ORDER CUSTOMER", wSendOptionsAppendCr' Send my user name to the login promptwIntSession.Send "Homer", wSendOptionsAppendCr
Retrieving and recording data sent from the host
Data can be recorded as it comes up from the host by using the Capture method of the Sessionobject. This returns a Capture object, which can then be used to get the data recorded and to stopthe recording. A Capture object generates an event whenever its buffer becomes full. The captureddata can be recorded to memory, a file or to the printer.
Example
' Create a capture of raw data from the host to memory' using a 1K bufferSet Capture1 = wIntSession.Capture(wCaptureTargetMemory,wCaptureFormatRawIn, wCaptureOptionsNone, 1024)...' After a suitable interval or some specific event' turn off the capture, get the text and release itCapture1.StopMsgBox Capture1.TextSet Capture1 = Nothing
Waiting for a specific piece of data to be received
The DataWatch method on the Session object returns a DataWatch object, which fires a Foundevent whenever the specified text is received from the host.
Example
' Set up an object to do the watchingDim WithEvents Watcher As DataWatch...' Set up a data watch for whenever the text "Buffy" is received' from the host
Waiting for a specific piece of data to be received
99
Set Watcher = wIntSession.DataWatch("Buffy")...' Event triggered whenever the text is receivedPrivate Sub Watcher_Found()' Put the number of times the data has been received into a labellblOccurances.Caption = Str$(Watcher.FoundCount)End Sub...' Release the DataWatch when it is no longer requiredSet Watcher = Nothing
100
Appendix A: Serial controlwIntegrate uses an ActiveX control to communicate with the serial port. This control is not accessibledirectly from the object model, but can be used independently by creating an instance of the control.The main use of this control is to let a wIntegrate session create an instance of the control to allow it tocommunicate with an auxiliary serial port, in addition to its existing connection to the host database.
The serial control is created using its control GUID, wIntegrate.SerialCtrl.2.
* In wIntegrate scriptingObject New SerialCtrl, "wIntegrate.SerialCtrl.2", err
Serial control properties
The serial control properties correspond to the values shown in the Setup > Communications dialogbox for serial controls. The following table describes the serial control properties.
Name Type Description
PortName String The name of the serial port to use: "COMn" where n is the portnumber. For example, COM1, COM2
BaudRate Long The baud rate for the port. Can be 110, 300, 600, 1200, 2400,4800, 9600, 19200, 38400, 57600.
Parity Short The parity. Can be 0 (none), 1 (odd), 2 (even), 3 (mark) or 4(space). Default 0.
DataBits Short The number of data bits. Can be 6, 7 or 8. Default 8.StopBits Short The stop bits. Can be 0 (1 stop bit), 1 (1.5 stop bits) or 2 (2 stop
bits). Default 0.FlowControl Short The flow control to use. Can be 0 (None), 1 (Software) or 2
(Hardware). Default 1.ZeroTopBit Boolean Set to true to clear the top bit of every character received from
the host. Default false.ParityCheck Boolean True to enable parity checking on the communications. Default
false.ReportErrors Boolean True to report any errors that are encountered during
communications. Default false.Delay Short The number of milliseconds to delay between transmitting
blocks of characters to the host. Set to 0 (recommended) todisable this feature. Default 0.
BlockSize Short The maximum number of characters to send to the host in oneblock. Set to 0 (recommended) for no restriction. Default 0
Serial control methods
The following table describes the Serial control methods.
Method Description
void Break() Sends a break signal.boolean IsConnected() Returns true if the port is connected.long Connect() Opens the serial connection. Returns 0 or an error code.long Disconnect() Closes the connection. Returns 0 or an error code.
Serial control
101
Method Description
BSTR GetErrorText(longError)
Returns the text for an error code.
long Write(VARIANT Data,short* Size)
Writes bytes to the port. The Data must be an array of unsigned8-bit characters. Size should be the number of bytes to writefrom the array. The method returns 0 or an error code, and theSize parameter is updated to the actual number of bytes written.
long Read(VARIANT* Data,short* Size)
Reads bytes from the serial port. Data must be an unsignedcharacter array that is allocated with enough bytes for thedata. Size is the number of bytes to read into the array. If Sizeis greater than the size of the array, only the maximum size ofthe array is read. The method returns 0 if the read completed OKor an error code. Size is updated to the actual number of bytesread, which could be zero if there is no data waiting on the serialport.
long Setup() Shows the Setup dialog box.void AboutBox() Shows the About dialog box.
Example
The following example uses the wIntegrate scripting language to demonstrate the serial control. Errorhandling has been omitted.
Object New SerialCtrl, "wIntegrate.SerialCtrl.2", errSerialCtrl.PortName="COM2"* All other parameters are the defaultIf SerialCtrl.Connect() = 0 Then* Connected OKMsg = "hello"Msg_size = Length(Msg)SerialCtrl.Write VarType("ByteArray", Msg), Msg_size* Allocate buffer for readInit_buffer = String("*",32)Result = ""Timecount = 0LoopWhile Length(Result) < 5 And TimeCount < 5Read_buffer = VarType("ByteArray", Init_buffer)Buf_size = 32SerialCtrl.Read Read_buffer, Buf_SizeIf Buf_Size > 0 ThenResult := Left(Read_buffer, Buf_Size)TimeCount = 0Else* Timeout processing if we did not receive anythingTimeCount += 1Wait Delay 25; * Quarter of a secondEndIfRepeat* Should have our result hereSerialCtrl.DisconnectEndIf
102
Appendix B: Windows Sockets controlwIntegrate uses an ActiveX control to communicate with TCP/IP using Windows Sockets. This controlis not accessible directly from the object model, but can be used independently by creating aninstance of the control.
The control is created using its control GUID, wIntegrate.WinSockCtrl.2.
* In wIntegrate scriptingObject New SockCtrl, "wIntegrate.WinSockCtrl.2", err
Sockets control properties
The Sockets control properties correspond to the values shown in the Setup > Communicationsdialog box for Windows Sockets connections. The following table describes the Sockets controlproperties.
Name Type Description
Host String The host name or IP address for the communications.Port Short The port number to connect to. Default 23.Type Short Socket type. 1 (stream) or 2 (datagram). Default 1.Telnet Boolean True to enable Telnet negotiation with the host. Default true.BreakSignal Short Sets the Telnet break signal that is sent when the currently
configured Break key or Ctrl + Break is pressed. Set to 0 forTelnet break, or 1 for Telnet interrupt process. Default 0.
ZeroTopBit Boolean Set to true to clear the top bit of every character received fromthe host. Default false.
TcpNoDelay Boolean Disables the Nagle algorithm. Default false.KeepAlive Boolean TCP/IP keep alive. Default false.BlockSize Short The maximum number of characters to send to the host in one
block. Set to 0 (recommended) for no restriction. Default 0
Socket control methods
The following table describes the Sockets control methods.
Method Description
void Break() Sends a break signal.void StopListening() Stops and closes a listening socket.boolean IsConnected() Returns true if the port is connected.long Connect(shortevents)
Opens the connection. “Events” is the events to raisenotification for 1 (read), 2 (write), 4 (OOB), 8 (Accept), 16(connect), and 32 (close). Returns 0 or an error code.
long Disconnect() Closes the connection. Returns 0 or an error code.BSTR GetErrorText(longError)
Returns the text for an error code.
Windows Sockets control
103
Method Description
long Write(VARIANT Data,short* Size)
Writes bytes to the connection. The data must be an array ofunsigned 8-bit characters. Size should be the number of bytesto write from the array. The method returns 0 or an error code,and the Size parameter is updated to the actual number of byteswritten.
long Read(VARIANT* Data,short* Size)
Reads bytes from the connection. Data must be an unsignedcharacter array that is allocated with enough bytes for thedata. Size is the number of bytes to read into the array. If Sizeis greater than the size of the array, only the maximum size ofthe array is read. The method returns 0 if the read completedOK or an error code. Size is updated to the actual number ofbytes read, which could be zero if there is no data waiting on theconnection.
long ReadFrom(VARIANT*Data, short* Size, BSTR*Address, short* Port)
Reads bytes from the network returning the address and portthe bytes came from for a datagram socket.
long WriteTo(VARIANTData, short* Size, BSTRAddress, short Port)
Sends bytes to the specified address and port for a datagramsocket.
long Listen(shortEvents)
Creates a listening socket. “Events” is the events to raisenotification for 1 (read), 2 (write), 4 (OOB), 8 (Accept), 16(connect), and 32 (close). Returns 0 or an error code.
long Setup() Shows the Setup dialog box.SCODESetTelnetOption(shortOption, VARIANT Value)
Option 0 (Binary) value is boolean. Option 1 (Echo) value isboolean. Option 24 (Terminal type) value is String name ofterminal type.
void AboutBox() Shows the About dialog box.
Example
The following example uses the wIntegrate scripting language to demonstrate the Windows SocketsControls. Error handling has been omitted.
Object New SockCtrl, "wIntegrate.WinSockCtrl.2", errSockCtrl.Host="host name"* All other parameters are the defaultErr = SockCtrl.Connect(0)If Err = 0 Or Err = 10035 Then* Connected OK or the error code was 10035 which* means the connection is in progressMsg = "hello"Msg_size = Length(Msg)SockCtrl.Write VarType("ByteArray", Msg), Msg_size* Allocate buffer for readInit_buffer = String("*",32)Result = ""Timecount = 0LoopWhile Length(Result) < 5 And TimeCount < 5Read_buffer = VarType("ByteArray", Init_buffer)Buf_size = 32SockCtrl.Read Read_buffer, Buf_SizeIf Buf_Size > 0 ThenResult := Left(Read_buffer, Buf_Size)TimeCount = 0
Appendix B: Windows Sockets control
104
Else* Timeout processing if we did not receive anythingTimeCount += 1Wait Delay 25; * Quarter of a secondEndIfRepeat* Should have our result hereSockCtrl.DisconnectEndIfObject Release SockCtrl