The first thing that you need to know is how to use Dim and add the score.
A
Dim is VisualBasic Scripting's name for a Variable. Variables are memory placeholders that are used to store values that you wish to save. In other programming languages, a variable is known as a Dim, a variable, a var, and there may be others.
At the top of the editor click File > New Table.
Open the table's Script and at the top of the script type:
Dim Score
Now below that line, create this Sub. You can Copy/Paste the following into the script:
Code:
Sub AddScore(Points)
Score = Score + Points
ScoreText.Text = Score
End Sub
Now, when you place a Bumper on the Table, keep it Highlighted in blue or click on it to highlight it and go to the script. You can also go to the script and use the top left Pull-down to select the Bumper. Then from the Right-side Pull-down in the script window select Hit().
The script will automatically create the Sub Bumper1_Hit()
Inside of this Sub, between the Sub and End Sub statements, type this:
AddScore 100
This statement tells the program to go to the Sub AddScore and to execute the statements within the Sub, in this case,
Add 100 points to the Dim Score that you created. The value of 100 is passed as the parameter of (Points) to the Sub AddScore(Points). Here, Points is operating as an Internal Dim (Points) and the value 100 is an assumed parameter value by the declaration in the Sub heading (Points)
You can use any unique name for the Dim, as long as the name is not the same as any other Dim or any command statement.
Now, when you play the table and hit the Bumper1, you should see 100 Points added to the ScoreText display.
Note: You can use any TextBox that you place on the Table >Backglass editor screen to display the score, or whatever data you choose to display. Just remember that if you rename ScoreText or a TextBox to another name that you create for the TextBox, say TextBox1, or
Zots, etc., then to always use that name in script when calling it and to choose a Unique Name different from all other Objects and Command Statements.
Example:
Code:
Sub AddScore(Points)
Score = Score + Points
[b]Zots[/b].Text = Score
End Sub
Note that the statement
Zots.Text = Score tells the program that the .Text to be displayed in the TextBox named Zots will be the value saved by the program in the Dim Score.
Any value that you save to a Dim, be it a number or a word (a Text String) will be displayed in the TextBox that you choose when you tell the program to do so using the .Text method.