concating the names of 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
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

concating the names of custom property

Post by samjith »

Hi,

1. i have a custom property with name x_interval_val in card i
2. item 1 of chunk_text contains x

is there any way to produce the result by?

put the (item 1 of chunk_text & "_interval_val") of card i into var
instead of doing
put the x__interval_val of card i into var



Thanks
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: concating the names of custom property

Post by Klaus »

Hi samjith,

you need to use a variable for the CP name like this:
...
put item 1 of chunk_text & "_interval_val" into tVar1
put the tVar1 of card i into var
...
If a variable contains a valid custom property name, then this will work!


Best

Klaus
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Re: concating the names of custom property

Post by samjith »

Hi Klaus,

is there any other method for doing this?

i have 100s of custom property in a card.

can we use functions to doing the same thing?

Thanks

Samjith
Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: concating the names of custom property

Post by Thierry »

samjith wrote: is there any other method for doing this?

i have 100s of custom property in a card.
Hi Samjith,

one way to get all your custom properties:

Code: Select all

   put the customproperties of me into myArray
   repeat for each line K in the keys of myArray
      put K & ": " & myArray[ K] &cr after T
   end repeat
   put T
then, do as Klaus said...

HTH,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
samjith
Posts: 85
Joined: Tue Mar 31, 2015 10:09 am

Re: concating the names of custom property

Post by samjith »

Hi Thierry,

Good idea! :D



Thanks

Samjith
Post Reply