Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 8:34 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Cloning problem
PostPosted: April 26th, 2007, 7:47 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
I've had this cloning problem for ages but couldn't pin down the source until now. Does anybody know a solution.

When you clone an object it starts life with the value 2147483648 and increments by one for every additional clone created.

However, when you reset a page, the clone value does not reset. I'd would have thought that it should.

Any ideas very much welcomed.

Mackavi

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 26th, 2007, 9:33 pm 
Offline

Joined: October 26th, 2004, 10:23 am
Posts: 666
Location: Digital Workshop
The object IDs have to be unique within any run of the publication; it cannot be reset.

_________________
ddww Opus Developer


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 27th, 2007, 8:49 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Cheers Duncan,

That makes sense. Having slept on the problem, might have a solution.

My issue is that because the clones display a variable that is read from an array, I use a counter to track the position of each clones' value. The clone ID is then used to calculate which cell of the array, their value is stored in.

Because I have have to reset the page at certain times, the clone ID continuous on, but the array counter is reset to zero causing them to become out of sync. Without restarting the application, I'm unable to reset the clone ID.

As my reset needs to wipe all current variables, I can't even keep the counter in memory, but I think that if I use a temporary registry store, I could read the last counter value in and only wipe it if the exit button is clicked.

If anybody has a simpler solution, am more than will to take ideas.

Mackavi

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 29th, 2007, 2:16 am 
Offline

Joined: December 14th, 2004, 5:08 pm
Posts: 55
Location: Holland
Opus: version 8.0
OS: XP, Vista, Windows7, Windows8
System: Intel Corei7-2600 CPU 3.400GHz
Write to a root text file on harddisk before resetting?

BR

Jim


Top
 Profile  
 
 Post subject:
PostPosted: August 25th, 2007, 12:07 pm 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
Mackavi I've found this solution ,but I don't know if this what you want or something else.Just give it a try


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
 Post subject:
PostPosted: August 25th, 2007, 2:34 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Glad to see I'm not the only one working on this sunny Saturday afternoon :-) This issue is still on my bug board, as I've yet to impliment Duncan's solution.

I had a good play with the IMP you posted and it's a great idea for solving this (although I still feel that there is no reason why the CloneId shoudn't reset when all other publications variables are reset). Both solutions have merits - yours elemiates the ID problem altogether by wrapping the ILMObject inside an array which would of course be resettable whereas Duncan's allow me to continue storing my actual values inside the clone as a variable to be manipulated directly.

Storing objects inside an array is an extremely powerful way of handling them but can be extremely frustrating when you want access to the data inside the object as I discovered writing Scroggle.

I've since started using custom objects and prototypes and have the very very very early idea of how this will improve the next version of Plethos.

Many thanks for this. I love the idea of using cloning as it maximise the flexibility of my programs and I think that if i use it with custom objects / prototypes I'd have a powerful solution to many types of problem.

Mack

P.S to other readers - i would recommend downloading this and having a play if your interested in cloning as demostrates how to use it effectively. I'd add a debug, left click action to the TC box to see exactly what is stored in the myClone array :-)

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 44 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group