Home News DOC Class DL Others Rice
Class  >  switch  >  OneShot()
switch class : OneShot() method

Description

Starts the event handling.

Syntax

instance.OneShot()

Arguments

None

Return value

None

Sample code

Suppose you have the following class definition.

1:

class handle

2:

open method void LCHandler(dictionary dic)

3:

... // event handler code.

4:

endmethod

5:

endclass

Usage of the OneShot() method is as follows.

1:

browser b = new browser();

2:

handle h = new handle();

3:

switch sw = b.LoadCompleted(h,"LCHandler(dictionary)");

4:

sw.OneShot(); // The handler method will be called just once.

Notes

When the event occurs, calls the handler method only once.

Event handling stops after the call.

If this method is already called, re-call will be ignored.

Links for reference

None

Copyright © Rice All rights reserved.