Re: Global subroutine - doesn't work

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: John C (johnch_at_paradise.net.nz)
Date: 03/01/04


Date: Mon, 1 Mar 2004 20:39:38 +1300

Thanks, but it doesn't seem to work. Must be me.

I have the following in my script file (name "scripts.vb" in same
directory):

<script language="VBScript">
Sub PrintDetails(CompName, Discount)
document.writeln(Date)
document.writeln("Coupon from " & CompName)
document.writeln("Your discount is " & Discount & "% !!!")
End Sub
</script>

and the following in my form-file:

<script language="VBScript" src="scripts.vb">
PrintDetails"My Company Ltd","10"
</script>

Any idea why this is not working? Error message refers to line 1 of the
scripts file.

TIA
John

"MD Websunlimited" <none@none.com> wrote in message
news:O$svvwx$DHA.3400@tk2msftngp13.phx.gbl...
> Hi John,
>
> Place in a script.vb file then use
> <script language="VBScript" src="script.vb" >
> </script>
>
> "John C" <johnch@paradise.net.nz> wrote in message
news:hHt0c.29435$ws.3280021@news02.tsnz.net...
> > Hi all,
> >
> > How can I create a Global subroutine.
> >
> > I have the following local subroutine,
> >
> > <script language="VBScript">
> > Sub PrintDetails(CompName, Discount)
> > document.writeln(Date)
> > document.writeln("Coupon from " & CompName)
> > document.writeln("Your discount is " & Discount & "% !!!")
> > End Sub
> > </script>
> >
> > but needs to be called from many forms. Thus needs to be global visible!
> >
> >
> > How do I set that up?
> >
> > TIA,
> > John
> >
> >
>
>



Relevant Pages

  • using WScript.CreateObject("Wscript.Shell
    ... Sub Test() ... Dim objShell As Object ... FTP02.BAT points to a script file that will "get" a file from an IBM ... an external source before the spreadsheet data is shown. ...
    (microsoft.public.excel.programming)
  • Global subroutine
    ... How can I create a Global subroutine. ... Sub PrintDetails(CompName, Discount) ... document.writeln("Coupon from " & CompName) ...
    (microsoft.public.frontpage.programming)
  • Re: Global subroutine - does still not work!
    ... As you can see I have the Sub here in the same source file but the call to ... subroutine refers to the script file at "c:\temp\scripts.txt" ... > "John C" wrote in message ...
    (microsoft.public.frontpage.programming)
  • RE: Need advanced help with tracking down warnings in evald functions
    ... The init section is eval'd right ... When a warning happens in the script file below, ... script_desc 'Scripts to add and remove bookmarks'; ... sub remove_script_file { ...
    (perl.beginners)
  • Re: Global subroutine
    ... > How can I create a Global subroutine. ... > I have the following local subroutine, ... > Sub PrintDetails ...
    (microsoft.public.frontpage.programming)