Do

Command groupFlag affectedReversibleExecute on clientPlatform(s)
CalculationsNONOYESAll

Syntax

Do
 
calculation
 
Returns 
return-value

Description

This command executes the specified calculation, which is typically some notation that operates on a particular object or part of your library. It returns a value if you specify a return-value, which can be a variable of any type.

Note that where the return field is an item reference, the command sets the reference but does not assign to it: you must do this with Calculate or Do Itemref.$assign(value).

Example

# open a new window instance of the window class wMyWindow maximized

Do
 
$clib.$windows
.
wMyWindow
.
$open
(
'*'
,
kWindowMaximize
)

 
# redraw the current window instance

Do
 
$cwind.$redraw
()

 
# redraw EntryField1 on the top window

Do
 
$topwind.$objs
.
EntryField1
.
$redraw
()

 
# return a list in the local variable lClassList of all classes in the current library

Do
 
$clib.$classes.$makelist
(
$ref.$name
)
 
Returns 
lClassList

 
# close all open window instances

Do
 
$iwindows.$sendall
(
$ref.$close
())

 
# set the $textcolor property of the current object to red

# the optional return field can be used to check whether the operation succeeded

Do
 
$cobj
.
textcolor
.
$assign
(
kRed
)
 
Returns 
lFlag