Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing JavaScript Array Object to VFP COM
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00659390
Message ID:
00659877
Views:
63
This message has been marked as the solution to the initial question of the thread.
Hi!

In addition to what Albert Ballinger said, because you propbably could not debug COM object when it is called from the Java Script, better use aMembers() function. In VFP, it place into array all properties and methods of the object. This way you will find if array's data passed as part of the object at all, and also how to access array elements.

Just for information:
Java Script array is an object with property "length" and custom properties with names "0", "1", "2", "3" and so on. It might be possible that VFP will not be able to access "1" property of the object, so you will require to find some otehr way to pass data itno VFP. For example, in Java Script, you can add property to object just by assigning value to it:

// This is a Java Script code
var rr = new Object;
rr.p1 = "Value1"

Probably VFP will be able to read values from the object's properties.

Hope this helps.


>Hi Kids,
>
>I'm trying to pass an array object from a JavaScript function to a VFP7 COM object. My testing has shown that the object is being accepted as a parameter (it shows up as VARTYPE "O"). I can also get its length property from within the COM object (but nothing else). When I try to refer to the object/array's subscript I get an error message saying that the object is not an array.
>
>I guess I could just pass a string to my COM object and parse it out but I feel that using an array to pass parameters is much more elegant.
>
>Got any ideas for me?
>
>Hugh
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform