A couole of complete newbie questions
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
A couole of complete newbie questions
I've inherited an app written in LiveCode. Not being an app developer (I'm a unix guy) I've taken on the project with a little unease.
The first thing I've noticed is that, when doing "run" testing within the app, all of my controls are permanently changed.
So for example, I have an option box called "score" and the Label for it is "Enter Score".
Clicking on it, gives the user the option of selecting values 1 through 10.
So when I'm testing my code with the "Run" tool, I notice when I switch back to the "Edit" tool the value I selected remains.
Is there a way to make control attributes fixed when not in "Run" or debug mode?
I have other questions, but I hope to find the answer to those with google's help.
The first thing I've noticed is that, when doing "run" testing within the app, all of my controls are permanently changed.
So for example, I have an option box called "score" and the Label for it is "Enter Score".
Clicking on it, gives the user the option of selecting values 1 through 10.
So when I'm testing my code with the "Run" tool, I notice when I switch back to the "Edit" tool the value I selected remains.
Is there a way to make control attributes fixed when not in "Run" or debug mode?
I have other questions, but I hope to find the answer to those with google's help.
Re: A couole of complete newbie questions
Hi MrFollies,
Thank you for your question, which allowed me to discover the run button that I never used for OSX.
I understand this button build a standalone.
A standalone can't be changed. It keep the state when it has been compiled.
You have to export the current state outside in a stack or files to get a changed state.
Best regards
Jean-Marc
Thank you for your question, which allowed me to discover the run button that I never used for OSX.

I understand this button build a standalone.
A standalone can't be changed. It keep the state when it has been compiled.
You have to export the current state outside in a stack or files to get a changed state.
Best regards
Jean-Marc
https://alternatic.ch
Re: A couole of complete newbie questions
Thanks for your reply Jean-Marc.
I understand that a standalone can't be changed, but one of the advantages of LiveCode is the ability to run the code quickly and easily from the IDE.
Surely there must be a way to debug without all of the controls changing as you do so?
I understand that a standalone can't be changed, but one of the advantages of LiveCode is the ability to run the code quickly and easily from the IDE.
Surely there must be a way to debug without all of the controls changing as you do so?
Re: A couole of complete newbie questions
Welcome,
You can have an invisible standalone it call a stack. Don't forget to save the stack when you close it.
I don't use it because I prefer store files but I think it works
Best
Jean-Marc
YesSurely there must be a way to debug without all of the controls changing as you do so?

You can have an invisible standalone it call a stack. Don't forget to save the stack when you close it.
I don't use it because I prefer store files but I think it works
Best
Jean-Marc
https://alternatic.ch
Re: A couole of complete newbie questions
This old thread http://forums.livecode.com/viewtopic.php?f=7&t=7420 discusses some options which may be useful.
Re: A couole of complete newbie questions
Aww... People used to be so sweet.This old thread viewtopic.php?f=7&t=7420 discusses some options which may be useful.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: A couole of complete newbie questions
I think people have misinterpreted your question to involve standalones, but I think you're talking about a reset while developing.MrFollies wrote:So when I'm testing my code with the "Run" tool, I notice when I switch back to the "Edit" tool the value I selected remains.
Is there a way to make control attributes fixed when not in "Run" or debug mode?
There is nothing built-in, LiveCode truly is "live code" and whatever you do will stick until you undo it. Typically we write a little handler that resets any values to defaults, and run it on preOpenCard so that the user is always presented with a clean UI. Sometimes it isn't necessary to run it before each card opens, it's preferable to run it only once on startup, or some other time. It all depends on how the app will work.
But in any case, once that's written, you can easily run it from the message box when you want to reset all the controls to a default state. You can store the defaults in custom properties of each object, as the referenced discussion mentions, or you can hard-code values, or you can calculate them on the fly. Lots of times in the case of fields or radio buttons, the default value is empty or zero and a hard-coded handler deals with them easily. Option buttons can have their menuhistory set to your default numbered choice to reset them.
In most cases it isn't necessary to reference every control on the card. You can run a repeat loop that checks for a common property (whether the field is unlocked, has a certain name, belongs to a particular group, etc.) and empty them all at once. Push buttons virtually never need to be reset. And so forth.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com