Two On-Rev Scripts on One Web Page

Mike Bonner bonnmike at gmail.com
Wed Sep 15 12:23:14 EDT 2010


What you're trying to do should work fine, my suspicion is that there are
mismatched tags somewhere, or something that is messing up the output. Since
it works in the first its most likely not the included file thats the
problem, tho I guess it could introduce something funky that cases later
stuff to misbehave.

Devins suggestion might help you out here though.  If you want to be able to
put the same information several places on the page you can define it as a
command or function in your include file.

command myspecialcommand
put the date
end myspecialcommand

Then include this file (it can contain multiple commands and functions so
that it behaves as  a library)

At which point anytime you want to put out the text generated by
myspecialcommand you can do it like

<?rev myspecialcommand ?> and it will.

You will still have potential issues with mismatched tags etc that can munge
your output,  but only including the file once can simplify things in my
opinion.

As for tracking down the issue, if you try something and it behaves as you
describe, viewing the source of the page in the browser is a good start
towards solving it.  Look at the source and see where it breaks, the look at
your code and see what is just before and after that location.

On Wed, Sep 15, 2010 at 10:10 AM, Devin Asay <devin_asay at byu.edu> wrote:

>
> On Sep 15, 2010, at 10:02 AM, Gregory Lypny wrote:
>
> > Hello everyone,
> >
> > I have an On-Rev script called from an HTML markup item in a web page.
>  It works fine in that the information I want generated is displayed.  I
> call the script like this (thanks for help with the syntax, André):
> >
> >       <?rev include "../myScript.irev" ?>
> >
> > The trouble is, if I put the exact same statement in another HTML markup
> item anywhere else on the page, nothing is displayed and other static text
> items on the page are blanked out.  The implication seems to be that more
> than one reference, using Include, to On-Rev scripts cannot exist on the
> same page.  Is that correct or am I doing something wrong (likely)?  If the
> second item does not use an include statement to reference a script but is a
> script itself, then there is no problem.  For example,
> >
> >       <?rev put the long date && the long time ?>
> >
> > works fine on the same page with myScript.irev.
> >
> > Any thoughts?
>
> Gregory,
>
> I'm not the expert on revServer scripting by any means, but as far as I
> know you only need to issue an include statement one time for any given
> page. The included file should then be available to any script segments on
> the page. I find it really helpful during development to enable inline error
> reporting:
>
> <?rev set the errormode to "inline" ?>
>
> That will show any errors generated by your rev code.
>
> HTH
>
> Devin
>
> Devin Asay
> Humanities Technology and Research Support Center
> Brigham Young University
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list