Clearing a field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
cosnet1BUSk1Aq
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10
Joined: Wed Apr 18, 2012 9:58 pm

Clearing a field

Post by cosnet1BUSk1Aq » Sat Sep 01, 2012 2:52 am

I have been playing with fields by putting lines of text into a field. Because I am using 'put <variable A> into line 1 of field 3' in one statement and later I use 'put <variable B> into last line of field 3' that subsequent runs of the program don't clear field 3 but just append. Okay an understandable result. I know if I 'put "" into field 3' at the beginning of the program it clears it. While this works i was wondering if I am overlooking a more elegant or appropriate command. The question is what is the best way to empty the contents of a field?

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Clearing a field

Post by sturgis » Sat Sep 01, 2012 4:01 am

Thats pretty much it. YOu can put empty into field "fieldname" or set the text of field "fieldname" to empty but it all works out to the same result.

Adrian
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 79
Joined: Wed Jul 11, 2012 5:03 pm

Re: Clearing a field

Post by Adrian » Sun Sep 02, 2012 12:08 pm

I'm not sure if I'm fully understanding what you are trying to do, but can't your first put just "put ... into", which will replace anything there? Then your second one can just "put ... after". That way there's no need to clear the field first.

Cheers,

Adrian

cosnet1BUSk1Aq
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10
Joined: Wed Apr 18, 2012 9:58 pm

Re: Clearing a field

Post by cosnet1BUSk1Aq » Mon Sep 03, 2012 12:15 am

Thanks for both responses. Yes Adrian the first one would clear it as you suggest. I can't remember now why I was doing it the way i was doing. Like I said I am just playing so was trying different things. Thanks to you both.. Adrian and Sturgis. I think the empty would be a more elegant and descriptive method.

Post Reply