Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting a VB array
Message
 
 
To
30/07/2004 11:51:46
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00929646
Message ID:
00929783
Views:
8
Tom,

See if COMARRAY() function could help.

>I am trying to convert some VB examples using SAS to VFP using SAS. The example I am using can be found at http://support.sas.com/rnd/itech/doc/dist-obj/winclnt/winvbpro.html under Passing Arrays in IOM Method Calls.
>
>
> Dim obWSMgr As New SASWorkspaceManager.WorkspaceManager
> Dim obWS As SAS.Workspace
> Dim errString As String
> Set obWS = obWSMgr.Workspaces.CreateWorkspaceByServer("My workspace", VisibilityNone, Nothing, "", "", errString)
>
> Dim obDS as SAS.DataService
> Dim vName as variant
> ' Declare a dynamic array of strings to hold libnames
> Dim arLibnames() as string
> Set obDS = obWS.DataService
> ' pass the dynamic array variable to "ListLibrefs". Upon return,
> ' the array variable will be filled in with an array of strings
> ' one element for each libref in the workspace
> obDS.ListLibrefs arLibnames
> ' Print each name in the returned array
>  For Each vName in arLibnames
>    debug.print vName
>  Next vName
>  ' Print the size of the array
>   debug.print "Number of librefs was: " & Ubound(arLibnames)+1
>   ObWS.Close
>
>
>Here is my VFP attempt to do the same
>
>
>
>  *All the above code works in VFP including the oLibRef =   ;
>    oSAS.DataService.AssignLibref("unixlib","","/mktg01/usg774a","") assignment.
>
>  DIMENSION arlibnames[1] AS String
>  arlibnames = "x"
>
>  oSAS.DataService.ListLibrefs( @arLibnames )
>  For lni = 1 TO ALEN( arlibnames,1)
>    ? arlibnames[lni]
>  Next
>
>
>I am getting 'x' back as the value of arlibnames array. Any suggestions? I tried passing the array by value and with a dimension of 10.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform