Best Place To Store a Lot of Text inside a stack?

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
deadparrotsoftware
Posts: 41
Joined: Thu Mar 24, 2016 6:56 pm
Contact:

Best Place To Store a Lot of Text inside a stack?

Post by deadparrotsoftware » Tue Apr 11, 2017 7:40 pm

If I wanted to store a large amount of text, like a document, INSIDE my App - not an external file - that
I could, elsewhere in the app, do things like read it (looking for a word), display, write it out, etc.
what would be the the best pace or best way to do That? Thanks :-)
http://AppBuzzinga.com - App Making Software, Source Code, & Information
Win, MAC, Android, Apple, WordPress

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

Re: Best Place To Store a Lot of Text inside a stack?

Post by Klaus » Tue Apr 11, 2017 7:45 pm

Hi deadparrotsoftware,

best place for this will surely be a custom property!


Best

Klaus

deadparrotsoftware
Posts: 41
Joined: Thu Mar 24, 2016 6:56 pm
Contact:

Re: Best Place To Store a Lot of Text inside a stack?

Post by deadparrotsoftware » Tue Apr 11, 2017 7:59 pm

Thanks, but - A LOT of text? And a custom property of ...?

I was sort of looking for something it would be easy to just cut and paste the text into - like in Delphi (object pascal) we would just use a "memo" field to store any amount of text.

Sid
http://AppBuzzinga.com - App Making Software, Source Code, & Information
Win, MAC, Android, Apple, WordPress

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

Re: Best Place To Store a Lot of Text inside a stack?

Post by Klaus » Tue Apr 11, 2017 8:13 pm

Hi Sid,
deadparrotsoftware wrote:Thanks, but - A LOT of text? And a custom property of ...?
yes, a LOT of text! :D
Fields have some overhead, so a cp is the better choice for this purpose!

Every object can have a custom property, but maybe use a cp of the stack itself.

Create a custom property in the inspector for the stack (Click "Add new Element", rename the cp in fld "Key")
and then you can paste your text into that cp right in the inspector, see attached screenshot.


Best

Klaus
lots_of_text_in_cp.jpg

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Best Place To Store a Lot of Text inside a stack?

Post by dunbarx » Tue Apr 11, 2017 8:14 pm

Hi.

Whether a field or a custom property, there is no limit to the size of the text block, within the limits of the file, which is 4GB (I think).

So it is a matter of style, really. A field can always be viewed and searched, so it is likely the "ordinary" way to do it. But this task should not, er, task you overmuch. :D

Craig Newman

Post Reply