Thanks Rony.  Further exchanges with Erich on the ooRexx Help discussion have 
also given me the information I need to access the autECLFieldList results.  
There is a function "FieldInfo" that takes an integer argument to retrieve that 
member of the FieldList object array, from which you can use/extract the field 
information.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Rony G. Flatscher
Sent: Saturday, July 1, 2023 8:37 AM
To: [email protected]
Subject: EHLLAPI and connInfo (Re: OLE and ooRexx (Re: Using EHLLAPI from ooRexx

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://urldefense.com/v3/__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__;Lysvfn5-fn4vfn4rfn5-fn4!!Ebr-cpPeAnfNniQ8HSAI-g_K5b7VKg!Ij0j42J-1qh3hYKX9M4fDVAc9i98bnZ4RTPfF2azi-je9bnxUdkzCYyhnL2E4nHJYxA_-BdOWj29aDarkQvFX5U8Viwd9JHP$
 >. 


(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://urldefense.com/v3/__https://sourceforge.net/p/oorexx/code-0/HEAD/tree/sandbox/rony/oleinfo/__;!!Ebr-cpPeAnfNniQ8HSAI-g_K5b7VKg!Ij0j42J-1qh3hYKX9M4fDVAc9i98bnZ4RTPfF2azi-je9bnxUdkzCYyhnL2E4nHJYxA_-BdOWj29aDarkQvFX5U8Vhl7M8KQ$
>  > 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
--

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to