Hi Dave,
What you have suggested is correct in that you cannot just run the code from Export Code "as is" because it is a class definition. But there are times when there are many layers of containership and the code fails. I just did the following and running the code (with the create foo) fails on one of the ADD OBJECT statements. Dont ask me why I added these things, I was just creating multiple layers of containership.
Create a form
Add a pageframe
Set the pagecount to 4
on page 2 of the pageframe add a checkbox and a spinner
on page 3 of the pageframe add a container
To that container add 2 checkboxes
Save the form
Pull up the form in the browser
Export code
Put the following at the top of the program
PUBLIC x
x=create("form1")
x.show()
Then run the program: you will get a syntax error on the following line:
ADD OBJECT form1.pageframe1.page2.command1 AS commandbutton WITH ;
Top = 44, ;
Left = 119, ;
Height = 27, ;
Width = 84, ;
Caption = "Command1", ;
Name = "Command1"
This problem is not new to the Class Browser, it has been there from the beginning.
I am not saying that Export Code is useless: far from it. I use it quite often.
Rick
>They can be run, but you have to add:
>
>
>PUBLIC ox
>ox = CREAT([foo])
>ox.SHOW
Dave
>
>>>>The class browser allows you to "View Code" but this code can be unreliable, particularly when containership is involved.
>>>
>>>Really? I know when I have say command buttons on a form class, the add object stuff isn't runable (like you said), but when else?
>>
>>Hi Mike,
>>
>>I havent gone much farther than dealing with the fact that composites cant be run.
>>
>>Rick