Statement: Action, Type: Initial
Call
Format: Call "method-name"
where
-
method-name = the text name of the method subroutine enclosed in quotation marks " " that will cause the program to pass control to the body of the subroutine.
Description
The Call identifier reads the method-name and causes the program to pass control to the body of the method-name subroutine. Program execution will then process the method subroutine until reaching the end of the control block or encounter the Return identifier. At this point control is then passed back to the original Call identifier and the program flow will continue forward from that point.
Example
When have a method subroutine make bets that will process action statements to place bets on the roulette layout Black. We also have a method subroutine to test if the roulette layout Black has not appeared for more than 5 times and set a data flag ready to bet to true based on the outcome of that condition. In the main body of the program, we will make two Call action statements, one to method check readiness and the other to method make bets. The following example will perform this task.
RX Script | ![]() |
---|---|
method "main" Call "check readiness" Call "make bets" end method "check readiness" Set Flag "ready to bet" to false If Black has not hit in more than 5 times begin Set Flag "ready to bet" to true end end method "make bets" If Flag "ready to bet" is False begin Return end Put 5 units on Black end |