Statement: Identifier, Type: Keyword
Method
Format: Method "text-string"
begin-identifier
end-identifier
where
-
text-string = a unique text description of the method that is enclosed in quotation marks " ".
-
begin-identifier = the begin keyword identifier to denote the beginning of a control block
-
end-identifier = the end keyword identifier to denote the end of a control block.
Description
The Method is a control block containing various action and condition statements. When the compiler encounters a method identifier, the compiler will read the text-string and create a control block identified by the text-string. Each text-string must be unique otherwise the compiler will report a duplicate method error message.
The designed system initially must have at least one method identified as main somewhere in the program. When a spin is initiated, the program searches for the method main and control is passed to the method to start executing action and condition statements. Once the program has reached the end-identifier of the control block or an Exit identifier has been executed, control will be passed back to the main view awaiting for another spin to be processed.
You can create other methods known as subroutines and they can be placed anywhere within the designed system except inside the control block of method main. When you call a method, the program control passes from the point where the call is made to the body of the method. From there, the system will then execute all action and condition statements from the begin-identifier until the end-identifier of the control block or a Return identifier has been executed in which control is then passed back to the original calling point. If the Exit identifier has been encountered, control will be passed back to the main view awaiting for another spin to be processed.
Control Block
A control block of a method is identified with a begin and end identifier that goes with the method identifier. Just after the method text-string statement, a begin-identifier is required to tell the compiler that this is the beginning of the control block. For every begin-identifier there must be an end-identifier to denote the end of the control block.
Example 1
When designing a new system, the method main must exist somewhere in the program. The following example is displaying the method main and its proper format. Inside the control block is an example of a condition and action statement. Notice the begin-identifier just after the method main and the end-identifier located at the end of the control block.
RX Script | ![]() |
---|---|
method "main" begin if Black has not hit each time begin Put 5 units on Black end end |
Example 2
Below is an example of a subroutine method place bets. A Call action statement is used to access and pass control to a subroutine method. Once program reaches the end of the control block, control will be passed back to it calling originator.
RX Script | ![]() |
---|---|
method "place bets" begin Put 100% of Record "progression" data to Number 31 Put 100% of Record "progression" data to Number 1 Put 100% of Record "progression" data to Number 19 Put 100% of Record "progression" data to Number 21 end |
![]() |
All subroutine methods can be located anywhere in the designed system outside the control block of method main. |