Quit a Script in the middle?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Quit a Script in the middle?
I have a script that calls other scripts.
The first thing the script does is bring up a File dialog box and prompts for a file.
If the User clicks "cancel" then I need the progam to go back to the "Home" card and stop the remainder scripts.
I did use...
answer file "Select a file:" with type "html|htm|html"
if it is "Cancel" then go visible to card "dog1" of stack "race1"
exit to top
if it <> "" then
put url ("file:" & it) into tData
end if
If I Click "cancel" it still continues with the the rest of the script.
Please help as if the user does not choose a file it screws up all the data.
Thank you
The first thing the script does is bring up a File dialog box and prompts for a file.
If the User clicks "cancel" then I need the progam to go back to the "Home" card and stop the remainder scripts.
I did use...
answer file "Select a file:" with type "html|htm|html"
if it is "Cancel" then go visible to card "dog1" of stack "race1"
exit to top
if it <> "" then
put url ("file:" & it) into tData
end if
If I Click "cancel" it still continues with the the rest of the script.
Please help as if the user does not choose a file it screws up all the data.
Thank you
Hi user with the strange nick,
...
go VISIBLE...???
...
I wonder why this does not throw an error
OK, try this:
Best
Klaus
...
go VISIBLE...???
...
I wonder why this does not throw an error

