Rik's Treehouse
>
Babbling in Binary
>
My Software
>
Orphanware
>
R2DToo
>
R2DToo Help
>
Automation
> SetState
SetState
Declaration
Parameters
Return Value
Remarks
Example
See Also
Declaration
object.SetState(x,y,name,value)
Parameters
object
Required. Always the name of a
R2DToo.FrontEnd
object.
x,y
Required. Coordinates of agent. The top-left corner is (0,0).
name
Required. The name of an agent state variable (case insensitive).
value
Required. The value to set the parameter to.
Return Value
Returns 1 on success, 0 on fail.
Remarks
Attempts to set state variable
name
=
value
for agent at (
x
,
y
). If the state is not found or
x
or
y
are out of range then fails. Performs no bounds or error checking on
value
except to ensure it is a number. To refresh the display call
Refresh
after
SetState
.
Example
' [VBScript] ' load Dim R2DToo Set R2DToo = Wscript.CreateObject("R2DToo.FrontEnd") ' demonstrate method If R2DToo.SetState(5,12,"alive",1) Then R2DToo.Refresh WScript.Echo "Success!" Else WScript.Echo "Failed!" End If ' unload Set R2DToo = nothing
See Also
GetState
,
Refresh
.
[Rik's Office Hours]
[Contact Rik]
Last updated: Fri Apr 30 2004, 1:47pm