Re: Storing an Array as a Custom Property

2010-10-03 Thread Gregory Lypny
Hi Jacqueline,

Yes, I will.  But the documentation problem, both with the user guide and 
built-in help or dictionary, goes far beyond updating.  Good writing, examples, 
organization, and consistency in design take time.  If you type the word Array 
into the built-in help, the only hits you will get is for ArrayEncode and 
ArrayDecode but nothing for an array itself.  Someone new to LiveCode, who 
perhaps coincidentally got far enough into the user guide to come across 
arrays, would be hard-pressed to get any information about their uses or 
properties.  A benchmark for good documentation in my mind is the original 
HyperCard User Guide and HyperCard Reference Manual.  The writing is clean and 
the example code statements and handler snippets are carefully chosen to give 
the fullest scope of usage of the item in question.  Another is Mathematica's 
built-in documentation (and even their online documentation), where what they 
lack in Apple's writing and publishing suave, they make up for in 
comprehensiveness.  My recommendation for the Rev team would be to spend less 
time on rebranding and promotional splash screens and more polishing the 
software.

Regards,

Gregory


On Sun, Oct 3, 2010, at 10:39 AM, Jacqueline wrote:

 Message: 6
 Date: Sat, 02 Oct 2010 16:06:45 -0500
 From: J. Landman Gay jac...@hyperactivesw.com
 Subject: Re: Storing an Array as a Custom Property
 To: How to use Revolution use-revolution@lists.runrev.com
 Message-ID: 4ca79ee5.90...@hyperactivesw.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 On 10/2/10 3:30 PM, Gregory Lypny wrote:
 Thank you for your responses.  It's an interesting thread.  So, if
 I've understood correctly, the LiveCode manual is incorrect because
 arrays can, in fact, be stored as custom props.   Not one to
 complain, but probably the only thing that saps my productivity in
 working with Rev or LiveCode is the poor documentation and built-in
 dictionary.  This list, however, is indispensable!
 
 It would be good to report this in the QCC as a documentation error. 
 They try to find everything and update it with each new release, but 
 sometimes entries are accidentally overlooked. Documentation bugs almost 
 always get fixed quickly because they are so easy to fix.
 
 -- 
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-03 Thread Alejandro Tejada

Hi all,


Gregory Lypny wrote:
 
 But the documentation problem, both with the user guide and built-in help
 or dictionary, goes far beyond updating.  Good writing, examples,
 organization, and consistency in design take time.
 
 [snip]
 
 My recommendation for the Rev team would be to spend less time on
 rebranding and promotional splash screens and more polishing the software.
 

My experience with new Livecode users is that they actually expect
this software works like the software they already know really well.

The most useful function for them would be an UNDO function
that works like those in Powerpoint, Word or Photoshop.

About the documentation, i expect that comments added to the
online dictionary get downloded from Livecode site and appear
when you open the dictionary in your computer.

Al
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Storing-an-Array-as-a-Custom-Property-tp2926487p2953584.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-03 Thread Michael D Mays
So true Gregory. 

Michael


On Oct 3, 2010, at 12:16 PM, Gregory Lypny wrote:

  But the documentation problem, both with the user guide and built-in help or 
 dictionary, goes far beyond updating.  Good writing, examples, organization, 
 and consistency in design take time.  If you type the word Array into the 
 built-in help, the only hits you will get is for ArrayEncode and ArrayDecode 
 but nothing for an array itself.  Someone new to LiveCode, who perhaps 
 coincidentally got far enough into the user guide to come across arrays, 
 would be hard-pressed to get any information about their uses or properties.  
 A benchmark for good documentation in my mind is the original HyperCard User 
 Guide and HyperCard Reference Manual.  The writing is clean and the example 
 code statements and handler snippets are carefully chosen to give the fullest 
 scope of usage of the item in question.  Another is Mathematica's built-in 
 documentation (and even their online documentation), where what they lack in 
 Apple's writing and publishing suave, they make up for in comprehensiveness.  
 My recommendation for the Rev team would be to spend less time on rebranding 
 and promotional splash screens and more polishing the software

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread Claudi Cornaz

Hi Richard,

It works if you create it as one var so put gaskin[richard] into  
tPropSet

set the tPropset of tObj to tValue

Or you can do

