How to receive a parameter of the array type from ActiveX?

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Yukiko Ikeo
Posts: 7
Joined: Fri Jun 09, 2017 11:58 pm

How to receive a parameter of the array type from ActiveX?

Post by Yukiko Ikeo » Fri Jul 28, 2017 5:53 pm

Hi All,

The customer wants to receive a parameter of the array type from ActiveX.
How to code it?
Does anyone have experience to do that?

Best regards, Yukiko Ikeo

HamadSheikh
Posts: 27
Joined: Fri Mar 18, 2016 3:49 am
Location: USA
Contact:

Re: How to receive a parameter of the array type from ActiveX?

Post by HamadSheikh » Tue Aug 01, 2017 4:07 am

Just so this doesn't get lost in translation, can you elaborate on what the array looks like in this case i.e. how many elements, what is the data type etc.

Yukiko Ikeo
Posts: 7
Joined: Fri Jun 09, 2017 11:58 pm

Re: How to receive a parameter of the array type from ActiveX?

Post by Yukiko Ikeo » Wed Aug 02, 2017 5:53 pm

Hi Hamad,

Thank you for your reply.
The array looks like as below.
“351,1101”
“352,1102”

- elements are 2
- the data type is String

The customer coded as below.
However #WkConnections displays blank value.

**************
Evtroutine Handling(#AVAYA.OnTransferred) TransferredConnections(#Connections)
*
DEFINE_COM CLASS(#PRIM_VAR) NAME(#WkConnections)
SET COM(#WkConnections) VALUE(#Connections)

*
Use Message_box_clear
Use Message_box_add (#WkConnections)
Use Message_box_show
*
Endroutine
**************

Regards, Yukiko Ikeo
Attachments
image.png
image.png (75.87 KiB) Viewed 1406 times

dannyoorburg
Posts: 156
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

Re: How to receive a parameter of the array type from ActiveX?

Post by dannyoorburg » Tue Aug 08, 2017 1:34 pm

Hi Yukiko,

What I'd suggest is that you have a look at how LANSA created the event definition. (Right click the Event Name and select Features.)

The "TransferredConnections" parameter will be of a particular type (#MYACTIVEX.SomeType) and this type must be some sort of Collection.

I'm pretty confident that you iterate over that collection using the For Each() construct.

Alternatively you can use properties like ItemCount and Item<1> etc to access the individual items.

Goodluck,
Danny

PS: your code snippet just casts the collection to a VARIANT, fooling the compiler in letting you use it as a string in the Message Box logic. But it won't magically turn the object into a string at runtime, that's why your message box is empty.

Post Reply