Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ARRAY() command in Visual Basic
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00518091
Message ID:
00518320
Views:
10
>>>>I am converting a Visual Basic routine to VFP. I need to send four parameters to an object oriented application. The Visual Basic routine uses the ARRAY() command like this:
>>>>
>>>>myParams=ARRAY("0p0","0p0","18p0","18p0")
>>>>myTFrame.GeometricBounds=myParams
>>>>
>>>>When I use the DIMENSION command to create a 1 dimension array, and then populate the array with the values given above, the application chokes. Is there a way in VFP to mimic the ARRAY() command in VB?
>>>>
>>>>Thanks in advance...
>>>>
>>>>John Dennis
>>>
>>>John,
>>>Unfortunately, no. The ARRAY() function creates a SAFEARRAY. For a defintion of what a SAFEARRAY is, check out this MSDN topic. http://msdn.microsoft.com/library/psdk/automat/chap7_9ntx.htm
>>>
>>>IAC, VFP does not create SAFEARRAYs so you can not assign a VFP array to something that is supposed to be an array property and have it work. If there was a method that took an array as a parameter, it would work because the array would be converted to a SAFEARRAY going through the COM barrier. But that doesn't look like the case here.
>>
>>>
>>>AFAIK, unless there is another interface to this property (e.g. method to set it), you won't be able to use this property with VFP.
>>
>>Larry,
>>
>>Will Ed's Constructor for SafeArrays work?
>
>Hi George,
>I think I tried something like this and it didn't work. I used SafeArrayCreateVector, got a valid pointer to it, pupulated it and tried to assign the ADSI IADsContainer Filter property with no joy.
>
>Maybe it was a problem with ADSI so this technique may work in this case.

The only other thought I had on this (and probably a very stupid one at that< g >), was that there's a Set event occurring when the assignment statement is executing. You know, analogous to our _Assign event. If so, maybe COMARRAY() might be of some help.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform