Empty fields and controls after testing
Bob Sneidar
bobs at twft.com
Wed Oct 26 12:19:44 EDT 2011
Yes, you will need to write your own initialization routine. I do this anyway in all my forms because I read data into the fields, and then validate before writing them back to my storage. I always want to make sure I do not have any random data from a previous edit session making it's way into my database. Usually I have a populate handler that when passed empty for the arguement instead of a string or array, it puts empty into all my fields. Then I just call the populate handler when I open the form, typically in preOpenCard.
Bob
On Oct 25, 2011, at 5:46 PM, Pete wrote:
> You pretty much have to do it yourself. I usually do it in preOPenCard
> rather than have a button bu that depends on your application.
> Pete
> Molly's Revenge <http://www.mollysrevenge.com>
>
>
>
>
> On Tue, Oct 25, 2011 at 5:39 PM, Admin <admin at mfelkerco.com> wrote:
>
>>
>>
>> One thing that truly bugs the hell out of me with Live Code is that
>> when I am done designing/programming and want to test it, the data is
>> now a part of the program.
>>
>> What I mean is, say you have and edit box
>> and you go to test the program and type stuff in the edit box then go
>> back to edit mode, the text is still there. Same
>>
>> goes for captions and
>> other stuff - any changes made in test mode sticks.
>>
>> Is there a way to
>> test a program and when you go back to edit mode, it initializes
>> everything so that all controls are blank.
>>
>> As it stands now, I have to
>> write a custom button that when pressed, wipes all fields/controls and
>> puts them back to their empty original state. It's a pain in the
>> ass.
>>
>> No other language I program in does this.
>>
>> Any thoughts?
>>
>> Mike
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list