PDA

View Full Version : How do you create an exit or close for a browse?


ABC123

kellerm
02-20-2007, 10:36 AM
I have never figured out how to create an exit button or way to exit browse without having to go to the control or bottom tabs... Especially if I eliminate the control and the tabs below I would have to close the whole A5V8 program and restart it again... Where am I missing that ability...
Thanks...

G Gabriel
02-20-2007, 02:59 PM
You could do so from :
1-alpha's menu if that's what you are using
2-Your custom menu
3-Embed the browse in a form and create a button on the form to close the form
4-Click the "X" at the right-upper hand side
5-Put a button on the title with a script to close the browse

kellerm
02-20-2007, 05:07 PM
Maybe I am a little confused but the first choice which would be great, closes the whole program including alphafive... I'd like to close the browse and be able to return to the menu form I have created... Maybe the only way is your idea of embedding a browse into a form...

Al Buchholz
02-20-2007, 05:29 PM
#5 is a good choice

Gabe - is there already an example of that for Keller or do we need to make one?

G Gabriel
02-20-2007, 06:59 PM
Maybe I am a little confused but the first choice which would be great, closes the whole program including alphafive
From the menu, choose File->Close. (Not Close Database)

Maybe the only way is your idea of embedding a browse into a form...
I almost always embed browses in a form for more versatility & functionality.

Al:

is there already an example of that
Didn't make one, but assuming things work the way they should in v8, it should be easy to create one.

G Gabriel
02-20-2007, 07:03 PM
..just tried the button in title: peice of cake, took couple seconds to create & works great.

kellerm
02-20-2007, 10:01 PM
How did you do it???

kellerm
02-20-2007, 10:44 PM
Guys while I have been waiting for a reply, I tried the embedded browse on a form layout which displayed fine and then I created an exit button too which worked fine... The problem I now have encountered is when I go to the form that is my menu form and create a button with an action to select the newly created form that has the embedded browse I get an error on the button saying "Bad Expression Character"... I have tried everything to no avail!!! It will not select the form I have created... What do you suppose is wrong..... If I tell the button to select a default form or browse it will work...
Thanks for your help...
PS this is the script generated by alphafive:

'Open a Form or Browse layout, displaying all, or selected records in the layout.
query.filter = ".t."
query.order = "Freq"


'Open the layout_type showing just the records that satisfy the filter
DIM Shared varP_Browse_TV,_CC,_Wireless as P
DIM layout_name as c
layout_name = "Browse TV, CC, Wireless"
varP_Browse_TV,_CC,_Wireless = :Form.viewqueried(layout_name,query.filter, query.order )

G Gabriel
02-21-2007, 07:55 AM
Keller:

How did you do it???
I just started playing with v8, so it's not like I had extensive experience with it or any magical powers. I simply followed the instructions.
Open the browse in design mode
Right click a title where you want to put the button
Click Advanced Column Title
Add a button
Click Edit button
In the event name, type any name you want
Close the whole thing
From the menu, choose Browse, Events
A window with an alpha generated incomplete function appears
In the body of the function type: parent.close()
Close and save
That's it.


I have tried everything to no avail!
Keller: please, for Pete's sake, no commas in the naming of the layouts. It looks like you named your browse: TV, CC, Wireless

kellerm
02-21-2007, 09:46 AM
Thanks for the help, it was the commas on the title causing the trouble... I didn't know that was an issue till now...
Thanks again!!!

MikeC
02-21-2007, 03:53 PM
Keller,

Not just commas are problems....so are any spaces in a name---use the underscore_to_separate_instead.


Mike

MikeC
02-21-2007, 08:08 PM
Keller (and G),

G pointed out (in a similar thread) that having blanks should not present a problem and this may very well be true.....but MANY others do suggest that blanks not be used as there are times when problems do arise. This applies to forms, tables, browses etc. I am only reiterating what some of the more learned here at Alpha feel is good practice. There are times when blanks can be used but when are those times??? Much easier just to not use them at all I think! And that is the entire point I wanted to make.

Mike

kellerm
02-21-2007, 08:31 PM
Point well taken and I appreciate it as I know enough to get in to trouble...
Thanks...

G Gabriel
02-21-2007, 09:27 PM
G pointed out (in a similar thread) that having blanks should not present a problem and this may very well be true
With more than 10 years of using alpha and using spaces in the layouts' names without any problems, I have to believe it to be true and I have yet to find some of the more "learned" to prove me wrong.

Do you watch the show "Mythbusters"? This myth is busted and should not be propagated.

There are however situations where you should not use spaces, specifically in fields' names. Again, this is something I have, like many others, had to learn the hard way. Alpha in the past allowed spaces in fields names. I never used them in tables fields names but in calc fields. With newer versions, alpha did away with spaces in the calc fields names and that created some problems. But that was many moons ago.

I am not avert to anyone using underscores nor do I recommend against that, but to state that the spaces in the layout names was a problem is a mis-statement and a myth.