Text in Fields not Copying & Control IDs

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
jstarkman
Posts: 47
Joined: Wed Mar 16, 2011 4:39 am

Text in Fields not Copying & Control IDs

Post by jstarkman » Tue Mar 05, 2013 3:45 pm

Hi All,

I have a series of fields on a card which are part of a group. In my code, I am copying the group to another card, but in doing so, the text/contents of the field is not persisting, but is being changed to empty. The copy process is a simple single line of code, similar to "copy the grp "Cell" on the card "CellCard" to this card". Items are not being copied one at a time.

Has anybody ever come across this behavior before? This is something that used to work fine, but is now not working.

Also, is there a limitation on the range of a control ID number? In testing my app, I am creating controls & groups via script. Currently, objects are being generated having control IDs in the +14,000 range. Will this generate problems at some point? Is there a way to reset or renumber control IDs?

Thanks for your help.

Joel

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Text in Fields not Copying & Control IDs

Post by mwieder » Tue Mar 05, 2013 6:57 pm

Joel-

Check the sharedText property of the fields in the group. If it's not selected then the fields on different cards can have different content.

IDs: yes, there's a limit, but it's big and I can't remember the details.
The stack ID will determine the IDs of the created objects.
You can set the stack's ID higher than the current value but not lower.

set the id of stack "xyzzy" to 15000
create button
put the id of it -- should give you 15001
-- but now you can't set the stack id below 15001.

jstarkman
Posts: 47
Joined: Wed Mar 16, 2011 4:39 am

Re: Text in Fields not Copying & Control IDs

Post by jstarkman » Wed Mar 06, 2013 2:39 pm

Thanks. That did the trick. Strange that these fields stopped matching after copying, when for some time now (during development) they matched properly. There were no changes to code that should have triggered this, which lead me to question about the ID issue, as I thought there might be some related memory concern.

If my app generates objects as a result of executing, is there not the possibility that in the hands of a user, upon repeated uses, ID nos. could be exhausted? Up until now, I had not considered this as an issue, but perhaps it is.

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

Re: Text in Fields not Copying & Control IDs

Post by Klaus » Wed Mar 06, 2013 5:08 pm

The max. number of objects in a stack = uint4 = 4,294,967,295!
So the number of IDs may be similar and should be enough to get started :D

jstarkman
Posts: 47
Joined: Wed Mar 16, 2011 4:39 am

Re: Text in Fields not Copying & Control IDs

Post by jstarkman » Wed Mar 06, 2013 5:25 pm

Thanks Klaus. I feel relieved....

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

Re: Text in Fields not Copying & Control IDs

Post by Klaus » Wed Mar 06, 2013 5:28 pm

:D



(Filler stuff to get over the lousy "Your message contains 2 characters. The minimum number of characters you need to enter is 10." dialog)

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Text in Fields not Copying & Control IDs

Post by mwieder » Wed Mar 06, 2013 7:47 pm

Experimentally, I think the practical number may be less half that amount.
I can't set the id of a new stack to anything greater than 2147483640.
And things start getting weird after that. Routines that rely on ids don't handle integer overflows very well.
The engine/IDE starts getting very flaky.

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

Re: Text in Fields not Copying & Control IDs

Post by Simon » Wed Mar 06, 2013 9:55 pm

If my app generates objects as a result of executing, is there not the possibility that in the hands of a user, upon repeated uses, ID nos. could be exhausted?
Once your standalone is closed all new ID's are removed, they only keep increasing for you because you save your stack after testing.
Yes, it would be cool if one could reassign ID's but I don't think that's possible.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

jstarkman
Posts: 47
Joined: Wed Mar 16, 2011 4:39 am

Re: Text in Fields not Copying & Control IDs

Post by jstarkman » Thu Mar 07, 2013 12:39 am

Hi Simon,

Perhaps I didn't explain myself properly.

In my app, objects are created dynamically by the user. For example, I am creating cells with graphic objects, the cells house fields, and all are grouped on different cards to create a view. These views are then copied to a main card. The process of pressing a button to populate a screen generates many new objects. After repeated runs of the app during development, I'm now up to object id's in the 20,000s.

Are you saying that object id's only exist in the development environment, and that as a standalone on an iOS device, they are not an issue?

Joel

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

Re: Text in Fields not Copying & Control IDs

Post by Simon » Thu Mar 07, 2013 12:56 am

Hi Joel,
Sorry no, there are still ID's in a standalone.
Just, as you repeatedly create new objects during development the ID's increment and once you save your stack the ID's remain.
Lets say you are testing and you have 10 objects that are dynamically created each time you press btn "Create". You press that button 10 times and your ID's have increased by 100. You save and close the stack and then when you open it again the ID's have been recorded at +100 so the next "Create" gives you 110.
In the standalone there is no saving so the numbers will only increase for each "Create", maybe they do that 100 times but when they close the app the ID's drop back to where the developer last saved.

Simon
EDIT: Just saw your Splash Stack post.... Do you intend on saving the new dynamic elements? Now that's a different fish.
EDIT2: ooops...wasn't you :oops:
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply