NOTE: To view this document set tabs to 2 characters and set Word Wrap on. WRITING YOUR OWN COMPETITION MODULES In order to write your own competition modules you need to know what variables are used and how to define your module to the main program. VARIABLES USED Below is a list of variables used for calculating the scores and for displaying results on the main screen. All the module needs to do is calculate all results required and place them in the appropriate variables. The main program will display the results for you. par&(22) (1..18) = par for holes 1 to 18 (19) = total for holes 1 to 9 (20) = total for holes 10 to 18 (21) = (19) (22) = Sum of (19) and (20) stroke&(18) Strokes for holes 1 to 19 hcap&(4) Handicaps for players A, B, C and D score1%(23) (1..18) = score for holes 1 to 18 for player A (19) = total for holes 1 to 9 (20) = total for holes 10 to 18 (21) = (19) (22) = Sum of (19) and (20) (23) = (22) - handicap score2%(23) ditto for player B score3%(23) ditto for player C score4%(23) ditto for player D blkout1%(21) (1..18) = blackout for holes 1 to 18 for player A (boolean = 0 or 1) (19) = blackout for first nine (20) = blackout for second nine (21) = blackout for game blkout2%(21) ditto for player B blkout3%(21) ditto for player C blkout4%(21) ditto for player D mark1%(21) 1..18) = mark for holes 1 to 18 for player A (boolean = 0 or 1) (19) = mark forfirst nine (20) = mark for second nine (21) = mark for game mark2%(21) ditto for player B mark3%(21) ditto for player C mark4%(21) ditto for player D result1%(22) (1..18) = result for holes 1 to 18 for player A (19) = total for holes 1 to 9 (20) = total for holes 10 to 18 (21) = (19) (22) = Sum of (19) and (20) result2%(22) ditto for player B result3%(22) ditto for player C result4%(22) ditto for player D blkoutA% Blackout for player A (boolean = 0 or 1) blkoutB% Blackout for player B (boolean = 0 or 1) blkoutC% Blackout for player C (boolean = 0 or 1) blkoutD% Blackout for player D (boolean = 0 or 1) resAB$(6) Result for betterball for A+B (Maximum of six characters) resCD$(6) Result for betterball for C+D (Maximum of six characters) blkotAB% Blackout for betterball for A+B (boolean = 0 or 1) blkotCD% Blackout for betterball for C+D (boolean = 0 or 1) ADDING YOUR MODULE TO THE DATABASE The database consists of one record per competition and each record has two fields. The first field is the Description of the competition (maximum of 20 characters) as it appears in the maon program. The second field is the procedure name (maximum of 8 characters) to call that calculates the results of your competition. The order of the fields in the database is the order that they will appear in the menus. If you have more than 16 records then only the first 16 will be used. You need to re-start the Golf Assistant to reload the database entries. MAKING YOUR MODULE AVAILABLE TO THE MAIN PROGRAM Once you have translated your module copy it to the /system/apps/golfa5 directory. For an example competition module see the skins file. GOOD LUCK!