on mouseUp
 put gaskin into tPropset
 put [richard] after tPropSet
 set the tPropSet of tObj to tValue
end mouseUp

I use this the whole time


Claudi




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread Richard Gaskin

Claudi Cornaz wrote:


It works if you create it as one var so put gaskin[richard] into
tPropSet
set the tPropset of tObj to tValue

Or you can do

on mouseUp
  put gaskin into tPropset
  put [richard] after tPropSet
  set the tPropSet of tObj to tValue
end mouseUp

I use this the whole time


Nice!

It hadn't occurred to me to put the entire array notation string into a 
variable.  And it avoids the performance penalty of do -- good stuff. 
 Thanks!


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread Claudi Cornaz


There is another one theat works
put richard into tProp

put the gasking[tprop] of tObj

Apparantly the set name by itself can't be a var, altough the prop  
name can.
So either put the whole thing in a var (set name en property name) or  
you can only use the property part as a var.


   Claudi


On 2 okt 2010, at 15:18, Richard Gaskin wrote:


Claudi Cornaz wrote:


It works if you create it as one var so put gaskin[richard] into
tPropSet
set the tPropset of tObj to tValue

Or you can do

on mouseUp
 put gaskin into tPropset
 put [richard] after tPropSet
 set the tPropSet of tObj to tValue
end mouseUp

I use this the whole time


Nice!

It hadn't occurred to me to put the entire array notation string  
into a variable.  And it avoids the performance penalty of do --  
good stuff.  Thanks!


--
Richard Gaskin
Fourth World
LiveCode training and consulting: http://www.fourthworld.com
Webzine for LiveCode developers: http://www.LiveCodeJournal.com
LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread Gregory Lypny
Thank you for your responses.  It's an interesting thread.  So, if I've 
understood correctly, the LiveCode manual is incorrect because arrays can, in 
fact, be stored as custom props.   Not one to complain, but probably the only 
thing that saps my productivity in working with Rev or LiveCode is the poor 
documentation and built-in dictionary.  This list, however, is indispensable!


Gregory




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread J. Landman Gay

On 10/2/10 3:30 PM, Gregory Lypny wrote:

Thank you for your responses.  It's an interesting thread.  So, if
I've understood correctly, the LiveCode manual is incorrect because
arrays can, in fact, be stored as custom props.   Not one to
complain, but probably the only thing that saps my productivity in
working with Rev or LiveCode is the poor documentation and built-in
dictionary.  This list, however, is indispensable!


It would be good to report this in the QCC as a documentation error. 
They try to find everything and update it with each new release, but 
sometimes entries are accidentally overlooked. Documentation bugs almost 
always get fixed quickly because they are so easy to fix.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread Joe Lewis Wilkins
While we're talking about bugs, I found that you cannot change the field 
property TAB on Return from the multi line msg box. Maybe from the single 
line too, but I didn't try that one. I had hundreds of fields for which I 
wanted that property changed. Ended up doing them one at a time. I was able to 
change some of the other properties using the msg box.

Joe Wilkins


On Oct 2, 2010, at 2:06 PM, J. Landman Gay wrote:

 On 10/2/10 3:30 PM, Gregory Lypny wrote:
 Thank you for your responses.  It's an interesting thread.  So, if
 I've understood correctly, the LiveCode manual is incorrect because
 arrays can, in fact, be stored as custom props.   Not one to
 complain, but probably the only thing that saps my productivity in
 working with Rev or LiveCode is the poor documentation and built-in
 dictionary.  This list, however, is indispensable!
 
 It would be good to report this in the QCC as a documentation error. They try 
 to find everything and update it with each new release, but sometimes entries 
 are accidentally overlooked. Documentation bugs almost always get fixed 
 quickly because they are so easy to fix.
 
 -- 
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.com

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread Richard Gaskin

Joe Lewis Wilkins wrote:

 While we're talking about bugs, I found that you cannot change
 the field property TAB on Return from the multi line msg box.

That's because there is no property called Tab in Return.

By default, the Rev Property Inspector hides the English-like names 
used in the language and instead shows what is presumably an 
Even-More-English-Like label.  The problem is that there is then no 
direct way to know the name of the property you're setting.


In this case the actual property name is autoTab.


