Windows Vista Forums

Events with parameters in windows script components
  1. #1


    vorpal Guest

    Events with parameters in windows script components

    this is legal:
    <event name="Cycle">
    <PARAMETER name="LoopCount"/>
    </event>

    At least, it raises no errors.

    Firing the events like so:
    fireEvent "Cycle"

    Also suceeds, even with the parameter included as above.
    This event handler sinks the event correctly:
    Sub oTL_Cycle()
    WScript.Echo "Cycle: " & oTL.LoopCount
    End Sub

    How do I get the parameter passed to the event, so I can sink it with:
    Sub oTL_Cycle(LoopCount)
    WScript.Echo "Cycle: " & LoopCount
    End Sub

    I tried this:
    fireEvent "Cycle",gnLoop

    Any help appreciated...
    --Vorpal



      My System SpecsSystem Spec

  2. #2


    mr_unreliable Guest

    Re: Events with parameters in windows script components

    vorpal wrote:

    > Any help appreciated...
    > --Vorpal
    Vorpal, I'm not sure how to answer your direct question,
    but if you read the wsc documentation, then you will find
    a different way of passing back event parameters, i.e.,
    by using the oEvent "Event Object" created via the
    "CreateEventObject" method.

    Look up the "fireEvent Method" in the "microsoft windows
    script component" documentation. You can (probably) find
    the documentation somewhere on the microsoft scripting
    website, but I have attached a copy of that page (in html
    -- hope it can be read o.k., and if not I'll just send
    it in text).

    cheers, jw
    ____________________________________________________________

    You got questions? WE GOT ANSWERS!!! ..(but,
    no guarantee the answers will be applicable to the questions)



      My System SpecsSystem Spec

Events with parameters in windows script components problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing parameters to a PS script Dan PowerShell 11 11 Nov 2009
Startup Script Via GPO... Where Are Parameters Stored? trading_jacks VB Script 1 22 May 2009
Script Parameters David PowerShell 4 17 Jul 2007
passing parameters to script (ps1) IT Staff PowerShell 1 19 Oct 2006
How to run PS script with parameters from cmd batch file? =?Utf-8?B?Um9tYW4gS3V6bWlu?= PowerShell 5 22 Jul 2006