This processes the hitting statistics for a selected team as well as allowing updates to and adding new players to the batting SQL Table.
This program can be either executed from the main menu, or can run as a stand-a-lone program. Some of the functions will slightly change, but all the main processing will be the same, regardless of how the module is started.
At the bottom of this HELP display is a legend showing what each column in the boxscore means, and in some cases, how it's calculated.

Displaying the Hitting Boxscores
Once you enter a team name and click the [OK] button, you will see a screen similar to the one above. The application tracks a variety of baseball/softball stats, which are first displayed for you. From here you may send the results to the printer, update them, or go back and enter another team.

If you are entering data for a new team, you would enter the team name in the Team Input screen. Let's say we want to add the Astros to our database. After entering Astros in the team name of the Team Input screen, you will get a display like the one above. Since there is no data for the Astros, a blank screen appears. If you click the [Update] button, you will be taken to the update screen where you can add the stats for the new team, and they will be added to the database tables. Once that happens, whenever you input Astros, it will display all the data you've entered.
The Buttons - And What They Do
There are five buttons, along with the "x" in the upper right-hand corner of the screen. Here are the actions they perform:
| [Cancel] | Cancels out of the current display and re-displays the first screen. |
| [OK] | Clears the current screen and displays the next. If on the Pitching Stats screen, the application will re-display the League Standings screen. |
| [Report] | Formats the current display and prints it on the default printer. |
| [HELP] | Displays this screen. |
| [QUIT] | Cancels out of current screen and either returns to main menu or ends if running stand-a-lone. |
| [x] | This works the same as the [QUIT] button. |

Updating Hitting Stats
You have a boxscore from a game you need to update. From the screen above, you can add new data to both existing players and new players that have no game records in the batting table.
For existing players, place a check mark (as shown above) next to each player you wish to add new game stats for. For players not in the current display, you will be able to add them once you click the [Update] button.

The next screen (shown above) is displayed when you select the [Update] button, and is the one you will use to add game stats for both existing and new players. For each player you checked off in the screen prior, a record has already been placed on the Stats Update screen. You will also noticed that GAMEID has been filled with "ALE-10" as was provided in the Team/Game input box, as well as a "1" also provided in the GP column. If you did not provide a GAMEID or a Games Played value in the Team Input Box, then GAMEID will be blank, and GP will have a "1" in it.
You will also notice that the very first column there is a lowercase "u". This is important, as you will later see that two things must be done in order to apply any update. That "u" must be present, and all records to update must be selected.

Next, enter the values you need to update. As you can see above, I have started to enter data for LeMahieu. To enter data, click on the column and you will be able to input into it. You only have to enter data that you have. All fields are initialized as ZEROES. Do this for all data you have.
Also, say you made a mistake and put in the wrong GameID. On this screen you can also change it. Same can be done with with GP. If you decide that you do not wish to update a player, say you selected him/her by error, you can remove the "u" next to the name.
You can also add multiple game records for the same player. In the example above (and highlighted on orange) I added another set of game stats for DJ LeMahieu for gameID "ALE-11". Not only can you add new players that did not appear in the boxscore display screen, but you add multiple records for the same player. The application, when applying the updates, treats each update as a separate transaction.

In the above, you can see that I have added a player (it can be a new player or existing one), and decided to remove the "u" from the players I do not wish to update. In order for Zenity to pass the changes to the application, you must select them by using the standard keyboard-mouse selection technique [SHIFT] + Left-click on the mouse to select a range, or [CTRL] and left mouse-click to select/un-select individual records.
NOTE: Zenity is the GUI that this application uses to process all menus, displays, and updates. Zenity is the new incarnation of gdialog. Both are GNOME GUI systems.
To update a record, remember, you must have both the "u" in the "S" column (S=Select, u for Update), and the record must be selected (highlighted in Orange as the above shows). To finalize all updates, click the [Commit] button to process all updates selected. To cancel all the updates before they are applied, either click on the [Cancel] or [QUIT] buttons (click on the [X] does the same thing).
In the example above, there are several types of updates. First, LeMahieu has a second record with GAMEID of "ALE-11". If I had to, I could have combined both games into one record, and changed GP from a 1 to a 2. You have the flexibility to update multiple players with multiple game data. The only limit currently is that you can only do 25 updates at once. A future release will remove this restriction. It was originally put into place because MLB has a 25-man roster restriction, which means each game can have no more than 25 players playing in one game. However, since the requirements changed to potentially allow multiple records per player, you may have more than 25 updates if you are behind in your updates. For now, you can do multiple updates.
In the above update screen, the only updates that will be done above is for LeMahieu, Judge, Urshela, and Torres. All have both a "u" and are highlighted. Both must be done in order for the update to take. Even though Hicks has a "u" in the S column, he isn't selected. Zenity will not pass this record to the application. Encarnacion is highlighted, and will be passed to the application by Zenity. However, the application will check to see if "u" set. If not, the application will ignore that record and any record without a "u".
The reason that you need a "u" in the S-Column is that in a future release, this screen will also allow you to edit and delete records. For now, update is the only option available.
   Legend: Statistics Column Definitions
The following details what each column means, and in some cases, how they are calculated:
   | GMSP (Games Played) | Number of games in which the player has appeared. |
| AB (At Bats) | Number of trips to the plate in which the batter does not walk, get hit by a pitch, sacrifice (fly or bunt), or reach on interference. |
| R (Runs Scored) | Number of runs scored. |
| H (Hits) | Number of hits. |
| RBI (Runs Batted In) | Number of times a run scores as a result of a batter’s plate appearance, not counting situations in which an error caused the run to score or the batter hit into a double play. |
| 2B (Doubles) | Number of doubles. |
| 3B (Triples) | Number of triples. |
| HR (Home Runs) | Number of home runs |
| BB (Base on Balls or Walks) | Total number of base-on-balls/walks (includes intentional walks). |
| K (Strikeouts) | Number of strikeouts. |
| HBP (Hit By Pitches) | Number of times the batter reached base after being hit by a pitch. |
| (Sacrifice: Flies & Bunts) | Any bunt in which there was a runner on base and less than two outs in which the batter was put out and at least one runner advanced or the number of times a batter’s fly out allowed a runner to tag up and score. |
| SB (Stolen Bases) | Number of successful stolen bases. |
| ASB (Attempted Stolen Bases) | Total number of times player tried to steal a base (successful or not). |
| PO (Putouts) | Total number of outs performed in the field of play by any player other than the pitcher. This includes fly outs, tag outs, force outs, and all outs made by illegal plays. A putout goes into the record of the player most directly responsible for it occurring. |
| AST (Assists) | Number of times when a player in a fielding position touches or throws a ball in play that results in a putout. |
| E (Error) | Number of times when, in the official scorer's judgment, a fielder fails to convert an out on an average play, or if a fielder makes a poor play, allowing runners to advance on the bases or the hitter to reach a base safely. |
| AVG (Batting Average) | Rate of hits per at bat, calculated as H/AB. |
| SLG (Slugging Percentage) | Average number of total bases per at bat, calculated as Total Bases/AB [Total Bases = (H-(2B+3B+HR))+(2B*2)+(3B*3)+(HR*4)] |
| OBP (On Base Percentage) | Rate at which the batter reaches base, calculated as (H+BB+HBP)/(AB+BB+HBP+SAC) |
| OPS (On Base Plus Slugging) | Combination of OBP and SLG, calculated as OBP+SLG. |
| FPCT (Fielding Percent) | A percentage or average of a defensive player's correct/errorless handling a batted or thrown ball, calculated as (putouts + assists) / (putouts + assists + errors) |