Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toolbar Compilation Error

Status
Not open for further replies.

TrueCode

MIS
Sep 30, 2003
71
LC
I have been trying to make impressive toolbars with Pageframes and containers inside pages and containers inside containers. They all seem to work well when run in Development Mode but when I try to Compile the Classes containing them I get 'Syntax error'. It appears that VFP 9.0 can't compile containers inside containers. If I just place ONE container in the toolbar it compiles okay, things seem to be going elsewhere when I place a container inside another. Try to compile the following and you will see the error.

Code:
**************************************************
*-- ParentClass:  toolbar
*-- BaseClass:    toolbar
*-- Time Stamp:   08/11/15 07:35:08 AM
*
DEFINE CLASS bartool AS toolbar
	Caption = "Toolbar1"
	Height = 79
	Left = -1
	Top = -5
	Width = 859
	Name = "bartool"
	ADD OBJECT pframe AS pageframe WITH ;
		ErasePage = .T., ;
		PageCount = 2, ;
		TabStyle = 1, ;
		Top = 3, ;
		Left = 5, ;
		Width = 849, ;
		Height = 73, ;
		TabOrientation = 2, ;
		Name = "pframe", ;
		Page1.Caption = "T1", ;
		Page1.Name = "Page1", ;
		Page2.Caption = "T2", ;
		Page2.Name = "Page2"
	ADD OBJECT bartool.pframe.page1.container1 AS container WITH ;
		Top = 19, ;
		Left = 90, ;
		Width = 62, ;
		Height = 31, ;
		Name = "Container1"
ENDDEFINE
*
*-- EndDefine: bartool
**************************************************

------------------------------------->

"I have sought your assistance on this matter because I have exhausted all the help that I can find. You are free to direct me to other source of help"
 
Just from looking at the viewsource the pageframe is added to bartool via ADD OBJECT pframe, not ADD OBJECT bartool.pframe but the container is added to page1 via ADD OBJECT bartool.pframe....container1.

In general the viewsource output is intended for source versioning, not for compilation, so don't expect this code to compile, especially grids are a known problem. If you want to define a programmatic class you'll have to break it down to simpler objects, eg define a page class with a container in it and add that to the pageframe.

I built such a toolbar with the visual class designer though, and it works, don't use the PRG code. It fails on adding an object to the not existing page2. while the class is built up, the pageframe has yet no page1 and2 subobject, to which the ADD OBJECT clause wants to add a container.

Bye, Olaf.

 
Thanks Olaf. I was building my project and it kept crashing so I tried to compile Class after class to see where the culprit is and then I realized that the toolbar was not compiling. Okay then, I will look for other places for the error.

Thanks.


------------------------------------->

"I have sought your assistance on this matter because I have exhausted all the help that I can find. You are free to direct me to other source of help"
 
You may have an error in such a toolbar anyway, if you add such PRG code to your project I get a syntax error at the ADD OBJECT line of the container. But the PRG is not meant to be compiled. You should have a visual class of a vcx where that came from at that should compile fine.

You can analyze which is the last compiled module when you activate the debugger window and it's debugout window before doing the build. It will list at what component the build process is currently working.

Bye, Olaf.
 
I will try the debugger window. Really never used it with Build. Only used it to locate errors while running in Development Mode.

------------------------------------->

"I have sought your assistance on this matter because I have exhausted all the help that I can find. You are free to direct me to other source of help"
 
Olaf,
Thanks for your help. I was also to solve my compiling/building problem. It appeared that a .vcx was partially corrupted. I created a New and empty .vcx then I used ADD CLASS to copy all the objects of the old .vcx into the new, i deleted the old and compiled the New and it went well.


------------------------------------->

"I have sought your assistance on this matter because I have exhausted all the help that I can find. You are free to direct me to other source of help"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top