The first thing I tell my clients to do when they begin learning Rev is:

1. Go to Preferences
2. In the section with the heading Property labels are:, click the
   option labeled Name of LiveTalk Property.

Once that's done the Inspector provides reinforcement of the tokens 
you'll have to learn for scripting anyway.


And without that, as you've found it just raises the learning curve.

--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread Joe Lewis Wilkins
Sorry, but I  said TAB on Return, which IS a field property.

Joe Wilkins

On Oct 2, 2010, at 2:56 PM, Richard Gaskin wrote:

 Joe Lewis Wilkins wrote:
 
  While we're talking about bugs, I found that you cannot change
  the field property TAB on Return from the multi line msg box.
 
 That's because there is no property called Tab in Return.
 
 By default, the Rev Property Inspector hides the English-like names used in 
 the language and instead shows what is presumably an Even-More-English-Like 
 label.  The problem is that there is then no direct way to know the name of 
 the property you're setting.
 
 In this case the actual property name is autoTab.
 
 
 The first thing I tell my clients to do when they begin learning Rev is:
 
 1. Go to Preferences
 2. In the section with the heading Property labels are:, click the
   option labeled Name of LiveTalk Property.
 
 Once that's done the Inspector provides reinforcement of the tokens you'll 
 have to learn for scripting anyway.
 
 And without that, as you've found it just raises the learning curve.
 
 --
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread stephen barncard
there are no  property names with spaces.

sqb

On 2 October 2010 17:10, Joe Lewis Wilkins pepe...@cox.net wrote:

 Sorry, but I  said TAB on Return, which IS a field property.

 Joe Wilkins

 On Oct 2, 2010, at 2:56 PM, Richard Gaskin wrote:

  Joe Lewis Wilkins wrote:
 
   While we're talking about bugs, I found that you cannot change
   the field property TAB on Return from the multi line msg box.
 
  That's because there is no property called Tab in Return.
 
  By default, the Rev Property Inspector hides the English-like names
 used in the language and instead shows what is presumably an
 Even-More-English-Like label.  The problem is that there is then no direct
 way to know the name of the property you're setting.
 
  In this case the actual property name is autoTab.
 
 
  The first thing I tell my clients to do when they begin learning Rev is:
 
  1. Go to Preferences
  2. In the section with the heading Property labels are:, click the
option labeled Name of LiveTalk Property.
 
  Once that's done the Inspector provides reinforcement of the tokens
 you'll have to learn for scripting anyway.
 
  And without that, as you've found it just raises the learning curve.
 
  --
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 



Stephen Barncard
San Francisco Ca. USA

more about sqb  http://www.google.com/profiles/sbarncar
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread Joe Lewis Wilkins
I didn't use spaces, but it is shown with spaces in the Inspector, which is why 
I told Richard that some of the names are iffy. I did it the correct way and 
it doesn't work as I said it doesn't.

Joe Lewis Wilkins


On Oct 2, 2010, at 3:20 PM, stephen barncard wrote:

 there are no  property names with spaces.
 
 sqb
 
 On 2 October 2010 17:10, Joe Lewis Wilkins pepe...@cox.net wrote:
 
 Sorry, but I  said TAB on Return, which IS a field property.
 
 Joe Wilkins
 
 On Oct 2, 2010, at 2:56 PM, Richard Gaskin wrote:
 
 Joe Lewis Wilkins wrote:
 
 While we're talking about bugs, I found that you cannot change
 the field property TAB on Return from the multi line msg box.
 
 That's because there is no property called Tab in Return.
 
 By default, the Rev Property Inspector hides the English-like names
 used in the language and instead shows what is presumably an
 Even-More-English-Like label.  The problem is that there is then no direct
 way to know the name of the property you're setting.
 
 In this case the actual property name is autoTab.
 
 
 The first thing I tell my clients to do when they begin learning Rev is:
 
 1. Go to Preferences
 2. In the section with the heading Property labels are:, click the
  option labeled Name of LiveTalk Property.
 
 Once that's done the Inspector provides reinforcement of the tokens
 you'll have to learn for scripting anyway.
 
 And without that, as you've found it just raises the learning curve.
 
 --
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
 
 

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread David C.
 I didn't use spaces, but it is shown with spaces in the Inspector, which is 
 why I told Richard that some of the names are iffy. I did it the correct 
 way and it doesn't work as I said it doesn't.


