Windows Script Components  

<resource> Element

Isolates textual or numeric data that should not be hard-coded into the script component's scripts.

<resource id="resourceID">
   text or number here


A unique identifier for the resource within the script component.


The <resource> element allows you to isolate strings or numbers in your script component that you want to intermingle with script in your script component. For example, resource elements are typically used to maintain strings that might be localized into another language.

To get the value of a resource, call the getResource function, passing it the ID of the resource you want to use.


The following script component fragment defines a resource (called errNonNumeric) and demonstrates how to use it in script.

Note   A CDATA section is required to make the script in the <script> element opaque. For details, see Script Component Files and XML Conformance.
   <method name="random" internalName="getRandomNumber"/>
<resource id="errNonNumeric">
   Non-numeric value passed

<script language="VBScript">
Function getRandomNumber(upperBound)
   If IsNumeric(upperBound) Then
      getRandomNumber = Cint(upperBound * Rnd + 1)
   End If
End Function

See Also

Referencing Other Components