main logo
Subject: RE: Help translate VB to VFP: Dim args()
Author: "Wilson Kierstead"
Posted: 2002/12/31 11:10:00
 
View Entire Thread
New Search


Thanks Anders,

I didn't know that!

Wilson

-----Original Message-----
From: profox-admin .at. leafe .D.O.T com [mailto:profox-admin@leafe.com]On Behalf Of
Anders Altberg
Sent: Tuesday, December 31, 2002 8:14 AM
To: profox .at. leafe .D.O.T com
Subject: Re: Help translate VB to VFP: Dim args()


Hi Wilson
VFP supports zero-based arrays for COM objects with the COMARRAY function.
-Anders

----- Original Message -----
From: "Wilson Kierstead" <wil@vfpbizapps.com>
To: <profox .at. leafe .D.O.T com>
Sent: Tuesday, December 31, 2002 1:25 AM
Subject: RE: Help translate VB to VFP: Dim args()


> Hi Ted,
>
> I think you are going to have problems because VFP does not support zero
> length arrays. I think the closest you can get is with something like:
> LOCAL myarray[1] as variant. This is the same as just LOCAL myarray[1].
> Just don't initialize myarray so it retains its variant/logical typing.
>
> I know that LOCAL myarray[0] as variant will give you an Invalid subscript
> reference.
>
> Wilson Kierstead
>
>
> -----Original Message-----
> From: profox-admin@leafe.com [mailto:profox-admin .at. leafe .D.O.T com]On Behalf Of
> wdurban@datascantech.com
> Sent: Monday, December 30, 2002 6:35 PM
> To: profox .at. leafe .D.O.T com
> Subject: RE: Help translate VB to VFP: Dim args()
>
>
>
> Ted,
>
> Sorry, I was kinda kidding. I knew you knew better...
>
> That statement in VB creates a zero-length "dynamic array" of type
Variant.
> I don't know how to simulate that in Fox.
>
> Is it possible you can find out what type the 4th parameter is and
> initialize the VFP array to that type value? It may be expecting an
> object...
>
> Hope this helps,
> Bo Durban
>
>
>
>
>
> Yes, Bo, I did. Sorry I forgot to mention that. I added an '@' to the args
> argument. Still got the same error, unless I changed args to a local
scalar
> (non-array). Then I got the message: OLE Error code 0x8002008: Bad
variable
> type.
>
> -----Original Message-----
> From: profox-admin .at. leafe .D.O.T com [mailto:profox-admin@leafe.com]On Behalf Of
> wdurban .at. datascantech .D.O.T com
> Sent: Monday, 30 December, 2002 17:17
> To: profox@leafe.com
> Subject: Re: Help translate VB to VFP: Dim args()
>
>
>
>
> Ted,
>
> Did you try passing the array by reference?
>
> Bo Durban
>
>
>
>
>
>
> I'm trying to convert some sample code from VB into VFP, and there's a
> routine than DIMs an array and then passes it to a function:
>
> Dim args()
> Set objDocument=
objDesktop.loadComponentFromURL("private:factory/swriter",
> "_blank", 0, args)
>
> Can anyone tell me how the args array should be declared in VFP so I don't
> get an "OLE Error 0x80020005: Type mismatch?" I've declared it as LOCAL
> args(1) to (10) and tried the variations of
>
> COMARRAY(objDesktop, 1111) && and 0100 and 0010 and 0001 and 1111 and ...
>
> and I've tried initializing the args array to NULL, zero, and a blank
> string.
>
> Any other ideas? Or have I got the DIM function all wrong?
>
>
>
>
>
>
> [excessive quoting removed by server]
>
[excessive quoting removed by server]

[excessive quoting removed by server]



 
©2002 Wilson Kierstead
<-- Prior Message New Search Next Message -->