Globally Accessible Array: HOW?
-
@Deeeds Arrays are a bunch of text, as you may know. If you want a globally accessible array, store the array in an attribute on an object or something as text, then any time you modify the array or get information from it, always refer to that attribute.
-
@Aidan-Oxley I'll leave alone the fact that arrays aren't just a bunch of text... for the moment.
And try to discover what you're saying in the rest.
What on earth does the rest of what you're saying mean?
Store an array in an attribute, got it.
"or something as text"... you've lost me.
How do I refer to that array as an attribute on something else?
Does this "just work"?
-
@Aidan-Oxley I've tried this. Definitely not something in the "it just works" category. I'm not getting the array when getting the attribute value from the object that has the array set to an attribute.
-
@Aidan-Oxley
It's all about the delays.
Wait before setting (for arrays to come into being)
Wait longer before getting attribute value of array (so there's time for it to be set)
I'm going to ponder ways to avoid this degree of complexity for non-programmers. I'm sure I'll come up with an elegant solution.
Perhaps it's been solved before ;)
Many times.
-
@Deeeds I store an array in an object’s attribute, and it works fine,
If you’re on iOS 11:
Also be careful hard coding arrays in iOS 11, in a lot of fields, iOS will replace the regular exact same two quotes with one that symbolises the start and end quote, which causes the array to not work.
But, copying and pasting exact quotes work fine, which is what I do.In HyperPad’s input box behaviour field they do not get replaced, so I type in there and copy and paste.
-
@Kamdroid We must be talking about different things.
I'm entering numbers into an array, in the list on the right, in the "property inspector" of hyperPad.
What are you talking about?
-
@Deeeds said in Globally Accessible Array: HOW?:
@Aidan-Oxley I've tried this. Definitely not something in the "it just works" category. I'm not getting the array when getting the attribute value from the object that has the array set to an attribute.
Maybe I was thinking something else?
-
@Deeeds, @Aidan-Oxley‘s way would work great.
-
@iTap-Development see questions above...
-
@Deeeds An array is seriously just a bunch of text. For example, an array storing the values 1 and 2 looks like this: [“1”,”2”]. I’ll make a test project for ya.
-
@Deeeds Here you go: http://bit.ly/2yVvKfT
-
@Aidan-Oxley That's how an array looks to you. It's not quite that simple underneath. And it's not just text.
-
@Aidan-Oxley Cheers. I'll have a puzzle around in a bit... still fighting with backups and corruption of my "elegant" little factory.