executeIn

Syntax

&MyMethod.executeIn(CallAt:time[,Argument1:any, ...]) → boolean
&MyMethod.executeIn(CallAt:dateTime[,Argument1:any, ...]) → boolean

The method executeIn calls a Method after the number of seconds designated by the parameter of data type time has elapsed. Plant Simulation enters an event into the List of scheduled events in the EventController for the amount of seconds you entered for time after the current simulation time. Since the Method will be called at some time in the future, time must be greater than or equal to 0. For parameters of data type dateTime or date, Plant Simulation computes the time span using the date of the EventController and the date designated by the parameters dateTime or date.

In the called Method the anonymous identifier ? references the caller, i.e., the Method which contained the Method executeIn or if the caller is a user-defined attribute of data type method it references the location of this user-defined attribute.

Parameters

  • The parameter CallAt of data type time designates the time in seconds after which the Method will be called.

  • The following optional parameters (Argument1, ...) of data type any are passed when the Method is called the next time.

    Note:

    The point in time of the method call has to be in the future.

Return Value

The return value has the data type boolean.

Example

&MyMethod1.executeIn(23.5)
-- throttle the engine in 5 seconds to 85 percent
&ThrottleEngine.executeIn(5, 0.85)
-- New years day 2000 midnight
&MyMethod2.executeIn(str_to_date("1.1.00"))
-- call the method which a local variable references
var obj: object := &MyMethod3
obj.executeIn(4, "my string", true)

Related Topic

deleteexecuteIn