As Richard was trying to explain above, the Tab On Return that you
are seeing is nothing more than a descriptive label that is used in
the IDE for the autoTab property. The actual property is autoTab,
which can be manipulated by script or message box like this:

set the autoTab of field Myfield to true
-or-
set the autoTab of field Myfield to false

Read Richard's message again and give his suggestion a try it will
make everything much easier!

Best regards,
David C.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread Joe Lewis Wilkins
Thanks David. Then that's what the property should be named in the Inspector 
and I wouldn't have had this problem.

I'm sure that Richard's suggestion is a good one, but just that much more for 
us to learn. KISS!

Joe Lewis Wilkins


On Oct 2, 2010, at 4:21 PM, David C. wrote:

 I didn't use spaces, but it is shown with spaces in the Inspector, which is 
 why I told Richard that some of the names are iffy. I did it the correct 
 way and it doesn't work as I said it doesn't.
 
 
 As Richard was trying to explain above, the Tab On Return that you
 are seeing is nothing more than a descriptive label that is used in
 the IDE for the autoTab property. The actual property is autoTab,
 which can be manipulated by script or message box like this:
 
 set the autoTab of field Myfield to true
 -or-
 set the autoTab of field Myfield to false
 
 Read Richard's message again and give his suggestion a try it will
 make everything much easier!
 
 Best regards,
 David C.

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-02 Thread J. Landman Gay

On 10/2/10 6:25 PM, Joe Lewis Wilkins wrote:

Thanks David. Then that's what the property should be named in the
Inspector and I wouldn't have had this problem.

I'm sure that Richard's suggestion is a good one, but just that much
more for us to learn. KISS!


The IDE offers two ways to view property labels in the inspector, as 
Richard was saying. One way is to provide a descriptive label, which is 
the default for all new installations. The descriptive label tries to 
tell more explicitly what the property acutally does, but is usually not 
a term you can use in a script. The other way to view the labels is by 
the actual LiveTalk property name that is used in scripts and which 
appears in the dictionary.


You can indeed make the property inspector show the actual property 
names, as you suggest. Do that by setting the very first preference in 
the General pane of the Preferences dialog to Name of LiveTalk 
property. Then the inspector will do as you suggest above, and show the 
real names of the properties. Like Richard, I also tell all new 
scripters to turn off the descriptive terms and use the actual property 
names instead.


If you want to leave the inspector as you are used to with description 
showing instead of names, there is a second way to see the actual 
property name. You must have tooltips turned on for it to work (they are 
on by default.) Just hover your mouse over the property label in the 
inspector and the actual property name will appear in a tooltip. If you 
have reversed the preferences so that the actual name is in the label, 
the tooltip will display the descriptive term instead. In other words, 
tooltips will show whichever label you have not set as the default in 
preferences.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-01 Thread Phil Davis

 On 10/1/10 9:04 AM, Gregory Lypny wrote:

Hi everyone,

Page 236 of the LiveCode user guide says that arrays cannot be stored as single 
custom properties.  Can anyone confirm this please?  The reason I ask is that I 
thought that I had read in a past Rev newsletter that it was now possible, but 
I may be mistaken.

I'm developing an app in LiveCode and have been saving uni-dimensional arrays 
as single customs props without apparent problems; however, it may be another 
story with multi-dimensional arrays.


For multi-dimensional arrays you need arrayEncode() and arrayDecode():

put ice cream into aMyFoods[favorites][desserts][cold]
set the uMyFoods of stack dataContainer to arrayEncode(aMyFoods)


Regards,

Gregory


--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-01 Thread Richard Gaskin

Phil Davis wrote:

  On 10/1/10 9:04 AM, Gregory Lypny wrote:

 Page 236 of the LiveCode user guide says that arrays cannot be
 stored as single custom properties.  Can anyone confirm this
 please?  The reason I ask is that I thought that I had read in
 a past Rev newsletter that it was now possible, but I may be
 mistaken.

 I'm developing an app in LiveCode and have been saving
 uni-dimensional arrays as single customs props without apparent
 problems; however, it may be another story with multi-dimensional
 arrays.

 For multi-dimensional arrays you need arrayEncode() and arrayDecode():

 put ice cream into aMyFoods[favorites][desserts][cold]
 set the uMyFoods of stack dataContainer to arrayEncode(aMyFoods)

