Is is likely you have to structure it like
If x=7 THEN
call whatever
end if
If you want to do differently and get it down to 1 line you could do
some clever tricks with the EVAL statement to make a 1 liner that
builds the longer one as a string and executes it.
http://www.learnasp.com/learn/vbs5.asp
and
http://www.learnasp.com/learn/debug1.asp
shows the many AMAZING FANTASTIC UNBELIEVABLE tricks the Eval function
has potential to do.
On Fri, 21 Jan 2005 04:03:15 -0000, dw_ygrps <[EMAIL PROTECTED]> wrote:
>
> Thank you Charles for your response.
> I did not know about the learnasp.com site and thanks for turning me
> on to it. Perhaps it was right in front of me, but I did not see any
> examples of subroutines being called from an IF statement.
>
> I believe it is illegal to do a CALL to subroutine from an IF
> statement. i.e. <% if x = 1 then call mysubroutine(24) %>
> The above example is is not allowed.
> It looks like IF statements are limited to variable manipulations and
> response.write etc functions, but not to branching to functions or
> subs.
>
> If there is an example of this in the learnasp.com site, I would love
> to see it.
>
> Thanks again,
> Duane
>
>
> --- In [email protected], Charles Carroll
> <[EMAIL PROTECTED]> wrote:
> > Read
> > http://www.learnasp.com/learn/qualitycode.asp
> > particularly all teh entries with the word SUBroutine. All will be
> clear.
> >
> > http://www.learnasp.com/learn/subdictionary.asp
> > and
> > http://www.learnasp.com/learn/subreusable.asp
> > and
> > http://www.learnasp.com/learn/rsfast.asp
> > may particularly open your mind to a world of possibilities.
> >
> >
> > On Wed, 19 Jan 2005 04:00:01 -0000, dw_ygrps <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > > In ASP VBscript, there does not appear to be a legal way to
> branch to
> > > a function or sub on the same asp page.
> > >
> > > I know how to use server.transfer to build a web page out of
> selected
> > > parts from small building-block asp files, but in traditional VB
> > > there are goto statements etc that allow you to jump to a
> subroutine
> > > and back etc.
> > >
> > > For example:
> > > If myvariable = 1 then gosub subroutine_25
> > >
> > > What is the asp vbscript command that would do this?
> > >
> > > Thanks,
> > > Duane
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
>
>
>
>
> ________________________________
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
>
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/