Page 1 of 1

PCOMM Macro error on SearchText

PostPosted: Tue Nov 25, 2014 3:12 pm
by tsdjim
I have written a PCOMM macro to search text on a screen, however I am getting the following error on the searchtext line and I cannot figure out why. :

Error on line 19. Expected ')'

Line 19 contains If ( autECLSession.autECLPSObj.SearchText "ECOC", 1, row, col ) Then


Following is the complete macro:

Dim autECLPSObj as Object
Dim autECLConnList as Object
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)

subSub1_

sub subSub1_()

Dim x
row=1
col=1
For x = 1 To 5
autECLSession.autECLPS.SendKeys "[sysreq]"
If ( autECLSession.autECLPSObj.SearchText "ECOC", 1, row, col ) Then
Exit For
End If

Next
End Sub

Re: PCOMM Macro error on SearchText

PostPosted: Tue Nov 25, 2014 4:36 pm
by NicC
Don't have PCOMM and don't have 'access' to the manual...but...all your other methods seem to have arguments within parentheses e.g. object.method(parms) but you don't have for this particular statement. If you should then you are actually missing ( and ).

Re: PCOMM Macro error on SearchText

PostPosted: Tue Nov 25, 2014 6:00 pm
by tsdjim
I have tried the following combinations which all give one error or the other on the same line. The last syntax is as per the IBM manual:


If ( autECLSession.autECLPSObj.SearchText("ECOC", 1, row, col )) Then

If ( autECLSession.autECLPSObj.SearchText("ECOC")) Then

the following syntax was from the IBM manual even this gives an error:
http://www-01.ibm.com/support/knowledge ... cess08.htm

If ( autECLSession.autECLPSObj.SearchText "ECOC",1 ,1, 1) Then

Re: PCOMM Macro error on SearchText

PostPosted: Tue Nov 25, 2014 9:58 pm
by NicC
That is not what is in the manual. The manual has
If ( autECLPSObj.SearchText "IBM", 1, row, col) Then

What you have may well be the same thing in effect but I do not know.
Note also that there are typos within the document but the one documented is not related to you (as far as I know).

Re: PCOMM Macro error on SearchText

PostPosted: Wed Dec 03, 2014 9:27 pm
by tsdjim
I finally got it to work with the following syntax, I guess the row column would also work.
The IBM manual has an example without the brackets after searchText, I guess this was an error in the manual.

Working syntax:
if (autECLPSObj.SearchText ("ECOC")) Then


Thanks NicC for pointing me to the correct syntax.