Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CreateGlobalObject()
Message
From
20/06/2002 04:08:42
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00670322
Message ID:
00670499
Views:
36
Mel:

The native createobject() will scope its resultant object to the datasession from which the call was made. Codemine's CreateGlobalObject() is scoped to the default datasession (1). Hence the difference in the behaviour.

For some thoughts on a resolve, you could add a aSQLComboResult array property, a cSQLWhere property and a SQLExecute method to your CDE. Your lookup data is nicely encapsulated in the AppStartArrays CDE. When you want an array of values for your combo, set the AppStartArrays.cSQLWhere value with the where string to match your query requirement, execute the AppStartArrays.SQLExecute method which will use the AppStartArrays.cSQLWhere property is its query argument and its result array can be contained in AppStartArrays.aSQLComboResult .

From your form (or wherever) :-
local oArry
m.oArry = CreateGlobalObject("AppStartArrays")
m.oArry.cSQLWhere = 'some value string'
m.oArry.SQLExecute() && If you use VFP7, maybe you could directly return the resultant array from this method.
Acopy(m.oArry.aSQLComboResult, aLocalComboArray)
Another thought is that you could also store your SQL string(s) in another table in your AppStartArrays CDE. Then you would have data driven queries, and all you would need to do when your call m.oArry.SQLExecute() is pass is an index/key of the query to run.

HTH
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform