In the last post the label and numberbox (spinner) control was added for how many numbers the user wanted to play. We start this post with the addition of two more number boxes, one for number of games to play (1-999) and one that we will use in this session to select which numbers the user wants to play. Here’s what the updated screen looks like :
The default number of games to play is 10, and the starting point for selecting a number is 40, the middle of the keno board. In review here is what the number box code looks like for the two new ones, labels in the first picture and the set up code for the numbboxes:
From the highlighted code block above then number of games numberbox value will be in variable VI, and we can see it set to the default value of 10 in line 60107. Similarly VK =40 in line 60110 will be used for the selction of a number to play. Also the callback routine line numbers are 1800,1900 and 20000, 21000 for the games to play and selected numbers. The code at 18000 is show below with min of 1 being tested in line 18000 and max of 999 tested in line 19000, for the number of games to play.
Moving on to selecting number to play, this will require a bit of user code to be written in the scratch pad. First a button will be added to be used to select the number from the previously added number box. To add the button let’s take a look at the RGI interface. A button object is added ast 22, 20 with width 5 and the caption “Add”.
The updated progam screen :
This is view number 12 for this program (and the 13th total since the count starts at 0). So there are only 3 left for use. The purpose of this button is to a. store off the number selected buy the user for checking later for a “hit” when the game is played, and also to mark on the board with ** the numbers the player has selected. This will be accomplished it the callback subroutine for the Add button. Looking the the automatically generated code we see the callback line number is 22000. We also know that RGI puts in a rem statement at 22000 and a return at 22999.
In the next post the callback funtion code store and mark the board will be added.