Storing text as a custom property

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
reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Storing text as a custom property

Post by reelstuff » Sat Mar 30, 2013 2:04 am

I was looking over a custom properties stack used to store values, I wanted to store text as a custom property, then populate a field with that text.

I tried several different approaches to this and somehow I have missed something, I used the message watcher, to see if the engine was getting the message and it appears to update but I think that I am not referencing the custom property in the right way,


Code: Select all

on mouseUp
   put the customProperties["emotional1"] of me into myCustomvalue
   put myCustomvalue into fld "actionFld1"
   end mouseUp

Any suggestions or thought are greatly appreciated.

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Storing text as a custom property

Post by magice » Sat Mar 30, 2013 2:41 am

try this instead:

Code: Select all

on mouseUp
       put the emotional1 of me into myCustomvalue
       put myCustomvalue into fld "actionFld1"
       end mouseUp
of course this is assuming that you have created the custom property "emotional1" for the button being pushed, and that it has a value in place.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Storing text as a custom property

Post by Simon » Sat Mar 30, 2013 2:50 am

Or simply:

Code: Select all

on mouseUp
   put the emotional1 of me into fld "actionFld1"
end mouseUp
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Re: Storing text as a custom property

Post by reelstuff » Sat Mar 30, 2013 3:07 am

Super, it works, I see what I did wrong now, thanks for the help, )

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

Re: Storing text as a custom property

Post by sturgis » Sat Mar 30, 2013 3:08 am

Keep your first effort in mind, it will be useful if you decide to dig into custom property sets. Not really necessary for what you're doing at the moment though.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”