A Custom Property Sets 'Database"

Dan Shafer revolutionary.dan at gmail.com
Tue Jan 3 21:04:04 EST 2006


Michael.....

There are two basic approaches to storing data *internally* in your
Rev applications. You can use custom property sets (I have an eBook
tutorial on how to design and use custom properties and sets for $5 at
http://www.shafermediastore.com/tech_main.html) or you can use fields
(and other Rev controls) in the stack itself. One thing you need to be
aware of is that if you expect to distribute your application as a
compiled stand-alone, you'll need to use at least two stacks: a
mainstack that acts as a splasher or some other non-data-saving role,
and a substack where the custom properties or fields are defined and
where the data is stored.

I'm generally inclined when faced with this decision to use Rev as a
database (you should know that there is a LOT of disagreement with
this preference, so don't be surprised to get contradictory advice
from other Rev coders here). You create a splasher or control stack or
whatever as your mainstack (whose data is static) and then create one
or more substacks to hold the data. In the data substack, create
fields (and perhaps other objects, e.g., checkboxes or radio button
sets to store binary or mulitple-choice data), group those controls
into a group, then give that group background behavior.

Using Rev this way works quite well for databases that don't involve
complex relationality and don't expect to contain more than perhaps
10,000 records. (The number of records you can handle with efficiency
is a function of how much of what kind of data is in each
record/card.) My book on Revolution (also available in PDF from the
above URL) has a chapter on this subject.

There's nothing wrong with custom property sets. In fat, in some ways
they work similarly to the card-datastack approach I just outlined.
But programming them is a *tad* more complex. Particiularly if you're
storing binary data (images, PDFs, etc.), you'll probably find the
datastack design approach more effective and easier to understand. (If
you want to get a good view of how using custom props for this kind of
task would look and work, you can download a free stack from
RevOnline. Activate it from the toolbar, click on "User Spaces" in the
left scrolling field, and then scroll down to sms in the user name
list.



On 1/3/06, Michael Mandaville <transcom at comcast.net> wrote:
> Rather than dive into mySQL or altSQLite, (I am a Newbie), I was directed to
> look at Custom Property Sets in order to use the 'internal databse' of
> Revolution to store information.
>
> 1.  Would I use a Table Field as the object to store at least 500 records?
>
> 2.  What is the language in the Custom Property tab that I should use to
> 'create this internal database' structure.
>
> 3.  Would I use a Table Field like a spreadsheet, creating a Table like in a
> traditional DB?
>
> Any direction or even an example, would be much appreciated.
>
> Thank you,
>
> Michael


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer, Information Product Consultant and Author
http://www.shafermedia.com
Get my book, "Revolution: Software at the Speed of Thought"
>From http://www.shafermediastore.com/tech_main.html



More information about the use-livecode mailing list