Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project











ELEMENT:  <script>

The <script> tag is used to insert a block of code into the .wsf XML data structure. With <script> tags, one can easily mix code written in different languages in the same execution block. External code can also be imported into a .wsf file via the <script> tag.

Syntax: <script language="language" [src="strFilePath"]>...</script>

Attribute: language
The optional language attribute is used to specify which script engine is used to interpret the code inside the script tags. If the language attribute is omitted, the default script engine (JScript) is used.

Attribute: src
The optional src attribute can be used to import external code into the current .wsf file.

The following sample code illustrates various flavors of this tag.

<?XML version="1.0" ?>
<!-- Filename: demo.wsf-->
<package>
  <job>
    <script type="text/vbscript">
      WScript.Echo "This is VBScript"
    </script>
    <script language="JScript">
      WScript.Echo ("This is JScript") ;
    </script>
    <script language="VBScript" src="extcode.vbs">
      WScript.Echo "Echo from internal code."
    </script>
    <script language="VBScript" src="extcode.vbs"/>
  </job>
</package>


File: extcode.vbs
WScript.Echo "Echo from external code"

Output:
This is VBScript
This is JScript
Echo from external code
Echo from internal code
Echo from external code

 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information