Re: vbscript fails to execute by Al
Al
Wed Dec 28 15:39:46 CST 2005
"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns973AA2CBB3634eejj99@194.109.133.242...
> =?Utf-8?B?QmFzaWxS?= wrote on 28 dec 2005 in
> microsoft.public.scripting.vbscript:
>
> > "Evertjan." wrote:
> >
> >> =?Utf-8?B?QmFzaWxS?= wrote on 27 dec 2005 in
> >> microsoft.public.scripting.vbscript:
> >>
> >> > Have a script with a few lines of code which are supposed to call
> >> > and execute another vb script, it doesn't. I can't see anything
> >> > wrong with it. Any thoughts?
> >> >
> >> > Thanks
> >> >
> >> > Function Main()
> >> >
> >>
> >> A vbs fuction is only executed when called.
> >>
> >> vbscript is NOT pascal.
>
> [please do not toppost on usenet]
>
> > Thank You for your response. How would you recommend calling it
> > within from within the same script? A simple sub procedure, say
> >
> > Sub name
> >
> > Call Main
> >
> > End Sub
>
> Just:
>
> Main
... or "CALL MAIN". But, and this is important, this reference to the sub
MUST be placed OUTSIDE of the sub in the script. Yes, it is possible for a
sub to call itself (see "recursion" as a programming technique), however, NO
STATEMENTS in the subroutine will be executed UNTIL the sub is actually
called. Therefore, a sub cannot "CALL ITSELF" into exectution.
/Al