I believe the engine does that automatically when using arrays as custom 
prop values.


This would also explain why using deep arrays as prop values is often 
much slower than using the natively-addressable two-dimensional arrays 
via property sets and properties.


An odd thing about that, though:

Back in August Kevin wrote here:

   Can't you do something like this:

  put xyz into tVar
  set the tVar of btn 1 to a

   You'll end up with a property called xyz that contains a in
   the default set.
http://mail.runrev.com/pipermail/use-revolution/2010-August/144541.html

So by extension, one might think this would work too:

  on mouseUp
put gaskin into tPropSet
put richard into tProp
set the tPropSet[tProp] of me to Howdy!
  end mouseUp

But it doesn't.  It doesn't throw an error, nor set the result to an 
error string, but it doesn't set the property either.


Instead the simplest I've found is this:

  on mouseUp
put gaskin into tPropSet
put richard into tProp
set the customPropertySet of me to tPropSet
set the tProp of me to Howdy!
  end mouseUp

Is there a way to make that a one-liner using array notation?

I know we can do it with hard-wired propset names like this:

  set the gaskin[richard] of me to Howdy!

But how can we do it where the propset name is a variable?

--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-01 Thread Mike Bonner
You can put multidimensional arrays into properties, at least as of what..
3.5? If I recall correctly, the only real issue with this is that you have
to pull the whole thing back out as a unit to work with it.  I'm not
positive, but I don't think it arrayencodes and decodes when you get and
set. bit not sure.  When looking at a property that is an array in the
inspector it says this:
*
The value of this custom property is an array and can only be edited in the
Property inspector if it is first converted into a string. Doing this will
empty the array. If you are sure you want to do this, double click on this
field*

On Fri, Oct 1, 2010 at 11:21 AM, Phil Davis rev...@pdslabs.net wrote:

  On 10/1/10 9:04 AM, Gregory Lypny wrote:

 Hi everyone,

 Page 236 of the LiveCode user guide says that arrays cannot be stored as
 single custom properties.  Can anyone confirm this please?  The reason I ask
 is that I thought that I had read in a past Rev newsletter that it was now
 possible, but I may be mistaken.

 I'm developing an app in LiveCode and have been saving uni-dimensional
 arrays as single customs props without apparent problems; however, it may be
 another story with multi-dimensional arrays.


 For multi-dimensional arrays you need arrayEncode() and arrayDecode():

 put ice cream into aMyFoods[favorites][desserts][cold]
 set the uMyFoods of stack dataContainer to arrayEncode(aMyFoods)

  Regards,

 Gregory


 --
 Phil Davis

 PDS Labs
 Professional Software Development
 http://pdslabs.net

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-01 Thread Phil Davis

 On 10/1/10 11:06 AM, Mike Bonner wrote:

You can put multidimensional arrays into properties, at least as of what..
3.5? If I recall correctly, the only real issue with this is that you have
to pull the whole thing back out as a unit to work with it.  I'm not
positive, but I don't think it arrayencodes and decodes when you get and
set. bit not sure.


I stand corrected! Thanks.

--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-01 Thread DunbarX
Richard, I have to run, but would writing it as a do construction work?

Craig

In a message dated 10/1/10 2:00:59 PM, ambassa...@fourthworld.com writes:


 
 But how can we do it where the propset name is a variable?
 
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Storing an Array as a Custom Property

2010-10-01 Thread Ken Ray

 Instead the simplest I've found is this:
 
on mouseUp
  put gaskin into tPropSet
  put richard into tProp
  set the customPropertySet of me to tPropSet
  set the tProp of me to Howdy!
end mouseUp
 
 Is there a way to make that a one-liner using array notation?

The only way I can see to do it is with do; and maybe use merge to make it
a bit cleaner:

on mouseUp
  put gaskin into tPropSet
  put richard into tProp
  put Howdy! into tVal
  do merge(set the [[tPropSet]][ [[tProp]] ] of me to tVal)
end mouseUp

Note that you need to have a spaces around [[tProp]] otherwise you get an
error...


Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Web Site: http://www.sonsothunder.com/


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution