[thelist] ASP Problems again..

Jerry Scannell JerryScannell at cox.net
Thu Oct 31 10:16:00 CST 2002


VB Script will give you an error if you use parantheses when calling a "sub"
since subs don't return anything.  Conversely, if you omit () on function
calls, you will also get an error.

It is a good idea to always write your own routines as functions so you can
return something, even if it is 1.  then you can utilize the () which are
required in practically every other programming language (e.g. c, fortran,
etc.)

Jerry


----- Original Message -----
From: "Chris Blessing" <webguy at mail.rit.edu>
To: <thelist at lists.evolt.org>
Sent: Thursday, October 31, 2002 10:30 AM
Subject: RE: [thelist] ASP Problems again..


> Actually, since the write() method of the response object isn't a real
> function (it's really just a procedure since it doesn't return something),
> you shouldn't use the parenthesis... but VBS is so incredibly flexible,
> it'll let you get away with it. :)
>
> And I always use spaces before the = sign in this type of block:
>
> <% = someVar %>
>
> Just easier on the eyes IMO.
>
> Chris Blessing
> webguy at mail.rit.edu
> http://www.330i.net
>
> >
> > Could it be that you are missing some brackets..
> >
> >       [ Page Number<%response.write iPage %> out of <%
> > response.write intTotalPages%>]
> >
> > should be..
> >
> >       [ Page Number<%response.write(iPage) %> out of <%
> > response.write(intTotalPages)%>]
> >
> > To save time you could also use....
> >
> >       [ Page Number<%= iPage %> out of <%= intTotalPages%>]
> >
> > Also, I'm not sure if it makes much difference, but...
> >
> >        <a href="showimage.asp?ipage=<% = (iPage+1) %>">
> >
> > would be better as..
> >
> >        <a href="showimage.asp?ipage=<%= (iPage+1) %>">
> >                                       ^ space removed
> >
> > Hope that helps.
> >
> >
> > Cheers,
> >
> > Julian Voelcker
> > Cirencester, United Kingdom
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
>




More information about the thelist mailing list