OK, try this:
Code: Select all
on mouseup
answer file "Select a file:" with type "html|htm|html"
if it = "Cancel" then
go card "dog1" of stack "race1"
exit mouseup
## Here you can put the name of the handler you want to exit like "mouseup“ in this case...
end if
...
end mouseup
Best
Klaus
Sorry for not getting back sooner...This did not work. It alway continues and just to check I put in the answer command and it comes up if you push cancel or not? Please Help.
on mouseup
answer file "Select a file:" with type "html|htm|html"
if it is "Cancel" then
go to cd "trackdata" of stack "trackdata"
exit mouseup
## Here you can put the name of the handler you want to exit like "mouseup in this case...
else
answer "you did it"
end if
end mouseup
on mouseup
answer file "Select a file:" with type "html|htm|html"
if it is "Cancel" then
go to cd "trackdata" of stack "trackdata"
exit mouseup
## Here you can put the name of the handler you want to exit like "mouseup in this case...
else
answer "you did it"
end if
end mouseup
It won't contain "cancel" for the "answer file with type" form (Most likely Klaus confused it with the older "answer file with filter" type (but even then the result, and not it would contain "cancel")).
If you had read the documentation, then you would know that the it Variable will be empty if you press cancel, so just change the if like this:
If you had read the documentation, then you would know that the it Variable will be empty if you press cancel, so just change the if like this:
Code: Select all
on mouseup
answer file "Select a file:" with type "html|htm|html"
if it = "" then
go card "dog1" of stack "race1"
exit mouseup
## Here you can put the name of the handler you want to exit like "mouseup“ in this case...
end if
...
end mouseup
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Well first of all I did read the docs and it does not tell everything or this Forum would be a waist of time.
I appreciate that we have this and thank everyone who contributes to it.
Thanks for all the help and I had to use the exit to top to quit the calling handler.
Thanks again and keep up the great work.
I appreciate that we have this and thank everyone who contributes to it.
Thanks for all the help and I had to use the exit to top to quit the calling handler.
Thanks again and keep up the great work.
I oppose this. The documentation contains everything about every comand in Rev (if not then it's a bug). However that information is too wealthy, and most people get overwhelmed.no1g8tor wrote:Well first of all I did read the docs and it does not tell everything or this Forum would be a waist of time.
So the forum and the use list are mostly for cases that are more general (like what repeat loop to use when, when to use arrays or cprops, etc.), or for people who missed the important bit in the docu due to information overload.
Of course the documentation approachability could need some heavy spicing up, but it's information content is complete.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Its its approachability that makes it useless in a lot of simple cases. Lets say I was using a checkbox for the first time. You'd think I just had to type check box into the Dictionary, especially since it is an object of the tools. But you get nothing, but a description of checkmark. Your expected to somehow stubble apon autohilite before you get any incling of how to use checkbox. I'd call that incomplete.BvG wrote:I oppose this. The documentation contains everything about every comand in Rev (if not then it's a bug). However that information is too wealthy, and most people get overwhelmed.no1g8tor wrote:Well first of all I did read the docs and it does not tell everything or this Forum would be a waist of time.
So the forum and the use list are mostly for cases that are more general (like what repeat loop to use when, when to use arrays or cprops, etc.), or for people who missed the important bit in the docu due to information overload.
Of course the documentation approachability could need some heavy spicing up, but it's information content is complete.
Maybe I was wrong. I was speaking of the "User Guide". Is there a better documentation I am missing.
Unless you know exactly what you are looking for the "A-Z" guide is useles. I wish the online docs were broken down in to categories where you could see a list of say Text and File System and it would list the commands and when you click the command it would give the description and examples like it does now.
Maybe I am wrong, just my 2 cents.
Thanks again
Unless you know exactly what you are looking for the "A-Z" guide is useles. I wish the online docs were broken down in to categories where you could see a list of say Text and File System and it would list the commands and when you click the command it would give the description and examples like it does now.
Maybe I am wrong, just my 2 cents.
Thanks again
another question about the same subject.
When I try to use the same code to cancel a print command it does not work. IT just continues and prints anyway?
Thanks
ie...
answer printer
if it = "" then
go card "Home" of stack "Finishline 8.0"
exit to top
end if
answer printer
if it = "cancel" then
go card "Home" of stack "Finishline 8.0"
exit to top
end if
When I try to use the same code to cancel a print command it does not work. IT just continues and prints anyway?
Thanks
ie...
answer printer
if it = "" then
go card "Home" of stack "Finishline 8.0"
exit to top
end if
answer printer
if it = "cancel" then
go card "Home" of stack "Finishline 8.0"
exit to top
end if
Hi,
hmmm, this is the last line of the "answer printer" entry in the docs:
hmmm, this is the last line of the "answer printer" entry in the docs:
...
Note: If the user clicks the cancel button of the answer printer dialog, then "cancel" is put into the result.
C'mon guys, please show a tiny bit more of good will, thanks!Unless you know exactly what you are looking for the "A-Z" guide is useles.
Klaus,
Thank you for pointing that out. Then why does it NOT work? I provided the code in the previous post and if the "GREAT DOCS" are correct then it should work. When I push "Cancel", it continues to print. I also have a lot of questions concerning printing in general and will leave it for another post.
Please let me know what I am doing wrong. It would be very appreciated.
There is plenty of good will on here and most of us, including me are thankful to the people who make positive useful comments and not try to show people up with putting things in there face.
I think that the docs are good but just not as good as they could be or could be better organized. If I remember correctly, in an earlier version they had the docs organized by type, but I may be wrong. A to Z does not help someone who is looking for say a Text function and has to guess where to look.
There is a "COPYCAT" language on the net that is now freeware called HyperNext Studio" and I took a look at it and it is slow and not even close to this,but I liked the Help Docs and the way they are layed out. Check it out and see if you agree?
The nice people at Revolution know that its not perfect and are always working to make things better and that is why I am so attracted to this programming format. I also think they like comments from the end user to understand what we are in need of.
I see you do help people out on here a lot and to all of us that you have helped we thank you. Just be nice.
My opinion counts because I paid my $400 for the software and know that I am just as important as everyone who is a revolution customer.
Please if you can help me respond.
Thanks again to everyone.
Thank you for pointing that out. Then why does it NOT work? I provided the code in the previous post and if the "GREAT DOCS" are correct then it should work. When I push "Cancel", it continues to print. I also have a lot of questions concerning printing in general and will leave it for another post.
Please let me know what I am doing wrong. It would be very appreciated.
There is plenty of good will on here and most of us, including me are thankful to the people who make positive useful comments and not try to show people up with putting things in there face.
I think that the docs are good but just not as good as they could be or could be better organized. If I remember correctly, in an earlier version they had the docs organized by type, but I may be wrong. A to Z does not help someone who is looking for say a Text function and has to guess where to look.
There is a "COPYCAT" language on the net that is now freeware called HyperNext Studio" and I took a look at it and it is slow and not even close to this,but I liked the Help Docs and the way they are layed out. Check it out and see if you agree?
The nice people at Revolution know that its not perfect and are always working to make things better and that is why I am so attracted to this programming format. I also think they like comments from the end user to understand what we are in need of.
I see you do help people out on here a lot and to all of us that you have helped we thank you. Just be nice.
My opinion counts because I paid my $400 for the software and know that I am just as important as everyone who is a revolution customer.
Please if you can help me respond.
Thanks again to everyone.
it is not the same as the result.
Klaus thinks that distinction is very simple to understand, but actually it's not explained anywhere in the online documentation (maybe it's somewhere hidden in the pdf?). When I started to read about the result, first I never understood where that result would end up. Of course the command results in something, but where would it put the produced result? One of the back draws of using such an English like language I guess.
I also remember having problems to understand which command puts stuff in the result, and which uses it. In the end I had to come to the conclusion that there's no rule about which is used, and whenever a command uses them, I have to look up the dictionary entries to know for sure which will actually contain a reply for me to use.
You can query the result like this:
Klaus thinks that distinction is very simple to understand, but actually it's not explained anywhere in the online documentation (maybe it's somewhere hidden in the pdf?). When I started to read about the result, first I never understood where that result would end up. Of course the command results in something, but where would it put the produced result? One of the back draws of using such an English like language I guess.
I also remember having problems to understand which command puts stuff in the result, and which uses it. In the end I had to come to the conclusion that there's no rule about which is used, and whenever a command uses them, I have to look up the dictionary entries to know for sure which will actually contain a reply for me to use.
You can query the result like this:
Code: Select all
on mouseUp
answer printer
if the result = "cancel" then
go card "Home" of stack "Finishline 8.0"
exit to top
end if
end mouseUp
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode