Cloning cards causing many copies to show up in Project Browser
Posted: Fri May 21, 2021 4:00 am
Hi,
I am writing what is essentially a survey, with a small number of different cards used as templates, to be duplicated and populated with different data.
I am cloning the card, storing the ids of the cloned cards in an array, and using the array to navigate back and forth through the cards. This works fine.
What is a problem is that these cloned cards are showing up in the project browser seemingly at random. If I run the program, they are not there. I do a few more things and some cards show up. I quit without saving, re-open the livecode project, and now there are even more cards. I delete them and save, reopen, and they, or different ones, reappear.
Is there some way to avoid this, or is it just some weird flaw with cloning cards and so I should abandon the idea altogether?
If I do abandon the idea of cloning the cards, I will instead just have a small set of template cards which I keep reusing and populating with different data. This would work fine but the idea of actually creating and moving through the cards seemed like such a nice idea. If cloning the cards is not going to work out, I would also take any suggestions on nice ways to implement this type of application in an appropriately livecode-esque way.
Using windows 10 Enterprise, Livecode Indy 9. 6
Code for cloning is in preOpenStack and pretty simple:
clone card cardTextOnly
--code here to put some stuff in the fields of "it" the new card
put the id of it into gCardList[tCardCount] --the array of cards I'm using to navigate
I am writing what is essentially a survey, with a small number of different cards used as templates, to be duplicated and populated with different data.
I am cloning the card, storing the ids of the cloned cards in an array, and using the array to navigate back and forth through the cards. This works fine.
What is a problem is that these cloned cards are showing up in the project browser seemingly at random. If I run the program, they are not there. I do a few more things and some cards show up. I quit without saving, re-open the livecode project, and now there are even more cards. I delete them and save, reopen, and they, or different ones, reappear.
Is there some way to avoid this, or is it just some weird flaw with cloning cards and so I should abandon the idea altogether?
If I do abandon the idea of cloning the cards, I will instead just have a small set of template cards which I keep reusing and populating with different data. This would work fine but the idea of actually creating and moving through the cards seemed like such a nice idea. If cloning the cards is not going to work out, I would also take any suggestions on nice ways to implement this type of application in an appropriately livecode-esque way.
Using windows 10 Enterprise, Livecode Indy 9. 6
Code for cloning is in preOpenStack and pretty simple:
clone card cardTextOnly
--code here to put some stuff in the fields of "it" the new card
put the id of it into gCardList[tCardCount] --the array of cards I'm using to navigate