How DO I Copy Custom Properties to Another Stack?

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
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

How DO I Copy Custom Properties to Another Stack?

Post by BarrySumpter » Mon Sep 19, 2011 6:01 am

Just playing the the Name Generator from Tactile Media
http://www.tactilemedia.com/index.html? ... rials.html

This stack has three custom properties each with say 50 custom keys.

I'd like to increase this to say 50 custom properties each with 50 customkeys.

Since I had all kinds of issues copying a test DataGrid with its template to another stack,
I'm wondering how to copy a stacks 50 custom properties each with 50 customkeys
to another stack?

Any help would be greatly appreciated.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: How DO I Copy Custom Properties to Another Stack?

Post by BvG » Mon Sep 19, 2011 2:22 pm

There's an example about copying custompropertysets in the dictionary entry for the customproperties property.
You can get or change the value of a single custom property using array notation. For example, the following statement copies the entire set of custom properties from one card to another, changing only the custom property named "changedDate":

put the customProperties of this card into myCustomProps
put field 3 into myCustomProps["changedDate"]
set the customProperties of next card to myCustomProps
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: How DO I Copy Custom Properties to Another Stack?

Post by Dixie » Mon Sep 19, 2011 3:19 pm

Barry...

stack attached..

be well

Dixie
Attachments
customProp to another stack.zip
(2.75 KiB) Downloaded 267 times

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: How DO I Copy Custom Properties to Another Stack?

Post by BarrySumpter » Mon Sep 19, 2011 10:44 pm

Hi Bvg,

Thanks for taking the time to reply and posting the code.
Much appreciated.

I was expecting the solution to come from a developer like the DataGrid Copy template.
And not be in the dictionary.
Information overload.


Hey Dixie,

Thanks for the sample stack.
A sample stack is worth 10 thousand words.
Very much appreciated.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply