Howto call function from one script block to another?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



This script (Utilities.wsf) fails with the error
Utilities.wsf(3, 4) Microsoft JScrip
t runtime error: Object expected

It works if I put the code into a single <script> element.

Is it possible to call a function defined in one script element from another
script element?


<job>
<script language="JScript">
var theDate = FormatDate("123");

WScript.Echo(theDate);
</script>
<script language="JScript">
//Format a Date for MindManager
function FormatDate(value)
{
return "2005-01-02";
}
</script>
</job>

--
Michael S. Scherotter
Business Solutions Architect
Mindjet LLC


.



Relevant Pages

  • Re: Runtime error (Do you wish to debug?) and www.
    ... script error.") worked for me to fix the following runtime error I was ... A Runtime Error has occurred. ... Program: iexplore.exe: Script program ... This will restore the Windows defaults for a whole lot of Search related ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • window.open methods causes my script crash in Internet Explorer
    ... I'm using window.open method in my script to open poup window. ... gives you runtime error and halts the script execution *if a 3rd party ... popup blocker is installed and active*. ... Only try-catch block allows you to prevent the script execution abort: ...
    (comp.lang.javascript)
  • Re: Runtime error - Error: MenuObj is undefined
    ... You don't mention the version of Windows, but, try the following and see if ... "A runtime error has occurred. ... Uncheck the box to "Display a notification about every script error." ... Does anyone know which CAB file needs to be reinstalled or can someone ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Rin time error with Internet Explorer
    ... next to "Disable script debugging in Internet Explorer" ... | Choose the following program types you wnat to debug: ...
    (microsoft.public.windowsxp.general)
  • Re: runtime error
    ... > I keep getting a runtime error and it asks me if I'd like ... Uncheck the box to Display a notification about every script error. ... Sometimes there's a corrupt file in the cache and one must go to Tools | ... Dealing with Hijackware ...
    (microsoft.public.windows.inetexplorer.ie6.browser)