Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Sam
  Where is Sam?
 HK
 Hong Kong
 Sam
 To: Karben Selim Mejia
  Where is Karben Selim Mejia?
 San Pedro Sula
 Honduras
 Karben Selim Mejia
 Tags
Subject: the code could not run in vfp6, Eric and Mejiaks
Thread ID: 15842 Message ID: 15958 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Saturday, October 05, 2002 3:53:42 AM         
   


I worked in vfp6. I tried the code suggested by Mejiaks. In the debug window, _vfp.forms is an object but the highlight bar do not even go into the loop. Once it reach the line "FOR EACH", it then jump to "ENDFOR" immediately. Does this mean the code only works for vfp7 but not vfp6?

Thanks in advance.

> > I tried to change loForm to loToolbar, still nothing happen. What am I missing?
> > Thanks
> >
> > > > Method 1 -"Release window" is ok, but method2 - "for each" doesn't.
> > > > I have 2 toolbars displayed on screen and run the following code on screen. Nothing happen. What was missing in my settings?
> > > >
> > > >
 FOR EACH loToolbar IN _vfp.forms
> > > >     IF loToolbar.class = "Toolbar" OR loForm.baseclass = "Toolbar"
> > > >        loToolbar.release
> > > >     ENDIF
> > > >  ENDFOR

> > > >
> > > > If I change "loToolbar.release" to "?loToolbar.caption", nothing was printed. Could you tell me why?
> > > > Thanks in advance.
> > >
> > > I think I made an error. My sample uses loToolbar and loForm. (loForm is wrong and should be loToolbar).
> > > --
> > > Eric den Doop
> > > www.foxite.com - The Home Of The Visual FoxPro Experts
> >
> >
> > SAM
>
> I tried the code in VFP7 and works perfectly. I used it like this
>
>
> * you must pass the toolbar caption to the RELEASE WINDOW command
> * this technique works for user defined toolbars too.
> * another way to release user defined toolbars is:
> SET STEP ON on
> FOR EACH loToolbar IN _vfp.forms
>    IF loToolbar.class = "Toolbar" OR loToolBar.baseclass = "Toolbar"
>       loToolbar.release
>    ENDIF
> ENDFOR
> 

>
> may be, and I am only guessing, you are making a mistake in the string comparison
> if your are you using :
> "ToolBar" instead of "Toolbar" or
> "TOOLBAR" instead of "Toolbar"
> it wont work because those strings are diferents,
>
> try running the code this way just to avoid this problems
>
>
> * you must pass the toolbar caption to the RELEASE WINDOW command
> * this technique works for user defined toolbars too.
> * another way to release user defined toolbars is:
> SET STEP ON on
> FOR EACH loToolbar IN _vfp.forms
>    IF lower(loToolbar.class) = "toolbar" OR lower(loToolBar.baseclass) = "toolbar"
>       loToolbar.release
>    ENDIF
> ENDFOR
> 

>
> regards
>
> Karben Selim Mejia (Mejiaks)
>
> I used to think that my life was complete. it was until my (by now) Two-years-old child was born that I realized how wrong I was!
> Honduras, Central America
> The very center of the world


SAM

ENTIRE THREAD

Closing Toolbars Posted by Sam @ 10/2/2002 6:42:04 AM
RE: Closing Toolbars Posted by Eric den Doop @ 10/2/2002 7:40:46 AM
Thanks a lot, Eric. Posted by Sam @ 10/3/2002 3:01:07 AM
Question about the code, Eric Posted by Sam @ 10/3/2002 3:56:41 AM
RE: Question about the code, Eric Posted by Eric den Doop @ 10/3/2002 9:28:16 AM
RE: Question about the code, Eric Posted by Sam @ 10/4/2002 2:09:17 AM
RE: Question about the code, Eric Posted by Karben Selim Mejia @ 10/4/2002 4:51:51 PM
the code could not run in vfp6, Eric and Mejiaks Posted by Sam @ 10/5/2002 3:53:42 AM
RE: the code could not run in vfp6, Eric and Me... Posted by Karben Selim Mejia @ 10/5/2002 5:52:05 AM