Re: init in Apache::ASP
"Issam W. Alameh" wrote: > > Hello All, > > Can I put my asp code at the end of my html page, but let it execute before > showing the html??? > > I want to have something like > > > Hello <%=$name%> > <% > $name="something"; > %> > > > Can this show > > Hello something > No, probably the place you want to put this code is Script_OnStart like Dmitry mentioned, where you can set up globals for all of your scripts. You cannot hide code like Mason by putting it after the HTML, better to put it into some kind of init() subroutine. --Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks >> free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: init in Apache::ASP
>At 03:59 PM 9/8/00, G.W. Haywood wrote: >Try to think of it as a program. You can't use the variable's value >until you've set it. Why does it matter where it goes in the page? Not exactly true for Perl, is it? -- the BEGIN subroutine comes to mind. What follows is just a speculation on my part, hopefully Joshua or someone else who knows better will correct me if I'm wrong... As I understand the way ASP code is parsed, everything is converted to a perl script with patches of HTML replaced by print statements. This perl script is then submitted to eval(). Assuming this is true, I think you should be able to use the BEGIN subroutine to initialize your variables just like in a normal perl script. Hello <%=$name%> <% BEGIN { $name="something"; } %> Of course, if you have variables that need to be initialized for every script you run, you should probably use Script_OnStart. Dmitry PS Perhaps I should've test this first, before talking off my ass. >If you really want to separate it, use Response->Include or something. >> >>On Fri, 8 Sep 2000, Issam W. Alameh wrote: >> >> > I want to have something like >> > >> > Hello <%=$name%> >> > <% >> > $name="something"; >> > %> >> >
Re: init in Apache::ASP
Hi there, On Fri, 8 Sep 2000, Issam W. Alameh wrote: > I want to have something like > > Hello <%=$name%> > <% > $name="something"; > %> > Try to think of it as a program. You can't use the variable's value until you've set it. Why does it matter where it goes in the page? If you really want to separate it, use Response->Include or something. 73, Ged.
init in Apache::ASP
Hello All, Can I put my asp code at the end of my html page, but let it execute before showing the html??? I want to have something like Hello <%=$name%> <% $name="something"; %> Can this show Hello something Regards Issam
RE: init in Apache::ASP
I pretty sure ASP is just like an other parsed SSI type include. It is processed in order as it appears. So if you did the below it is going to print Hello Just my take on order processing, but that is how I have always seen SSI's as working. Richard Peiper Webmaster CFN > -Original Message- > From: Issam W. Alameh [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 08, 2000 1:35 PM > To: Modperl list > Subject: init in Apache::ASP > > > Hello All, > > Can I put my asp code at the end of my html page, but let it > execute before > showing the html??? > > > I want to have something like > > > Hello <%=$name%> > <% > $name="something"; > %> > > > Can this show > > Hello something > > > Regards > Issam >
RE: init in Apache::ASP
No. But you can create subroutines and call them... Or setup an include which defines various things to be subsitiuted... >-Original Message- >From: Issam W. Alameh [mailto:[EMAIL PROTECTED]] >Sent: Friday, September 08, 2000 1:35 PM >To: Modperl list >Subject: init in Apache::ASP > > >Hello All, > >Can I put my asp code at the end of my html page, but let it >execute before >showing the html??? > > >I want to have something like > > >Hello <%=$name%> ><% >$name="something"; >%> > > >Can this show > >Hello something > > >Regards >Issam >