[ON-REV] include, dbExec and other things

Sarah Reichelt sarah.reichelt at gmail.com
Tue Jun 30 22:36:10 EDT 2009


> To learn how to script irev files, I've been
> looking at members' code examples. But
> I'm getting snagged up by new terms.
>
> Two of my latest:"dbExec" and "include".
>
> At first I searched the runrev documentation,
> but now I know they're not runrev commands --
> which I found odd, since I thought the code
> between the <?rev  and the ?> that "did stuff"
> had to be rev-only... or in html.
>
> BTW, some code examples omitted the ?>.
> Is that an oversight or is that ok? Why?
>
> So, I looked more closely at the code examples,
> goggled a bit, and now have a sense of what
> "dbExec" and "include" are and a vague notion
> of how to use them (but further light is welcome).
>
> Anyway, my basic question is: If it's not in
> the Rev docs, how can I learn what irev
> scripts can do? Besides, that is, the on-rev
> forum, the on-rev online docs, and of course
> bugging this list.

If you look at this file
<http://samples.on-rev.com/irev-engine-notes.txt> it will give you an
introduction and list the few new bits of syntax used in irev files.
This includes the "include" command but does not cover "dbExec" which
I would assume is someone's library command. Check the include files
used in the irev file that contains this command and I expect you will
find a handler there called "dbExec".

Including files is very useful as it avoids duplication. For example
if you have a site where every page has the same footer, you can just
"include" this footer each time. That way if it changes, you only have
to change it once. Or if you have a file full of useful irev handers,
you can save it as a separate file and just include it in any page
which needs these handlers.

As regards leaving off the trailing ?>, the engine notes recommend
leaving this off in include files only.

Cheers,
Sarah



More information about the use-livecode mailing list