On 01.07.2023 14:17, Rony G. Flatscher wrote:
Sorry, my bad. "autECLConnList" is probably an array so you may want to try either "str =
autoECLConnList[1]~name" or "str = autoECLConnLista~t(1)~name" instead.
Ah, just saw in the ooRexx support list that Erich was able to introspect it (so he probably has
EHLLAPI installed on his machine). This is what he writes:
str = connList(1)~Name
connList(1) is not a method invocation, but a simple function call - but we
have no function called "connList".
From the docs you'd think that connList[1] should work, but it doesn't (not
sure why the docs show it like this).
To figure out what is actually implemented, use the samples\ole\methinfo
sample with input "PCOMM.autECLConnList"
Among others, it will list
VT_DISPATCH ConnInfo([in] VT_VARIANT Index)
Given a numeric index, returns one of the items in the collection.
So this code works:
~~~
do c = 1 to connList~count
conn = connList~connInfo(c)
say conn~name conn~connType conn~codepage conn~started conn~ready
end
~~~
so to translate this to the variables names the IBM docs and the ooRexx
transcription uses:
~~~
autoECLConnList = .OleObject~new("PCOMM.autECLConnList")
autoECLConnList~Refresh
str = autECLConnList~connInfo(1)~Name
~~~
("connInfo" is probably a default property such that VBA would refer to it.)
Also an interesting link (just found it searching for "connInfo" in addition) in this context may
be:
<https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/Samples~from~Users+IBM~Personal~Communications~Connect~Via~COM.txt>.
(If transcribing VBA code to ooRexx usually replacing the dot (.) in statements with a tilde (~)
would be enough already to make it run under ooRexx.)
---rony
( VBA/OLE arrays may use indexes from 0 up to size-1, but could also - and sometimes do -
arbitrarily define the lower bound index and the upper bound index).
---
If you want to use the OLE interface from ooRexx then the documentation "Windows Extensions
Reference" in "winextensions.pdf" in "Chapter 8. OLE Automation" will be helpful.
---
Also the tools of "OLEInfo" may be helpful (even for other languages than
ooRexx using OLE) :
* listProgIds.rex ... lists all OLE/COM ProgIds, one can optionally filter the
(overwhelming)
output to contain supplied string chunks (it is always interesting to see
what your Windows
machine has installed)
* createOleInfo.rex ... queries and documents the published attributes,
methods/functions,
constants and events of OLE Windows programs in a verbose (includes
published constants) or in a
terse form (the latter is meant to serve as a sort of reference that one can
put next to the
keyboard); the generated documentation is HTML with a CSS for formatting and
includes the
arguments, their published names and types
* getOleConstants.rex ... creates an ooRexx package (program) that makes all
published constants
available to Rexx programs via the environment symbol ".ole.const"
E.g., if you ever wanted to see all published Excel methods, events, attributes in a terse
(reference) form then you could issue:
createOleInfo.rex Excel.Application 1
and maybe in your case you could try e.g.:
createOleInfo.rex PCOMM.autECLConnList
You can get OLEInfo from my sandbox at
<https://sourceforge.net/p/oorexx/code-0/HEAD/tree/sandbox/rony/oleinfo/> where the readme.txt
file gets displayed such that you can study at a little bit more detail. To download it you could
press the button at the right hand corner of the line named "Tree [r12695]/..." labeled "Download
Snapshot" which creates a zip-archive of that part of the source code tree that then can be
downloaded.
HTH,
---rony
On 30.06.2023 17:13, Farley, Peter wrote:
No luck I am afraid:
5 *-* str = autECLConnList(1)~Name
Error 43 running C:\Users\myname\Documents\testdir\testhacl.rex line 5:
Routine not found.
Error 43.1: Could not find routine "AUTECLCONNLIST".
-----Original Message-----
From: IBM Mainframe Discussion List<IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of
Rony G. Flatscher
Sent: Friday, June 30, 2023 3:46 AM
To:IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Using EHLLAPI from ooRexx
Just noted that the mailer ruined the syntax:
autoECLConnList = .OleObject~new("PCOMM.autECLConnList")
autoECLConnList~Refresh
str = autECLConnList(1)~Name
---rony
On 30.06.2023 09:22, Rony G. Flatscher wrote:
On 30.06.2023 08:46, Farley, Peter wrote:
Thanks for the link David, but that seems to be tied intimately to
x3270, and I need it to work with PCOMM.
Also investigating PCOMM HACL (Host Access Class Library) as an
alternative, using VBScript (<*Sigh*>, yet another language to learn).
Judging from
<https://urldefense.com/v3/__https://www.ibm.com/docs/en/personal-comm
unications/15.0?topic=SSEQ5Y_15.0.0*com.ibm.pcomm.doc*books*html*host_access08.html__;Ly8vLw!!Ebr-cpPeAnfNniQ8HSAI-g_K5b7VKg!OHS9_k-XSvFBFZyLGLsofx1K3_bpc7Pb70Zhae2AclS3_irQqT4UewjjkGikadAo6rgTf_y3zKD0tgb45uP95EcVnD0QEVU4$
> there are OLE APIs which should allow you to use the Windows version of ooRexx as it supports
OLE.
That is the reason why you can code in ooRexx for MS Excel, MS Word,
MS Powerpoint and the like, just look up the ooRexx samples in
"ooRexx\samples\ole\apps" where you would see also samples for
OpenOffice/LibreOffice via OLE.
So looking at the VBA example:
|Dim Str as String Dim autECLConnList as Object Dim Num as Long Set
autECLConnList =
CreateObject("PCOMM.autECLConnList") autECLConnList.Refresh Str =
autECLConnList(1).Name|
try the following in ooRexx:
autoECLConnList = .OleObject~new(|PCOMM.autECLConnList")|
autoECLConnList~Refresh
str = autECLConnList(1)~Name
Does that work for you?
---rony
-----Original Message-----
From: IBM Mainframe Discussion List<IBM-MAIN@LISTSERV.UA.EDU> On
Behalf Of David Crayford
Sent: Thursday, June 29, 2023 11:48 PMTo:IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Using EHLLAPI from ooRexx
It may be easier to
usehttps://urldefense.com/v3/__https://github.com/py3270/py3270__;!!E
br-cpPeAnfNniQ8HSAI-g_K5b7VKg!LslIz3RHy9Ct1CC2dStYVdn9sNVor2JieWkv62q
KTHeNjTV8BP_GG59tue0S-FF-h_YqPRXXtxsO4U4NUCOrg08$
On 29 Jun 2023, at 10:56 pm, Farley, Peter<0000031df298a9da-dmarc-requ...@listserv.ua.edu>
wrote:
Hi All,
I have sent this question to the ooRexx help list but have not yet
seen an answer. Hoping someone here has been down this path and can help cure
my ignorance.
I have an automation task before me that needs some complex 3270
screen interactions, so I was hoping to use ooRexx from the company laptop (Windows 10) using
the EHLLAPI interface to PCOMM.
I started with a simple logon script to learn the connection/setup
requirements, and after (I
thought) successfully executing rxfuncadd for the EHLLAPI interface,
the first actual call to EHLLAPI (for the Connect function) gets
oorexx error 43.1, cannot find routine EHLLAPI, indicating to me that the rxfuncadd did not
really work.
Then it occurred to me to ask how does rxfuncadd know where to find
the EHLLAPI DLL? Is there some environment variable that needs to
be set pointing to the PCOMM directory where the DLL is stored?
There is some old Rexx EHLLAPI interface material in the PCOMM V6
documentation available on the web, but I now have PCOMM V14 on my
machine and it seems that the Rexx examples have disappeared from the V14 documentation (at
least I didn't find any).
I am a little "lost at sea" here, so I would appreciate any help or
RTFM you can provide. Or better yet a publicly available set of example scripts for EHLLAPI
interactions with PCOMM.
Peter
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN