Keeping a data field clear when saving...

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
kcorey
Posts: 62
Joined: Fri Nov 25, 2011 6:06 pm

Keeping a data field clear when saving...

Post by kcorey » Sat Jan 21, 2012 7:35 pm

Hi All,

I have a card I'm using as a data store. The interesting bits I save on this card are things like "login name", and various preferences.

Trouble is, this card won't be saved in the production version. There, it will always load with empty fields on the data card.

I'm using Klaus Major's excellent recommendations from the 99th and 101st newsletters. (They are really good if you want to store smallish bits of preferences in a safe cross platform way, thanks Klaus!).

At any rate, as I'm developing, each time I type Ctrl-S, those data fields might have a value, and will be saved that way. My code will "get used" to having data in those fields, if you see what I mean.

Is there a programmatic way in the IDE to say "I just typed Ctrl-S. Before you save, clear fields x,y and z on card 'data'"?

-Ken

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Keeping a data field clear when saving...

Post by dunbarx » Sat Jan 21, 2012 7:53 pm

Trap the "saveStackRequest" message, which is sent just before "save" is.

Craig Newman

kcorey
Posts: 62
Joined: Fri Nov 25, 2011 6:06 pm

Re: Keeping a data field clear when saving...

Post by kcorey » Mon Jan 23, 2012 7:59 am

That's just fantastic!

I thought that was gonna be some heavy smoke and mirrors.

*grin*

-Ken

Post Reply