Storing info in an array v. individual 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
glenn9
Posts: 223
Joined: Wed Jan 15, 2020 10:45 pm
Location: Europe

Storing info in an array v. individual cards...

Post by glenn9 » Fri Mar 05, 2021 5:24 pm

Hi everyone,

Grateful for some advice on how to proceed...

I've developed a two card 'dictionary' type of app with card A having a field 'display' which displays the keys of an array, and card B has a 'definition' field showing the corresponding element of the key.

By way of background its an 'aide memoire' type of app for clinicians where the keys are presenting symptoms and the elements are a 'checklist' of issues that a clinician should cover for the corresponding symptom. There are approximately 150 presenting symptoms (keys) together with their corresponding checklist.

The user would click on a symptom key on card A which would then show the corresponding checklist on card B

The issue on desktop (and mobile) is that I'm finding that there is often a lag when the user clicks on the 'backarrow' from card B to card A and, puzzling, it only seems to be for certain keys, for example, clicking the backarrow on card B showing the checklist for a 'cough' there is no lag, but for a 'rash' there is a second or so lag before it returns to card A.

On mobile this same lag is also present, but also there are issues with the scroller. Although card A's 'field'display' scroller for the keys works reliably, the scroller on card B's 'definition' field sometimes works but more often than not, there is a delay of a second or two before it registers a scroll!

I'd be embarrassed to mention how many hours I've spent trying to get to the bottom of these problems, pairing down the code to try and identify by elimination where the problem may be but with no success so far!

I was now left wondering whether it was something to do with storing the information in an array, and whether I'd be better off having individual cards for each symptom/definition(checklist), say generated from a template, and if it was an array issue, whether 150 items would be too unwieldy for this ?

Grateful for any thoughts...

Thanks,

Glenn

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

Re: Storing info in an array v. individual cards...

Post by Klaus » Fri Mar 05, 2021 5:38 pm

Hi Glenn,

hm, 150 keys in your array should not cause any slowdown.
But without looking at your stack/code I cannot say anything to the problem.

If you like I can take a look at your stack, if yes, drop a line: klaus AT major-k.de


Best

Klaus

stam
Posts: 2682
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Storing info in an array v. individual cards...

Post by stam » Fri Mar 05, 2021 5:48 pm

Absolutely what Klaus says.
I've recently been playing with arrays with > 20,000 elements and have been amazed at how fast LC handles them.

I suspect the lag may be algorithm related - Klaus will sniff it out ;)
(or post some code here...)

And if you want clinical feedback drop me a line...

S.

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

Re: Storing info in an array v. individual cards...

Post by dunbarx » Fri Mar 05, 2021 6:46 pm

Hi.

Any change if you diligently lock the screen every time you navigate anywhere?

Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”