Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select doesn't produce an array
Message
From
31/10/2008 19:25:16
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01358484
Message ID:
01358821
Views:
12
Thanks to all who responded to this.

>Returning arrays make sense in class methods only because array has to exist at the point where returned array is assigned to another array.
>
>oDI = CREATEOBJECT("DbcInfo")
>
>dbc2Convert = "C:\Program Files\Microsoft Visual FoxPro 9\Samples\Northwind\northwind.dbc"
>
>aTables = oDI.GetDBCTableNames(dbc2Convert)
>for i = 1 to alen(aTables)
>	? aTables(i)
>next
>RETURN 
>
>DEFINE CLASS DbcInfo AS Custom
>	DIMENSION laTables[1]
>	function GetDBCTableNames()
>		lparameters myDBC
>		select objectname as tablename ;
>			from (myDBC) ;
>			where objecttype = "Table" ;
>			into array This.laTables
>		return @This.laTables
>ENDDEFINE
>
>>Given the below:
>>
>>dbc2Convert = "\\tpdfiles\data\dfreeman\tip\data\rta\rta.dbc"
>>aTables = GetDBCTableNames(dbc2Convert)
>>for i = 1 to alen(aTables)
>>? aTables(i)
>>next
>>
>>**************************************************************************
>>function GetDBCTableNames()
>>lparameters myDBC
>>select objectname as tablename ;
>>from (myDBC) ;
>>where objecttype = "Table" ;
>>into array A1
>>return A1
>>
>>Why do I get an error that says A1 is not an array? The select produces 6 records.
>>
>>Thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform