Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Documentation about the attachmate functions and methods

Status
Not open for further replies.

mallerep

Programmer
Apr 21, 2010
2
FR
Hi all,

I'm developper in france.
I develop VBA macros to pilot Attachmate Myextra.

I despair to find any documentation about the funtions and methods that communicate with Myextra like:

Screen.waitforstring() => what are the arguments ?
or
What means the different values of OIA.Status
or
What means the different values of OIA.errorstatus
or
Screen.getstring

Could anybody help me ?

Thanks a lot
 



Extra!HELP said:
WaitForString Method
<Related Topics> <Example>

Applies To Objects

Screen

Description

Waits until the specified text appears on the screen. The Screen object will wait for the amount of time set in System.TimeoutValue.

Syntax

rc = object.WaitForString (Text [,Row [,Col [,Page]]])

-or-

object.WaitForString String [,Row [,Col [,Page]]]

Element Description
rc The return value.
object The Screen object.
String The text string that you want the Screen object to wait for.
Row The row where you expect the string to appear.
Col The column where you expect the string to appear.
Page VT session only -- the screen page.Note: This parameter is ignored for release 6.0 of EXTRA!o.
Return Value Description
TRUE The Screen object has received the text string in the specified location within the time specified by System.TimeoutValue.
FALSE The Screen object has not received the text string in the specified location within the time specified by System.TimeoutValue.
Comments

If you don't specify a screen location (row, column, or page), WaitForString can receive the text string in any location to be successful.

Copyright 1996 - 1999, Attachmate Corporation. All rights reserved.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 


Out of curiosity, where are you putting the results and where is your source criteria, if any? Many users drive their screen scrapes from Excel lists and put their results in Excel. If so, I would strongly recommend writing your scrape application IN EXCEL VBA. For me, at least, it is much easier to write in Excel VBA and access the Attachmate!Extra objects than the other way around. But that shows my prejudice.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi.
Thanks for the quote of MyExtra Help. But i Can't find those informations on "help" of my Myextra. What is the path you use to find it in myextra ? Or do you have any document ?

I'm very interested in the exact description of OIA.Xstatus.

To answer your question: I write in Excel VBA, everything is driven from here. Don't worry !

Thanks again
 


Do you have Tools > References set, in the Excel VB Editor, for the Attachmate Extra! n.m Object Library, which is in C:\Program Files\E!PC\extra.tlb.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
OIA Description OIA Value
xNO_STATUS 0
xINVALID_NUM 1
xNUM_ONLY 2
xPROTECTED_FIELD 3
xPAST_EOF 4
xBUSY 5
xINVALID_FUNC 6
xUNAUTHORIZED_PRINTER 7
xSYSTEM 8
xINVALID_CHAR 9

Property Xstatus As Integer
Member of EXTRA.ExtraOIA
Returns the status of the XCLOCK

In summary, it allows you to check the status of the session against some constants. I dont have a functional example of this in code but when I do I will post. As I hear and have experienced today, the WaitHostQuiet function is kinda messy so im replacing it in all my macros with the xStatus checks :)
 
Place this statement at the very top of the code
Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

then declare your object
Code:
Dim MyOIA As Object

Below is How i declare my sessions and set MyOIA
Code:
    Set System = CreateObject("EXTRA.System")
        If (System Is Nothing) Then
            MsgBox "Could not create the EXTRA System object. Stopping Macro Playback."
            Stop
        End If
    Set Sessions = System.Sessions
        If (Sessions Is Nothing) Then
            MsgBox "Could not create the Sessions collection object.  Stopping macro playback."
            Stop
        End If
        If (g_HostSettleTime > System.TimeoutValue) Then
            System.TimeoutValue = g_HostSettleTime
        End If
    'userSess is the name of the User Specified Session
    Set Sess0 = System.Sessions(userSess)
        If (Sess0 Is Nothing) Then
            MsgBox "Could not create the Session object.  Stopping macro playback."
            Stop
        End If
        If Not Sess0.Visible Then Sess0.Visible = True
        Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
    
        Set MyOIA = Sess0.Screen.OIA

How I call My_WaitHostQuiet instead of the default extra WaitHost
Code:
            If My_WaitHostQuiet(MyOIA) = True Then
                tpxScreenTest = Sess0.Screen.Area(1, 25, 1, 27).Value
            Else
                MsgBox ("Could not move to the next screen :( ")
            Exit Sub
            End If

The function that performs the 'waiting'
Code:
Public Function My_WaitHostQuiet(ByVal MyOIA As Object) As Boolean
    Dim nClockStatus As Integer
        Sleep (50)
        nClockStatus = 1
        nClockStatus = MyOIA.XStatus
        
        Do While (nClockStatus <> 0)
            Sleep (50)
            nClockStatus = MyOIA.XStatus
        Loop
        
       	My_WaitHostQuiet = True
        
End Function

hope this is helpful to all who need it

 



The way that I have solved the asynchronous issue is to Move the cursor away from the screen's return coordinates, Send the key, loop until WaitForCursor at the screen's return coordinates.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
As always, there is more than one way to do the same thing
guess it just depends on how you want to build it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top