Navigation: ABC Library Reference > WindowManager > WindowManager Methods >====== Run (run this procedure or a subordinate procedure) ====== | |
Run( [ number, request ] ), VIRTUAL, PROC
Run | Run this procedure, or run the specified subordinate procedure. |
number | An integer constant, variable, EQUATE, or expression identifying the subordinate procedure to run. A value of one (1) runs the first procedure, two (2) runs the second procedure, etc. Typically, this is the procedure's position within an EXECUTE structure. If omitted, Run executes the normal WindowManager Init-Ask-Kill sequence. |
request | An integer constant, variable, EQUATE, or expression identifying the action (insert, change, delete, select) the subordinate procedure takes. If omitted, Run executes the normal WindowManager Init-Ask-Kill sequence. |
The Run method executes the normal WindowManager Init-Ask-Kill sequence, or it runs the specified subordinate procedure on the same thread. Run returns a value indicating whether it completed or cancelled the requested operation.
Run | Executes the normal WindowManager Init-Ask-Kill sequence. |
Run(number, request) | A virtual placeholder method to execute a procedure identified by number. This allows other objects and template generated code to invoke subordinate WindowManager procedures by number rather than by name. The procedure runs on the same thread as the calling procedure. |
Return Data Type: BYTE
Implementation:
Return value EQUATEs are declared in \LIBSRC\TPLEQU.CLW as follows:
RequestCompleted EQUATE (1) !Update Completed
RequestCancelled EQUATE (2) !Update Cancelled
Example:
!procedure data
CODE
ThisWindow.Run !normal Init-Ask-Kill sequence
ThisWindow.TakeAccepted PROCEDURE()
CODE
!procedure code
IF SELF.Run(1,SelectRecord) = RequestCompleted !run a procedure on this thread
CLI:StateCode = ST:StateCode
ELSE
SELECT(?CLI:StateCode)
CYCLE
END
BrowseClass.Ask PROCEDURE(BYTE Request)
CODE
!procedure code
Response=SELF.Window.Run(SELF.AskProcedure,Request) !run a procedure on this thread
ThisWindow.Run PROCEDURE !do Init-Ask-Kill sequence
CODE
IF SELF.Init() = Level:Benign
SELF.Ask
END
SELF.Kill
RETURN GlobalResponse
ThisWindow.Run PROCEDURE(USHORT Number,BYTE Request) !run a subordinate procedure
CODE
GlobalRequest = Request
EXECUTE Number
SelectStates
UpdatePhones
END
RETURN GlobalResponse