Mel,
Creating a global object from inside of a form doesn't give me any warm fuzzy feelings. (for non-Codemine lurkers: it really creates an object that belongs to _SCREEN).
And I don't see how using CreateGlobalObject() can help here...what if you want to open two forms at the same time, with private data sessions? How can the your custom CDE contained within the screen be visible to both forms, and the forms have private datasessions, all at the same time? I digress...and maybe I'm off my rocker here...*grin*
How about adding a property to the form (let's call it oCdeCombos). Be sure your appStartArrays class is not marked to have a private data session.
if dodefault()
thisform.oCdeCombos = createobject("appStartArrays")
endif
thisform.oCdeCombos.release()
dodefault()
Hope these thoughts help, and Gary can clean up my mess.
steve
>I am testing CreateGlobalObject() opening a table as follows:
>
>I have created a CDE titled "AppStartArrays" which has one table, and I am using it as stand-alone (not attached to a form). This table holds items for all ComboBoxes. I would like to make a call to open the table, then will build an array from the table to populate the ComboBox, etc. I stored "AppStartArrays" in the "AppMain" library, and I have "lAutoOpen" set to .T.
>
>Placing the following code in a ComboBox Init():
>
>
>m.oCDE=CreateGlobalObject('appstartarrays')
>BROWSE
>
>Shows that the table is opened, but in a different Data Session (by looking at the Data Session Window).
>
>Whereas:
>
>m.oCDE=CREATEOBJECT('appstartarrays')
>BROWSE
>
>Actually adds the table to the current datasession, and that table is selected.
>
>Using CREATEOBJECT() actually does what I need it to do, but CodeMine 7 OnLIne help suggested using CreateGlobalObject() for global, so that is the purpose of me testing all this here.
>
>I assume this is the normal behavior of CreateGlobalObject() and if so is there an easy way to have it open the table found in the "AppStartArrays?" within the current Data Session?
>
>Mel Cummings
Steve Gibson