Hi Bernard,
Well, you were right. My original code:
SELECT (THISFORM.DataEnvironment.InitialSelectedAlias)
of course no longer works, because the DE is now a new property (Object) of the form. In runtime, I placed a suspend and opened the trace window. I couldn't find it in the locals window, but, I did put THISFORM in the watch window.
Under the DE**** properties, was a new property object "de_branch" - which is the name of the DE Class I am using. So, all I have to do is change my code a little bit:
LOCAL loc_objDataEnvironment
DO CASE
CASE !EMPTY(ALLTRIM(THISFORM.DEClass))
loc_objDataEnvironment = EVALUATE('THISFORM.' + ALLTRIM(THISFORM.DEClass))
SELECT (loc_objDataEnvironment.InitialSelectedAlias)
OTHERWISE
SELECT (THISFORM.DataEnvironment.InitialSelectedAlias)
ENDCASE
Now, no matter what, I can reference the form default alias.
Ric
>Hi Rick
>
>What do you mean "Cannot find the DE". It's there, just not in Intellisense. If you open a "Locals Window " and drill down you will see it in all its glory :) with all its properties.
>
>I too was stumped - for a while.
>
>Just remember that with the new DE you will need to set this property manually, after all it is a property. Then you can use the statement as shown in your message.
>
>Go ahead. Be brave and do it.
>
>I too am in the process of "CursorAdapting" my app. For non updatable tables used for lookups, I use a custom generic class and just change the properties to do what I want. For Editing tables, especially WIDE ones, I use Mark's class builder.
>
>Cheers.
>
>Bernard
>
>>Hi all...
>>
>>Well the learning curve has been steep. I have a small VFP7 app which I am now converting to VFP8. I am starting to use the DEClass.
>>
>>In my old app there were several references in form codes to insure the form was always reverting back to the main table of a form. Generally it is a simple line:
>>
>>
SELECT (THISFORM.DataEnvironment.InitialSelectedAlias)
>>
>>With the new DEClass, this line is renedered useless. Looking at a form object, I cannot find any reference to the object 'DataEnvironment', so how do I reference the initialselectedalias in a form using a DEClass?
>>
>>TIA
>>
>>Ric