maximum number of cards?

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
snarf
Posts: 8
Joined: Thu Apr 12, 2018 4:25 pm

maximum number of cards?

Post by snarf » Sat May 05, 2018 5:18 pm

hi...
is there any maximum number of new cards in a livecode (stack) file?
i noticed that the cards will automatically 'divide' to 2 parts after i added more than 10 new cards... and the link (using button) doesnt work..
tq

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: maximum number of cards?

Post by Klaus » Sat May 05, 2018 5:38 pm

Hi snarf,
snarf wrote:
Sat May 05, 2018 5:18 pm
is there any maximum number of new cards in a livecode (stack) file?
there is a (theoretical) limit of up to 4 GB per stack! 8)
snarf wrote:
Sat May 05, 2018 5:18 pm
i noticed that the cards will automatically 'divide' to 2 parts after i added more than 10 new cards...
Huh? :shock:
Could you please provide a screenshot? What version of LC and what platform?
snarf wrote:
Sat May 05, 2018 5:18 pm
and the link (using button) doesnt work...
Yes, forum rules, sorry, you need to have at least 10 postings before you can post links etc.


Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9356
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: maximum number of cards?

Post by richmond62 » Sat May 05, 2018 6:10 pm

i noticed that the cards will automatically 'divide' to 2 parts after i added more than 10 new cards...
Could you explain what you mean by 'divide'.

I started a new stack in LC 8.1.8 and made 35 cards (Mac OS 10.7.5) and see them all listed
perfectly clearly, and not divided into anything:
cards1.jpg
CardExplosion.png
CX.livecode.zip
Here's the stack.
(19.01 KiB) Downloaded 138 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9644
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: maximum number of cards?

Post by dunbarx » Sat May 05, 2018 8:04 pm

Hi.

Hypercard could manage many thousands of cards without issue. LC will slow down dramatically after just a couple of thousand. This was true at least through v.6.

Others will recommend that data be kept externally, and loaded, record by record, perhaps into a single card as required. In other words, LC becomes a front end for that dataSet. This is a good method, because is we are talking about large numbers of "cards", we are likely talking about a dataset that has the same structure for each record. It would be rare to have a stack of many thousands of cards where, say, the graphics were different on each. Or whatever.

Craig Newman

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9356
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: maximum number of cards?

Post by richmond62 » Sat May 05, 2018 8:12 pm

Another way to deal with things that i have used several times is to have a card
with a large number of fields storing data off-screen (let us call them for the moment, "df1", "df2", "df3" . . .)
and one field (lets us call it "fDISPLAY") for data display on the part of the card that will be visible to the end-user.

Then one can use this sort of code:

Code: Select all

put fld "df1" into fld "fDISPLAY"
In 2002 I used LiveCode (at that time called 'Runtime Revolution') to author a project with 50 substacks, each
with anywhere between 5 and 10 cards. This had to be made that way as, on my first attempt, authoring the thing as a single stack with 500 cards everything was unbelievably clunky as a stack, and my computer ground to a halt trying to make a standalone.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9644
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: maximum number of cards?

Post by dunbarx » Sun May 06, 2018 1:01 pm

Another way is to have all your data stored in a custom property of the card (could be in an array). Then you simply load the appropriate header:

Say you have:

fruit,apple,pear,nutcase
shoe,sandal,sneaker,horse
flake,corn,snow,nutcase

All stored in a custom property "massiveData". Then you can:

Code: Select all

on mouseUp
put line lineOffset("car",the massiveData of me) of the massiveData of me into tLine
put item 1 of tLine into fid "Category"
put item 2 of tLine into fld "firstInstance"
put item 3 of tLine into fld "secondInstance"
...
Of course you can change the above into a loop.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: maximum number of cards?

Post by FourthWorld » Sun May 06, 2018 8:35 pm

snarf wrote:
Sat May 05, 2018 5:18 pm
is there any maximum number of new cards in a livecode (stack) file?
As Klaus noted, the logical limit is very large. But since LC stacks are kept in memory in their entirety you'll hit practical limits long before that.

And long before you exhaust RAM, the internal housekeeping needed to store card records on disk will become noticeably slower on save operations.

If one absolutely must store data in UI objects, I've found roughly 5000 cards to be a good practical limit for reasonably efficient use, and beyond 10,000 becomes too cumbersome.

But the key there is: do you really need to store the data in the UI? So many things in both development and runtime become much easier when we separate UI from data.
i noticed that the cards will automatically 'divide' to 2 parts after i added more than 10 new cards... and the link (using button) doesnt work..
I'm sorry, I don't understand what that means. Can you provide more detail?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: maximum number of cards?

Post by bogs » Sun May 06, 2018 8:42 pm

FourthWorld wrote:
Sun May 06, 2018 8:35 pm
i noticed that the cards will automatically 'divide' to 2 parts after i added more than 10 new cards... and the link (using button) doesnt work..
I'm sorry, I don't understand what that means. Can you provide more detail?
Pretty much the question everyone would love the answer too :D
Image

Klaus
Posts: 13820
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: maximum number of cards?

Post by Klaus » Thu Jun 07, 2018 4:27 pm

Hi snarf,

it would be good style if you revisit your threads from time to time and check the answers!
This is a generally quick and busy forum, so one whole month is definitively to long to wait.


Best

Klaus

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”