Hi all,

Can anyone tell me how to call a function within one SCRIPT element
(VBScript) from a function within a different SCRIPT element (also
VBScript)?

The called function is within a SCRIPT element with the RUNAT=SERVER
attribute. And the calling function is within a SCRIPT that does not have
this attribute.

Thanks in advance..

-BB

Re: Calling Functions or Subs in another <SCRIPT> by JBFields

JBFields
Tue Feb 22 17:51:34 CST 2005

I think you need to wrap the calling probram in a WSF file (XML) then
use the src=

<script language="vbscript" src="SecondFile.vbs"/>


Re: Calling Functions or Subs in another <SCRIPT> by Brian

Brian
Tue Feb 22 19:39:48 CST 2005

UGH ... I think it'd be better just to use all client-side components..

thanks anyways..

-BB


"JBFields" <jbfields@msn.com> wrote in message
news:1109116294.732724.101690@l41g2000cwc.googlegroups.com...
> I think you need to wrap the calling probram in a WSF file (XML) then
> use the src=
>
> <script language="vbscript" src="SecondFile.vbs"/>
>



Re: Calling Functions or Subs in another <SCRIPT> by Al

Al
Tue Feb 22 20:34:28 CST 2005


"Brian Burgess" <bburgess66@hotmail.com> wrote in message
news:eGixHwJGFHA.560@TK2MSFTNGP15.phx.gbl...
> Hi all,
>
> Can anyone tell me how to call a function within one SCRIPT element
> (VBScript) from a function within a different SCRIPT element (also
> VBScript)?
>
> The called function is within a SCRIPT element with the RUNAT=SERVER
> attribute. And the calling function is within a SCRIPT that does not have
> this attribute.

It seems to me that what you want is near impossible. Client-side script
code can invoke a function residing in a different client-side script block
on the same page, because they share the same code space. Server-side script
is run on the server with only the results emitted to the client-side
browser, not the code itself.

/Al



Re: Calling Functions or Subs in another <SCRIPT> by Brian

Brian
Tue Feb 22 23:57:56 CST 2005

Agreed .. although facts remain facts regardless of whether or not I agree
;-)

I just thought I had seen a work-around for this posted here at one time.

Thanks anyways

-BB


"Al Dunbar [MS-MVP]" <alan-no-drub-spam@hotmail.com> wrote in message
news:%23kAI1AVGFHA.3728@TK2MSFTNGP14.phx.gbl...
>
> "Brian Burgess" <bburgess66@hotmail.com> wrote in message
> news:eGixHwJGFHA.560@TK2MSFTNGP15.phx.gbl...
> > Hi all,
> >
> > Can anyone tell me how to call a function within one SCRIPT element
> > (VBScript) from a function within a different SCRIPT element (also
> > VBScript)?
> >
> > The called function is within a SCRIPT element with the RUNAT=SERVER
> > attribute. And the calling function is within a SCRIPT that does not
have
> > this attribute.
>
> It seems to me that what you want is near impossible. Client-side script
> code can invoke a function residing in a different client-side script
block
> on the same page, because they share the same code space. Server-side
script
> is run on the server with only the results emitted to the client-side
> browser, not the code itself.
>
> /Al
>
>



Re: Calling Functions or Subs in another <SCRIPT> by JBFields

JBFields
Sun Mar 06 11:04:44 CST 2005

Oh, it's not that bad. It really is fairly elegant once you've taken
the class that teaches how:

<Job id="TypeLibExample">
<Reference Object = "CDO.Message"/> 'what ever the library...
<Script language="VBScript">
'code goes here
</Script>
</Job>

Save it as code.wsh instead of code.vbs then double-click it....

J


Re: Calling Functions or Subs in another <SCRIPT> by JBFields

JBFields
Sun Mar 06 11:08:06 CST 2005

Oops, better example:

<Job id="IncludeExample">
<script language="VBScript"src="secondscript.vbs">
'code that calls function in secondscript.vbs
</Script>
</Job>


Re: Calling Functions or Subs in another <SCRIPT> by Brian

Brian
Sun Mar 06 23:54:30 CST 2005

Ah thanks!

"JBFields" <jbfields@msn.com> wrote in message
news:1110128886.424221.190090@z14g2000cwz.googlegroups.com...
> Oops, better example:
>
> <Job id="IncludeExample">
> <script language="VBScript"src="secondscript.vbs">
> 'code that calls function in secondscript.vbs
> </Script>
> </Job>
>



Re: Calling Functions or Subs in another <SCRIPT> by JBFields

JBFields
Wed Mar 09 07:44:17 CST 2005

It's from Module 8 of the Microsoft 2433 VBScripting class. The more I
learn about XML the more I want to learn more about XML.