home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Rally(Input,Output,Rally_File);
-
- { A program to keep track of fun car rallys. First create a file, then load
- it. You may then edit the data, adding team names and info into the array.
- The array is saved using the Save file feature. To score the results you
- MUST enter the Set scoring menu and access all entries. Only the Points/}
- {question item must have a number entered however. This way, rallys that do
- not count off for mileage, time, etc, can use the system. When all Set Scoring
- item have been entered, Compute Scores will become active. After compute
- scores is executed, Show Places will be activated (shows up next to the score
- in the edit dialog box.) and the Winners feature will be active. }
- { The program will always show a place, if Show Places is turned on. If no
- score has been computed for a team, the place is the same as the team number.
- Winners will only show those teams that have a name other than Not Used ....
- Ties are not shown as such, but revert to the order of team number for the
- order of finish (Check the score shown to be sure you don't have a tie.}
- { Groupings allows a group of cars to compete against another group of cars.
- The average score of all the cars in a grouping is used in determining the
- group finish order. There is a max of 8 groupings allowed. Only the first
- three and last place are shown.}
-
- { Address any comments to:
- David Chiquelin
- 501 Woodbine Circle
- Papillion, NE 68128
-
- CIS 71336,1443
- Delphi DCHIQUELIN
- ANALOG TCS 1099
- GENIE D.CHIQUELIN
- or
- Atari-O! BBS (402) 592-4435 300/1200 baud
- (Sysop) }
-
- {P.S. There is a bug that causes the mouse control to not work properly for
- several 'clicks' after exiting the program. If you can fix this, let me know!
- I have also figured out a way with to reduce the size of the program, which I
- intend to use on my next project, a golf handicap program. But this one works,
- so I didn't go back to modify it...}
-
-
- CONST
- {$I GEMCONST.PAS}
- max_participants = 60;
-
- TYPE
- {$I gemtype.pas}
-
- rally_record = RECORD
- team_name : STRING[25]; {Below comments are for the first rec}
- driver : STRING[25]; {only! ... it is called Official}
- nav : STRING[25];
- obs1 : STRING[25]; {Points lost for being late to start}
- obs2 : STRING[25]; {Points lost for help calls}
- time_position : STRING[25]; {Points lost for car inspec violations}
- division : STRING[25];
- correct : INTEGER; {Points/question answered correctly}
- calls : INTEGER; {Miles for first rate of points/mile}
- late_to_position : INTEGER; {points/mile at first rate}
- violation : INTEGER; {points/mile after first rate ends}
- start_time : STRING[25];
- end_time : STRING[25]; {Official time for course}
- total_time : STRING[25];
- total_secs : INTEGER; {Official time in secs}
- start_miles : REAL; {Official mileage for course}
- end_miles : REAL; {Seconds at first points/sec rate}
- total_miles : REAL; {points/sec at first rate}
- total_score : INTEGER {points/sec after first rate}
- END; {file_record description}
-
- place_record = RECORD
- score : INTEGER;
- team_number : INTEGER;
- used : BOOLEAN
- END;
-
- place_array = ARRAY[1 .. max_participants] OF place_record;
-
- division_type = RECORD
- name : STRING[4];
- total : LONG_INTEGER;
- number : INTEGER;
- average : INTEGER
- END;
-
- VAR
- menu,
- which_menu,
- menu2,
- menu3 : Menu_Ptr;
-
- dummy,
- file_title,
- score_title,
- quit_title,
- set_scoring_title,
- data1_title,
- data2_title,
- data3_title,
- data4_title,
- exit_title,
- create_item,
- old_item,
- enter_results_item,
- save_data_item,
- show_place_item,
- winner_item,
- official_miles_item,
- official_time_item,
- points_per_question_item,
- points_sub_miles_item,
- points_lost_time_item,
- points_late_item,
- points_calls_item,
- points_violat_item,
- quit_item,
- comp_scores_item,
- exit_item,
- ok_btn,
- cancel_btn,
- button,
- name_item,
- driver_item,
- nav_item,
- obs1_item,
- obs2_item,
- pos_time_item,
- division_item,
- correct_item,
- calls_item,
- late_item,
- violate_item,
- st_time_item,
- overall_title,
- first_o_item,
- second_o_item,
- third_o_item,
- last_o_item,
- time_title,
- first_t_item,
- second_t_item,
- third_t_item,
- last_t_item,
- miles_title,
- first_m_item,
- second_m_item,
- third_m_item,
- last_m_item,
- exit2_title,
- exit2_item,
- div_title,
- div1_item,
- div2_item,
- div3_item,
- div4_item : INTEGER;
-
- data1_item : ARRAY[1..15] OF INTEGER;
- data2_item : ARRAY[1..15] OF INTEGER;
- data3_item : ARRAY[1..15] OF INTEGER;
- data4_item : ARRAY[1..15] OF INTEGER;
-
- edit : ARRAY[20..88] OF INTEGER;
-
- quit,
- win_enable,
- place_show,
- group_enable : BOOLEAN;
-
- alert : Str255;
-
- path : Path_Name;
- dialog : Dialog_Ptr;
-
- rally_file : FILE OF rally_record;
- printer_file : FILE OF char;
-
- rally_data : ARRAY[1..60] OF rally_record;
- score_places : place_array;
- time_places : place_array;
- miles_places : place_array;
-
- score_ability : ARRAY[1..8] OF BOOLEAN;
-
- temp_data : rally_record;
- official : rally_record; { Used to hold 'official' data }
-
- division_array : ARRAY[1..9] OF division_type;
-
- {$I gemsubs}
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Menu_Set2;
-
- BEGIN
- menu3 := New_Menu( 24, ' Road Rally ' );
- overall_title := Add_MTitle( menu3, ' Overall ' );
- time_title := Add_MTitle( menu3, ' Time ' );
- miles_title := Add_MTitle( menu3, ' Mileage ' );
- div_title := Add_MTitle( menu3, ' Groupings ' );
- exit2_title:=Add_MTitle( menu3, ' Exit ');
-
- first_o_item := Add_MItem( menu3,overall_title, ' First Place ... ' );
- second_o_item := Add_MItem( menu3,overall_title, ' Second Place ... ' );
- third_o_item := Add_MItem( menu3,overall_title, ' Third Place ... ' );
- last_o_item := Add_MItem( menu3,overall_title, ' Last Place ... ' );
- first_t_item := Add_MItem( menu3, time_title, ' First Place ... ' );
- second_t_item := Add_MItem( menu3, time_title, ' Second Place ... ' );
- third_t_item := Add_MItem( menu3, time_title, ' Third Place ... ' );
- last_t_item := Add_MItem( menu3, time_title, ' Last Place ... ' );
- first_m_item := Add_MItem( menu3,miles_title, ' First Place ... ' );
- second_m_item := Add_MItem( menu3,miles_title, ' Second Place ... ' );
- third_m_item := Add_MItem( menu3,miles_title, ' Third Place ... ' );
- last_m_item := Add_MItem( menu3,miles_title, ' Last Place ... ' );
- div1_item := Add_MItem( menu3,div_title, ' First Place ... ' );
- div2_item := Add_MItem( menu3,div_title, ' Second Place ... ' );
- div3_item := Add_MItem( menu3,div_title, ' Third Place ... ' );
- div4_item := Add_MItem( menu3,div_title, ' Last Place ... ' );
- exit2_item := Add_MItem( menu3, exit2_title, ' Exit to main menu ... ')
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Menu_Setup;
-
- VAR
- count : INTEGER;
-
- BEGIN
- menu := New_Menu( 40, ' Road Rally ' );
- file_title := Add_MTitle( menu, ' File ' );
- score_title := Add_MTitle( menu, ' Score ' );
- quit_title:= Add_MTitle(menu,' Quit ');
- set_scoring_title:=Add_MTitle(menu,' Set Scoring ');
- create_item := Add_MItem( menu, file_title, ' Create File ... ' );
- old_item := Add_MItem (menu, file_title, ' Load Data File ... ' );
- enter_results_item := Add_MItem( menu, file_title, ' Edit Data ... ');
- save_data_item := Add_MItem( menu, file_title,' Save Data File ... ');
- show_place_item := Add_MItem( menu, score_title, ' Show Places? ... ' );
- winner_item := Add_MItem( menu, score_title, ' Winners ... ' );
- comp_scores_item := Add_MItem( menu, score_title, ' Compute Scores ... ' );
- quit_item:=Add_Mitem(menu,quit_title, ' Quit ');
- official_miles_item:=Add_MItem( menu, set_scoring_title,
- ' Official Mileage ... ');
- official_time_item:=Add_MItem( menu, set_scoring_title,
- ' Official Time ... ');
- points_per_question_item:=Add_MItem( menu, set_scoring_title,
- ' Points/Question ... ');
- points_sub_miles_item:=Add_MItem( menu, set_scoring_title,
- ' Points/Mile Lost ... ');
- points_lost_time_item:=Add_MItem( menu, set_scoring_title,
- ' Points/Second Lost ... ');
- points_late_item:=Add_MItem( menu, set_scoring_title,
- ' Points/Minute Late ... ');
- points_calls_item:=Add_MItem( menu, set_scoring_title,
- ' Points/Call Lost ... ');
- points_violat_item:=Add_MItem( menu, set_scoring_title,
- ' Points/Car Violation ... ');
- menu2 := New_Menu( 70, ' Road Rally ' );
- data1_title:= Add_MTitle( menu2,' Data 1 ');
- data2_title:=Add_MTitle( menu2, ' Data 2 ');
- data3_title:=Add_MTitle( menu2, ' Data 3 ');
- data4_title:=Add_MTitle( menu2, ' Data 4 ');
- exit_title:=Add_MTitle( menu2, ' Exit ');
- FOR count:=1 TO 15 DO
- BEGIN
- data1_item[count]:=Add_MItem( menu2, data1_title,
- ' .........................');
- edit[data1_item[count]]:=count
- END;
- FOR count:=1 TO 15 DO
- BEGIN
- data2_item[count]:=Add_MItem( menu2, data2_title,
- ' .........................');
- edit[data2_item[count]]:=count+15
- END;
- FOR count:=1 TO 15 DO
- BEGIN
- data3_item[count]:=Add_MItem( menu2, data3_title,
- ' .........................');
- edit[data3_item[count]]:=count+30
- END;
- FOR count:=1 TO 15 DO
- BEGIN
- data4_item[count]:=Add_MItem( menu2, data4_title,
- ' .........................');
- edit[data4_item[count]]:=count+45
- END;
- exit_item:=Add_MItem( menu2, exit_title, ' Exit to main menu ');
- Menu_Set2
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Make_Integer(str : STR25 ; VAR intgr : INTEGER);
-
- VAR
- X : INTEGER;
- A : CHAR;
- num : INTEGER;
- size : INTEGER;
-
- BEGIN
- intgr := 0;
- size:=Length(str);
- FOR X:=size DOWNTO 1 DO
- BEGIN
- A:=str[size+1-X];
- CASE A OF
- '0' : num:=0;
- '1' : num:=1;
- '2' : num:=2;
- '3' : num:=3;
- '4' : num:=4;
- '5' : num:=5;
- '6' : num:=6;
- '7' : num:=7;
- '8' : num:=8;
- '9' : num:=9
- END;
- intgr:=intgr+TRUNC((num*PwrOfTen(X-1)))
- END { FOR loop }
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Check_Data;
-
- VAR
- count,
- num_correct,
- X : INTEGER;
- test : BOOLEAN;
-
- BEGIN
- count:=0;
- num_correct:=0;
- For X:=1 TO max_participants DO
- WITH rally_data[X] DO
- BEGIN
- test:=FALSE;
- IF team_name <> 'Not Used ... ' THEN
- BEGIN
- count:=count+1;
- IF correct<>0 THEN
- IF total_secs<>9999 THEN
- IF TRUNC(total_miles)<>999 THEN
- BEGIN
- num_correct:=num_correct+1;
- test:=TRUE
- END;
- END;
- IF X<16 THEN Menu_Check(menu2,data1_item[X],test)
- ELSE IF X<31 THEN Menu_Check(menu2,data2_item[X-15],test)
- ELSE IF X<46 THEN Menu_Check(menu2,data3_item[X-30],test)
- ELSE Menu_Check(menu2,data4_item[X-45],test)
- END;
-
- IF num_correct<count THEN
- BEGIN
- alert := '[1][All entries are not complete][ OK ]';
- dummy := Do_Alert( alert, 1)
- END
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Do_Score( X : INTEGER);
-
- VAR
- counter,
- seconds,
- switch_secs,
- time1_points,
- late,
- call,
- violate : INTEGER;
- miles : REAL;
-
- BEGIN
- switch_secs:=TRUNC(official.end_miles+0.1);
- time1_points:=TRUNC(official.total_miles+0.1);
- Make_Integer(official.obs1,late);
- Make_Integer(official.obs2,call);
- Make_Integer(official.time_position,violate);
- WITH rally_data[X] DO
- BEGIN
- total_score:=correct*official.correct-(violation*violate)
- -(late_to_position*late)-(calls*call);
-
- IF total_secs<official.total_secs THEN
- seconds:=official.total_secs-total_secs
- ELSE seconds:=total_secs-official.total_secs;
-
- FOR counter:=1 TO max_participants DO {Use to determine best time}
- IF time_places[counter].team_number = X THEN
- BEGIN
- time_places[counter].score:=seconds*(-1);
- time_places[counter].used:=TRUE
- END;
-
- IF seconds>=switch_secs THEN
- BEGIN
- total_score:=total_score-(switch_secs*time1_points);
- seconds:=seconds-switch_secs;
- total_score:=total_score-(seconds*official.total_score)
- END
- ELSE total_score:=total_score-(seconds*time1_points);
-
- IF total_miles<official.start_miles THEN
- miles:=official.start_miles-total_miles
- ELSE miles:=total_miles-official.start_miles;
-
- FOR counter:=1 TO max_participants DO {Use to determine best mileage}
- IF miles_places[counter].team_number = X THEN
- BEGIN
- miles_places[counter].score:=TRUNC(miles*10+0.1)*(-1);
- miles_places[counter].used:=TRUE
- END;
-
- IF miles>=official.calls THEN
- BEGIN
- total_score:=total_score-(official.calls*official.late_to_position*10);
- miles:=miles-official.calls;
- total_score:=total_score-TRUNC((miles*official.violation*10)+0.1)
- END
- ELSE total_score:=total_score-TRUNC((miles*official.late_to_position*10)
- +0.1);
-
- END; {WITH rally_data DO}
- FOR counter:=1 TO max_participants DO
- IF score_places[counter].team_number = X THEN
- BEGIN
- score_places[counter].score:=rally_data[X].total_score;
- score_places[counter].used:=TRUE
- END
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Do_Order(VAR temp_p : place_array);
-
- {A bubble sort of the order of the contestants}
-
- VAR
- p_loop : INTEGER;
- done : BOOLEAN;
- temp_p2 : place_record;
-
- BEGIN
- REPEAT;
- done:=TRUE;
- FOR p_loop:=1 TO (max_participants-1) DO
- IF temp_p[p_loop].score<temp_p[p_loop+1].score THEN
- BEGIN
- temp_p2:=temp_p[p_loop+1];
- temp_p[p_loop+1]:=temp_p[p_loop];
- temp_p[p_loop]:=temp_p2;
- done:=FALSE
- END;
- UNTIL done
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Compute_Score;
-
- VAR
- X,
- i : INTEGER;
- init : BOOLEAN;
- d_name : STRING[3];
-
- BEGIN
- FOR X:=1 TO 9 DO {clear out the division array to start anew}
- BEGIN
- division_array[X].name:=' ';
- division_array[X].total:=0;
- division_array[X].number:=0;
- division_array[X].average:=0
- END;
-
- FOR X:=1 TO max_participants DO
- WITH rally_data[X] DO
- IF team_name <> 'Not Used ... ' THEN
- BEGIN
- IF correct<>0 THEN
- IF total_secs<>9999 THEN
- IF TRUNC(total_miles)<>999 THEN
- BEGIN
- IF division<>'' THEN group_enable:=TRUE;
- Do_Score(X);
- d_name:=Copy(division,1,Length(division));
- init:=FALSE;
- FOR i:=1 TO 8 DO
- IF division_array[i].name=d_name THEN init:=TRUE;
- IF NOT init THEN
- BEGIN
- i:=0;
- REPEAT
- i:=i+1;
- IF division_array[i].name=' ' THEN
- division_array[i].name:=d_name;
- UNTIL ((division_array[i].name=d_name) OR (i=9));
- END; {NOT init}
- i:=0;
- REPEAT
- i:=i+1;
- UNTIL ((division_array[i].name=d_name) OR (i=9));
- IF division_array[i].name<>d_name THEN
- BEGIN
- alert := '[1][Too many divisions! Max is 8.][ OK ]';
- dummy := Do_Alert( alert, 1)
- END
- ELSE WITH division_array[i] DO
- BEGIN
- total:=total+total_score;
- number:=number+1;
- average:=Int(total DIV number)
- END;
- IF win_enable=FALSE THEN
- BEGIN
- win_enable:=TRUE;
- Menu_Enable(menu,winner_item);
- Menu_Enable(menu,show_place_item);
- END;
- IF group_enable THEN
- BEGIN
- Menu_Enable(menu3,div1_item);
- Menu_Enable(menu3,div2_item);
- Menu_Enable(menu3,div3_item);
- Menu_Enable(menu3,div4_item)
- END;
- END {processing of correct entry}
- END;{FOR and IF loop}
-
- Check_Data;
- Do_Order(score_places);
- Do_Order(time_places);
- Do_Order(miles_places)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Mark_Scoring;
-
- VAR
- X :INTEGER;
- test : BOOLEAN;
-
- BEGIN
- test := TRUE;
- FOR X := 1 TO 8 DO
- BEGIN
- Menu_Check( menu , official_miles_item-1+X, score_ability[X] );
- IF score_ability[X] = FALSE THEN test:=FALSE
- END;
- IF test = TRUE THEN Menu_Enable( menu , comp_scores_item )
- ELSE Menu_Disable( menu , comp_scores_item )
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Display_Winners( title : INTEGER);
-
- BEGIN
- Menu_Normal(menu, title);
- Erase_Menu( menu );
- Draw_Menu( menu3 );
- which_menu:=menu3 ;
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Enter_Data(title : INTEGER);
-
- BEGIN
- Menu_Normal(menu, title);
- Erase_Menu( menu );
- Draw_Menu( menu2 );
- which_menu:=menu2 ;
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Store_Data;
-
- VAR
- valid : BOOLEAN;
- count : INTEGER;
-
- BEGIN
- valid:=FALSE;
- valid := Get_Out_File( 'Name of file to store this data in',path);
- {path is the filename of the output file. It is a VAR so can be
- changed by the user}
- IF NOT valid THEN
- BEGIN
- alert := '[1][Error in opening file][ OK ]';
- dummy := Do_Alert( alert, 1)
- END
- ELSE
- BEGIN
- Set_Mouse( M_Bee);
- REWRITE (rally_file,path);
- rally_file^:=official;
- PUT (rally_file); {Use this first record to hold 'official' data}
- FOR count := 1 TO max_participants DO
- BEGIN
- rally_file^:=rally_data[count];
- PUT (rally_file)
- END;
- CLOSE(rally_file);
- Set_Mouse( M_Arrow )
- END
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Load_Data;
-
- VAR
- valid : BOOLEAN;
- count : INTEGER;
- default : Path_Name;
- m_item : STRING[27];
-
- BEGIN
- win_enable:=FALSE;
- group_enable:=FALSE;
- FOR count:=1 TO 8 DO
- score_ability[count]:=FALSE;
- default := 'A:\*.DAT';
- valid:=FALSE;
- valid:=Get_In_File(default,path);
- IF valid THEN
- BEGIN
- Set_Mouse( M_Bee );
- RESET(rally_file,path);
- official:=rally_file^; { Get the 'official' data }
-
- WITH official DO
- BEGIN
- IF total_secs=9999 THEN total_secs:=0;
- IF total_miles=999.9 THEN total_miles:=0.0;
- IF time_position='120000' THEN time_position:='';
- IF start_miles<>0.0 THEN score_ability[1]:=TRUE;
- IF total_secs<>0 THEN score_ability[2]:=TRUE;
- IF correct<>0 THEN score_ability[3]:=TRUE;
- IF calls<>0 THEN score_ability[4]:=TRUE;
- IF total_score<>0 THEN score_ability[5]:=TRUE;
- IF obs1<>'' THEN score_ability[6]:=TRUE;
- IF obs2<>'' THEN score_ability[7]:=TRUE;
- IF time_position<>'' THEN score_ability[8]:=TRUE
- END; {WITH official}
- FOR count:=1 TO 15 DO
- BEGIN
- GET(rally_file);
- rally_data[count]:=rally_file^;
- m_item:=CONCAT(' ',rally_file^.team_name);
- Menu_Text ( menu2, data1_item[count], m_item)
- END; {FOR count 1 TO 15 }
- FOR count:=16 TO 30 DO
- BEGIN
- GET(rally_file);
- m_item:=CONCAT(' ',rally_file^.team_name);
- rally_data[count]:=rally_file^;
- Menu_Text ( menu2, data2_item[count-15], m_item)
- END; {FOR count 16 TO 30 }
- FOR count:=31 TO 45 DO
- BEGIN
- GET(rally_file);
- m_item:=CONCAT(' ',rally_file^.team_name);
- rally_data[count]:=rally_file^;
- Menu_Text ( menu2, data3_item[count-30], m_item)
- END; {FOR count 31 TO 45 }
- FOR count:=46 TO max_participants DO
- BEGIN
- GET(rally_file);
- m_item:=CONCAT(' ',rally_file^.team_name);
- rally_data[count]:=rally_file^;
- Menu_Text ( menu2, data4_item[count-45], m_item)
- END; {FOR count 46 TO 60 }
- CLOSE(rally_file);
- Set_Mouse( M_Arrow );
-
- {Set up a connection between the places arrays and the rally_data array}
- FOR count:= 1 TO max_participants DO
- BEGIN
- score_places[count].team_number:=count;
- score_places[count].score:=rally_data[count].total_score;
- score_places[count].used:=FALSE;
- IF score_places[count].score<>0 THEN score_places[count].used:=TRUE
- END;
-
- FOR count:= 1 TO max_participants DO
- BEGIN
- time_places[count].team_number:=count;
- time_places[count].score:=rally_data[count].total_secs*(-1);
- time_places[count].used:=FALSE;
- IF time_places[count].score<>-9999 THEN time_places[count].used:=TRUE
- END;
-
- FOR count:= 1 TO max_participants DO
- BEGIN
- miles_places[count].team_number:=count;
- miles_places[count].score:=TRUNC(rally_data[count].total_miles*10)*(-1);
- miles_places[count].used:=FALSE;
- IF miles_places[count].score<>-9999 THEN miles_places[count].used:=TRUE
- END;
-
- Menu_Enable( menu , enter_results_item );
- Menu_Enable( menu , save_data_item );
- Menu_Enable( menu , official_miles_item);
- Menu_Enable( menu , official_time_item );
- Menu_Enable( menu , points_per_question_item );
- Menu_Enable( menu , points_sub_miles_item );
- Menu_Enable( menu , points_lost_time_item );
- Menu_Enable( menu , points_late_item );
- Menu_Enable( menu , points_calls_item );
- Menu_Enable( menu , points_violat_item );
- Menu_Disable( menu , winner_item );
- Menu_Disable( menu , show_place_item );
- Mark_Scoring;
- Check_Data
- END {Valid filename was used}
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure New_File;
-
- VAR
- valid : Boolean;
- count : INTEGER;
-
- BEGIN
- path:='A:\RALLY.DAT';
- valid := Get_Out_File( 'Name of file to use for rally data',path);
- {path is the filename of the output file. It is a VAR so can be
- changed by the user}
- IF NOT valid THEN
- BEGIN
- alert := '[1][Error in opening file][ OK ]';
- dummy := Do_Alert( alert, 1)
- END
- ELSE {Valid file name selected}
- BEGIN
- Set_Mouse( M_Bee );
- REWRITE (rally_file,path);
- FOR count := 1 TO max_participants+1 DO
- BEGIN
- WITH rally_file^ DO
- BEGIN
- team_name := 'Not Used ... ';
- driver := '';
- nav := '';
- obs1 := '';
- obs2 := '';
- time_position := '120000';
- division := '';
- correct := 0;
- calls := 0;
- late_to_position := 0;
- violation := 0;
- start_time := '000000';
- end_time := '000000';
- total_time := '00:00:00';
- total_secs := 9999;
- start_miles := 0.0;
- end_miles := 0.0;
- total_miles := 999.9;
- total_score := 0
- END; {WITH rally_file DO}
- PUT(rally_file)
- END; {FOR count ...}
- CLOSE(rally_file);
- Set_Mouse( M_Arrow )
- END
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Get_Integer_String(number:INTEGER ; VAR str : STR25);
-
- {convert the number to a string}
-
- VAR
- temp,
- temp2 : INTEGER;
-
- BEGIN
- str:='0000';
- str[1]:=Chr(48+(number DIV 1000));
- temp2:=number MOD 1000;
- temp:=temp2 DIV 100;
- str[2]:=Chr(48+temp);
- number:=temp2 MOD 100;
- temp:=number DIV 10;
- str[3]:=Chr(48+temp);
- temp2:=number MOD 10;
- str[4]:=Chr(48+temp2)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Get_Real_String(miles : REAL; VAR str : STR25);
-
- VAR
- temp,
- temp2,
- number : LONG_INTEGER;
-
- BEGIN
- str:='000000';
- number:=LONG_TRUNC(miles);
- miles:=miles-number;
- str[1]:=Chr(48+(number DIV 10000));
- temp2:=number MOD 10000;
- temp:=temp2 DIV 1000;
- str[2]:=Chr(48+temp);
- number:=temp2 MOD 1000;
- temp:=number DIV 100;
- temp2:=number MOD 100;
- str[3]:=Chr(48+temp);
- temp:=temp2 DIV 10;
- str[4]:=Chr(48+temp);
- number:=temp2 MOD 10;
- str[5]:=Chr(48+number);
- temp:=LONG_TRUNC((miles+0.01)*10);
- str[6]:=Chr(48+temp)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Make_Real(str : STR25 ; VAR float : REAL);
-
- VAR
- X,
- size : INTEGER;
- A : CHAR;
- num : LONG_INTEGER;
-
- BEGIN
- float := 0.0;
- size:=Length(str);
- FOR X:=size DOWNTO 1 DO
- BEGIN
- A:=str[size+1-X];
- CASE A OF
- '0' : num:=0;
- '1' : num:=1;
- '2' : num:=2;
- '3' : num:=3;
- '4' : num:=4;
- '5' : num:=5;
- '6' : num:=6;
- '7' : num:=7;
- '8' : num:=8;
- '9' : num:=9
- END;
- float:=float+(LONG_TRUNC(num*PwrOfTen(X-1)))/10;
- END { FOR loop }
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Compute_Secs(start,end_s:STR25; VAR total : INTEGER;
- VAR valid : BOOLEAN);
-
- VAR
- time : STRING[25];
- temp_int,
- star_sec,
- end_sec : INTEGER;
-
- BEGIN
- star_sec:=0;
- end_sec:=0;
- total:=0;
- valid:=TRUE;
- time:=Copy(start,1,2);
- Make_Integer(time,temp_int);
- star_sec:=temp_int*60*60;
- time:=Copy(start,3,2);
- Make_Integer(time,temp_int);
- star_sec:=star_sec+temp_int*60;
- time:=Copy(start,5,2);
- Make_Integer(time,temp_int);
- star_sec:=star_sec+temp_int;
-
- time:=Copy(end_s,1,2);
- Make_Integer(time,temp_int);
- end_sec:=temp_int*60*60;
- time:=Copy(end_s,3,2);
- Make_Integer(time,temp_int);
- end_sec:=end_sec+temp_int*60;
- time:=Copy(end_s,5,2);
- Make_Integer(time,temp_int);
- end_sec:=end_sec+temp_int;
-
-
- IF end_sec>star_sec THEN total:=end_sec-star_sec;
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Compute_Time;
-
- VAR
- time,
- time2,
- time3 : STRING[25];
- colon : STRING[1];
- seconds,
- temp_int,
- star_sec,
- end_sec,
- hrs,
- mins : INTEGER;
- ok : BOOLEAN;
-
- BEGIN
- ok:=TRUE;
- colon:=':';
- Compute_Secs(temp_data.start_time,temp_data.end_time,temp_data.total_secs,
- ok);
- IF ok THEN
- BEGIN
- seconds:=temp_data.total_secs;
- hrs:=seconds DIV 3600;
- seconds:=seconds MOD 3600;
- mins:= seconds DIV 60;
- seconds:=seconds MOD 60;
-
- Get_Integer_String(hrs, time);
- Delete(time,1,2);
- time3:=time;
- time2:=time;
- Get_Integer_String(mins, time);
- Delete(time,1,2);
- time3:=Concat(time2,colon,time);
- time2:=time3;
- Get_Integer_String(seconds, time);
- Delete(time,1,2);
- time3:=Concat(time2,colon,time);
- temp_data.total_time:=time3
- END;
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Hide_Menu;
-
- VAR
- count : INTEGER;
-
- BEGIN
- Menu_Disable( menu , enter_results_item );
- Menu_Disable( menu , save_data_item );
- Menu_Disable( menu , show_place_item );
- Menu_Disable( menu , winner_item );
- Menu_Disable( menu , comp_scores_item );
- Menu_Disable( menu , official_miles_item );
- Menu_Disable( menu , official_time_item );
- Menu_Disable( menu , points_per_question_item );
- Menu_Disable( menu , points_sub_miles_item );
- Menu_Disable( menu , points_lost_time_item );
- Menu_Disable( menu , points_late_item );
- Menu_Disable( menu , points_calls_item );
- Menu_Disable( menu , points_violat_item );
- Menu_Disable( menu3 , div1_item );
- Menu_Disable( menu3 , div2_item );
- Menu_Disable( menu3 , div3_item );
- Menu_Disable( menu3 , div4_item )
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure O_Mileage(title,item :INTEGER);
-
- VAR
- o_m_item,
- text_item,
- dash_item,
- q_btn,
- c_btn : INTEGER;
- transfer : STRING[25];
-
- BEGIN
- dialog:=New_Dialog(6,0,0,42,8);
- text_item:=Add_DItem(dialog,G_String,none,2,1,0,0,0,0);
- Set_Dtext(dialog,text_item,'Please enter the Official Mileage below.',
- System_Font,TE_Center);
- dash_item:=Add_DItem(dialog,G_Text,none,1,2,40,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_Dtext(dialog,dash_item,'----------------------------------------',
- System_Font,TE_Center);
- Get_Real_String(official.start_miles,transfer);
- o_m_item:=Add_DItem(dialog,G_FText,Editable,2,3,25,1,0,$1180);
- Set_DEdit(dialog,o_m_item,' Official Miles > _____._','999999',
- transfer,System_Font,TE_Left);
- q_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 11,5,8,2,3,(4096*Green+256*Black+128));
- Set_DText(dialog,q_btn,'OK',System_Font,TE_Center);
- c_btn:=Add_DItem(dialog,G_BoxText,Selectable|Exit_Btn,
- 23,5,8,2,2,(4096*Red+256*Black+128));
- Set_DText(dialog,c_btn,'Cancel',System_Font,TE_Center);
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,o_m_item);
- IF button=q_btn THEN
- BEGIN
- Get_DEdit(dialog,o_m_item,transfer);
- Make_Real(transfer,official.start_miles);
- score_ability[1]:=TRUE;
- Mark_Scoring
- END;
- End_Dialog(dialog);
- Delete_Dialog(dialog)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure O_Time(title,item :INTEGER);
-
- VAR
- o_t_item,
- text_item,
- dash_item,
- q_btn,
- c_btn : INTEGER;
- ok : BOOLEAN;
-
- BEGIN
- ok:=TRUE;
- dialog:=New_Dialog(6,0,0,42,8);
- text_item:=Add_DItem(dialog,G_String,none,2,1,0,0,0,0);
- Set_Dtext(dialog,text_item,'Please enter the Official Time below.',
- System_Font,TE_Center);
- dash_item:=Add_DItem(dialog,G_Text,none,1,2,40,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_Dtext(dialog,dash_item,'----------------------------------------',
- System_Font,TE_Center);
- o_t_item:=Add_DItem(dialog,G_FText,Editable,2,3,24,1,0,$1180);
- Set_DEdit(dialog,o_t_item,'Official Time > __:__:__','999999',
- official.end_time,System_Font,TE_Left);
- q_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 11,5,8,2,3,(4096*Green+256*Black+128));
- Set_DText(dialog,q_btn,'OK',System_Font,TE_Center);
- c_btn:=Add_DItem(dialog,G_BoxText,Selectable|Exit_Btn,
- 23,5,8,2,2,(4096*Red+256*Black+128));
- Set_DText(dialog,c_btn,'Cancel',System_Font,TE_Center);
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,o_t_item);
- IF button=q_btn THEN
- BEGIN
- Get_DEdit(dialog,o_t_item,official.end_time);
- Compute_Secs('000000',official.end_time,official.total_secs,ok);
- IF ok THEN score_ability[2]:=TRUE;
- Mark_Scoring
- END;
- End_Dialog(dialog);
- Delete_Dialog(dialog)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure P_P_Question(title, item : INTEGER);
-
- VAR
- transfer : STRING[25];
- text_item,
- dash_item,
- p_p_item,
- q_btn,
- c_btn : INTEGER;
-
- BEGIN
- dialog:=New_Dialog(6,0,0,42,8);
- text_item:=Add_DItem(dialog,G_String,none,2,1,0,0,0,0);
- Set_Dtext(dialog,text_item,'Please enter the points/question below.',
- System_Font,TE_Center);
- dash_item:=Add_DItem(dialog,G_Text,none,1,2,40,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_Dtext(dialog,dash_item,'----------------------------------------',
- System_Font,TE_Center);
- p_p_item:=Add_DItem(dialog,G_FText,Editable,2,3,22,1,0,$1180);
- Get_Integer_String(official.correct,transfer);
- Set_DEdit(dialog,p_p_item,'Points/question > ____','9999',
- transfer,System_Font,TE_Left);
- q_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 11,5,8,2,3,(4096*Green+256*Black+128));
- Set_DText(dialog,q_btn,'OK',System_Font,TE_Center);
- c_btn:=Add_DItem(dialog,G_BoxText,Selectable|Exit_Btn,
- 23,5,8,2,2,(4096*Red+256*Black+128));
- Set_DText(dialog,c_btn,'Cancel',System_Font,TE_Center);
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,p_p_item);
- IF button=q_btn THEN
- BEGIN
- Get_DEdit(dialog,p_p_item,transfer); {Check that some value}
- Make_Integer(transfer,official.correct); {was entered for the}
- score_ability[3]:=TRUE; {points/question. If}
- IF official.correct=0 THEN score_ability[3]:=FALSE;{so, then enable and}
- mark_scoring {check the menu item.}
- END;
- End_Dialog(dialog);
- Delete_Dialog(dialog)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure P_S_Miles(title, item : INTEGER);
-
- VAR
- transfer : STRING[25];
- text_item,
- text2_item,
- dash_item,
- p_s_item,
- p_s2_item,
- p_s3_item,
- q_btn,
- c_btn : INTEGER;
-
- BEGIN
- dialog:=New_Dialog(9,0,0,53,10);
- text_item:=Add_DItem(dialog,G_String,none,2,1,0,0,0,0);
- Set_Dtext(dialog,text_item,'Please enter the points to be subtracted for',
- System_Font,TE_Center);
- text2_item:=Add_DItem(dialog,G_String,none,2,2,0,0,0,0);
- Set_Dtext(dialog,text2_item,'each 1/10 mile off from the official mileage.',
- System_Font,TE_Center);
- dash_item:=Add_DItem(dialog,G_Text,none,1,3,51,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_Dtext(dialog,dash_item,
- '---------------------------------------------------',
- System_Font,TE_Center);
- p_s_item:=Add_DItem(dialog,G_FText,Editable,2,4,35,1,0,$1180);
- Get_Integer_String(official.calls,transfer);
- Set_DEdit(dialog,p_s_item,'Points per 1/10 mile for first ____',
- '9999',transfer,System_Font,TE_Left);
- p_s2_item:=Add_DItem(dialog,G_FText,Editable,37,4,15,1,0,$1180);
- Get_Integer_String(official.late_to_position,transfer);
- Set_DEdit(dialog,p_s2_item,' mile(s) > ____','9999'
- ,transfer,System_Font,TE_Left);
- p_s3_item:=Add_DItem(dialog,G_FText,Editable,2,5,39,1,0,$1180);
- Get_Integer_String(official.violation,transfer);
- Set_DEdit(dialog,p_s3_item,'Points per 1/10 mile after above > ____',
- '9999',transfer,System_Font,TE_Left);
- q_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 14,7,8,2,3,(4096*Green+256*Black+128));
- Set_DText(dialog,q_btn,'OK',System_Font,TE_Center);
- c_btn:=Add_DItem(dialog,G_BoxText,Selectable|Exit_Btn,
- 32,7,8,2,2,(4096*Red+256*Black+128));
- Set_DText(dialog,c_btn,'Cancel',System_Font,TE_Center);
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,p_s_item);
- IF button=q_btn THEN
- BEGIN
- Get_DEdit(dialog,p_s_item,transfer);
- Make_Integer(transfer,official.calls);
- Get_DEdit(dialog,p_s2_item,transfer);
- Make_Integer(transfer,official.late_to_position);
- Get_DEdit(dialog,p_s3_item,transfer);
- Make_Integer(transfer,official.violation);
- score_ability[4]:=TRUE;
- Mark_Scoring
- END;
- End_Dialog(dialog);
- Delete_Dialog(dialog)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure P_L_Time;
-
- VAR
- transfer : STRING[25];
- text_item,
- text2_item,
- dash_item,
- p_l_item,
- p_l2_item,
- p_l3_item,
- q_btn,
- c_btn,
- int1 : INTEGER;
-
- BEGIN
- dialog:=New_Dialog(9,0,0,55,10);
- text_item:=Add_DItem(dialog,G_String,none,2,1,0,0,0,0);
- Set_Dtext(dialog,text_item,
- 'Please enter the points to be subtracted for each',
- System_Font,TE_Center);
- text2_item:=Add_DItem(dialog,G_String,none,2,2,0,0,0,0);
- Set_Dtext(dialog,text2_item,'second off from the official time.',
- System_Font,TE_Center);
- dash_item:=Add_DItem(dialog,G_Text,none,1,3,53,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_Dtext(dialog,dash_item,
- '-----------------------------------------------------',
- System_Font,TE_Center);
- p_l_item:=Add_DItem(dialog,G_FText,Editable,2,4,37,1,0,$1180);
- Get_Integer_String(TRUNC(official.end_miles+0.1),transfer);
- Set_DEdit(dialog,p_l_item,'Points lost per second for first ____',
- '9999',transfer,System_Font,TE_Left);
- p_l2_item:=Add_DItem(dialog,G_FText,Editable,39,4,15,1,0,$1180);
- Get_Integer_String(TRUNC(official.total_miles+0.1),transfer);
- Set_DEdit(dialog,p_l2_item,' seconds > ____','9999'
- ,transfer,System_Font,TE_Left);
- p_l3_item:=Add_DItem(dialog,G_FText,Editable,2,5,39,1,0,$1180);
- Get_Integer_String(official.total_score,transfer);
- Set_DEdit(dialog,p_l3_item,'Points per second after above > ____',
- '9999',transfer,System_Font,TE_Left);
- q_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 14,7,8,2,3,(4096*Green+256*Black+128));
- Set_DText(dialog,q_btn,'OK',System_Font,TE_Center);
- c_btn:=Add_DItem(dialog,G_BoxText,Selectable|Exit_Btn,
- 33,7,8,2,2,(4096*Red+256*Black+128));
- Set_DText(dialog,c_btn,'Cancel',System_Font,TE_Center);
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,p_l_item);
- IF button=q_btn THEN
- BEGIN
- Get_DEdit(dialog,p_l_item,transfer);
- Make_Integer(transfer,int1);
- official.end_miles:=int1;
- Get_DEdit(dialog,p_l2_item,transfer);
- Make_Integer(transfer,int1);
- official.total_miles:=int1;
- Get_DEdit(dialog,p_l3_item,transfer);
- Make_Integer(transfer,official.total_score);
- score_ability[5]:=TRUE;
- Mark_Scoring
- END;
- End_Dialog(dialog);
- Delete_Dialog(dialog)
- END;
-
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure P_L_Late;
-
- VAR
- text_item,
- text2_item,
- dash_item,
- p_l_item,
- q_btn,
- c_btn : INTEGER;
-
- BEGIN
- dialog:=New_Dialog(9,0,0,46,10);
- text_item:=Add_DItem(dialog,G_String,none,2,1,0,0,0,0);
- Set_Dtext(dialog,text_item,'Please enter the points to be subtracted',
- System_Font,TE_Center);
- text2_item:=Add_DItem(dialog,G_String,none,2,2,0,0,0,0);
- Set_Dtext(dialog,text2_item,'for each minute late for the position time.',
- System_Font,TE_Center);
- dash_item:=Add_DItem(dialog,G_Text,none,1,3,42,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_Dtext(dialog,dash_item,
- '------------------------------------------',
- System_Font,TE_Center);
- p_l_item:=Add_DItem(dialog,G_FText,Editable,2,4,34,1,0,$1180);
- Set_DEdit(dialog,p_l_item,'Points lost per minute late > ____',
- '9999',official.obs1,System_Font,TE_Left);
- q_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 10,6,8,2,3,(4096*Green+256*Black+128));
- Set_DText(dialog,q_btn,'OK',System_Font,TE_Center);
- c_btn:=Add_DItem(dialog,G_BoxText,Selectable|Exit_Btn,
- 30,6,8,2,2,(4096*Red+256*Black+128));
- Set_DText(dialog,c_btn,'Cancel',System_Font,TE_Center);
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,p_l_item);
- IF button=q_btn THEN
- BEGIN
- Get_DEdit(dialog,p_l_item,official.obs1);
- score_ability[6]:=TRUE;
- Mark_Scoring
- END;
- End_Dialog(dialog);
- Delete_Dialog(dialog)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure P_L_Calls;
-
- VAR
- text_item,
- text2_item,
- dash_item,
- p_l_item,
- q_btn,
- c_btn : INTEGER;
-
- BEGIN
- dialog:=New_Dialog(9,0,0,44,10);
- text_item:=Add_DItem(dialog,G_String,none,2,1,0,0,0,0);
- Set_Dtext(dialog,text_item,
- 'Please enter the points to be subtracted',
- System_Font,TE_Center);
- text2_item:=Add_DItem(dialog,G_String,none,2,2,0,0,0,0);
- Set_Dtext(dialog,text2_item,'for each help call made.',
- System_Font,TE_Center);
- dash_item:=Add_DItem(dialog,G_Text,none,1,3,42,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_Dtext(dialog,dash_item,
- '------------------------------------------',
- System_Font,TE_Center);
- p_l_item:=Add_DItem(dialog,G_FText,Editable,2,4,27,1,0,$1180);
- Set_DEdit(dialog,p_l_item,'Points per help call > ____',
- '9999',official.obs2,System_Font,TE_Left);
- q_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 9,6,8,2,3,(4096*Green+256*Black+128));
- Set_DText(dialog,q_btn,'OK',System_Font,TE_Center);
- c_btn:=Add_DItem(dialog,G_BoxText,Selectable|Exit_Btn,
- 29,6,8,2,2,(4096*Red+256*Black+128));
- Set_DText(dialog,c_btn,'Cancel',System_Font,TE_Center);
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,p_l_item);
- IF button=q_btn THEN
- BEGIN
- Get_DEdit(dialog,p_l_item,official.obs2);
- score_ability[7]:=TRUE;
- Mark_Scoring
- END;
- End_Dialog(dialog);
- Delete_Dialog(dialog)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure P_L_Violation;
-
- VAR
- text_item,
- text2_item,
- dash_item,
- p_l_item,
- q_btn,
- c_btn : INTEGER;
-
- BEGIN
- dialog:=New_Dialog(9,0,0,44,10);
- text_item:=Add_DItem(dialog,G_String,none,2,1,0,0,0,0);
- Set_Dtext(dialog,text_item,
- 'Please enter the points to be subtracted',
- System_Font,TE_Center);
- text2_item:=Add_DItem(dialog,G_String,none,2,2,0,0,0,0);
- Set_Dtext(dialog,text2_item,'for each car safety inspection violation.',
- System_Font,TE_Center);
- dash_item:=Add_DItem(dialog,G_Text,none,1,3,42,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_Dtext(dialog,dash_item,
- '------------------------------------------',
- System_Font,TE_Center);
- p_l_item:=Add_DItem(dialog,G_FText,Editable,2,4,32,1,0,$1180);
- Set_DEdit(dialog,p_l_item,'Points lost per violation > ____',
- '9999',official.time_position,System_Font,TE_Left);
- q_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 9,6,8,2,3,(4096*Green+256*Black+128));
- Set_DText(dialog,q_btn,'OK',System_Font,TE_Center);
- c_btn:=Add_DItem(dialog,G_BoxText,Selectable|Exit_Btn,
- 29,6,8,2,2,(4096*Red+256*Black+128));
- Set_DText(dialog,c_btn,'Cancel',System_Font,TE_Center);
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,p_l_item);
- IF button=q_btn THEN
- BEGIN
- Get_DEdit(dialog,p_l_item,official.time_position);
- score_ability[8]:=TRUE;
- Mark_Scoring
- END;
- End_Dialog(dialog);
- Delete_Dialog(dialog)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- PROCEDURE Do_Menu( title: INTEGER;VAR item : INTEGER );
-
- BEGIN
- IF title = file_title THEN
- IF item = create_item THEN New_File
- ELSE IF item = old_item THEN Load_Data
- ELSE IF item = enter_results_item THEN Enter_Data(title)
- ELSE IF item = save_data_item THEN Store_Data;
- IF title = score_title THEN
- IF item = show_place_item THEN
- IF place_show=FALSE THEN
- place_show:=TRUE
- ELSE
- place_show:=FALSE;
- Menu_Check(menu,show_place_item,place_show);
- IF item = winner_item THEN Display_Winners(title)
- ELSE IF item = comp_scores_item THEN Compute_Score;
- IF title = set_scoring_title THEN
- IF item = official_miles_item THEN O_Mileage(title,item)
- ELSE IF item = official_time_item THEN O_Time(title,item)
- ELSE IF item = points_per_question_item THEN P_P_Question(title,item)
- ELSE IF item = points_sub_miles_item THEN P_S_Miles(title,item)
- ELSE IF item = points_lost_time_item THEN P_L_Time
- ELSE IF item = points_late_item THEN P_L_Late
- ELSE IF item = points_calls_item THEN P_L_Calls
- ELSE IF item = points_violat_item THEN P_L_Violation;
- IF title = quit_title THEN
- BEGIN
- alert :=
- '[2][QUIT - Are you sure?| |(Have you saved your data?)][ OK | Abort ]';
- dummy := Do_Alert(alert, 2 );
- IF dummy = 2 THEN item:=quit_item+1 {don't end}
- END; {quit}
- Menu_Normal( menu, title )
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Get_Place(item : INTEGER);
-
- VAR
- x,
- place,
- p_item,
- p2_item : INTEGER;
- transfer : str25;
-
- BEGIN
- place:=-1;
- FOR x:=1 TO max_participants DO
- IF score_places[x].team_number=edit[item] THEN place:=x;
- IF place<>-1 THEN
- BEGIN
- p_item:=Add_DItem(dialog,G_Text,None,25,11,14,1,0,$1180);
- Set_DText(dialog,p_item,'Place > ',System_Font,TE_Left);
- p2_item:=Add_DItem(dialog,G_Text,None,33,11,5,1,0,$1180);
- Get_Integer_String(place,transfer);
- Set_DText(dialog,p2_item,transfer,System_Font,TE_Left)
- END
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Edit2(title, item : INTEGER);
-
- { This procedure is to draw the second edit dialog box}
-
- VAR
- cancel : BOOLEAN;
- transfer : STRING[25];
- dash_item,
- start_item,
- end_item,
- total_time_item,
- actual_t_item,
- start_m_item,
- end_m_item,
- total_m_item,
- actual_m_item,
- s_text_item,
- s_dash_item,
- score_item : INTEGER;
-
- BEGIN
- Hide_Mouse;
- dialog:=New_Dialog(16,0,0,39,16);
- name_item:=Add_DItem(dialog,G_Text,None,2,1,34,1,0,$1180);
- Set_DText(dialog, name_item, temp_data.team_name, System_Font,TE_Center);
- dash_item:=Add_DItem(dialog,G_Text,None,1,2,37,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_DText(dialog,dash_item,'-------------------------------------',
- System_Font,TE_Center);
- Get_Integer_string(temp_data.violation,transfer);
- violate_item:=Add_DItem(dialog,G_FText,Editable,2,3,25,1,0,$1180);
- Set_DEdit(dialog,violate_item,'Vehicle violations > ____',
- '9999',transfer, System_Font,TE_Left);
- start_item:=Add_DItem(dialog,G_FText,Editable,2,4,28,1,0,$1180);
- Set_DEdit(dialog,start_item,'Actual start time > __:__:__',
- '999999',temp_data.start_time,System_Font,TE_Left);
- end_item:=Add_DItem(dialog,G_FText,Editable,2,5,28,1,0,$1180);
- Set_DEdit(dialog,end_item,'Actual end time > __:__:__',
- '999999',temp_data.end_time,System_Font,TE_Left);
- total_time_item:=Add_DItem(dialog,G_Text,None,2,6,20,1,0,$1180);
- Set_DText(dialog,total_time_item,'Total time > ',System_Font,TE_Left);
- actual_t_item:=Add_DItem(dialog,G_Text,None,22,6,23,1,0,$1180);
- Set_DText(dialog,actual_t_item,temp_data.total_time,System_Font,TE_Left);
- Get_Real_String(temp_data.start_miles,transfer);
- start_m_item:=Add_DItem(dialog,G_FText,Editable,2,7,31,1,0,$1180);
- Set_DEdit(dialog,start_m_item,'Actual start mileage > _____._',
- '999999',transfer,System_Font,TE_Left);
- Get_Real_String(temp_data.end_miles,transfer);
- end_m_item:=Add_DItem(dialog,G_FText,Editable,2,8,31,1,0,$1180);
- Set_DEdit(dialog,end_m_item,'Actual ending mileage > _____._',
- '999999',transfer,System_Font,TE_Left);
- actual_m_item:=Add_DItem(dialog,G_FText,Editable,2,9,31,1,0,$1180);
- IF TRUNC(temp_data.total_miles)=999 THEN temp_data.total_miles:=0.0;
- Get_Real_String(temp_data.total_miles,transfer);
- Set_DEdit(dialog,actual_m_item,'Total miles > _____._','999999',
- transfer,System_Font,TE_Left);
- IF TRUNC(temp_data.total_miles)=0 THEN temp_data.total_miles:=999.9;
- s_dash_item:=Add_DItem(dialog,G_Text,None,1,10,37,1,0,$1180);
- Obj_SetState(dialog,s_dash_item,Disabled,False);
- Set_DText(dialog,s_dash_item,'-------------------------------------',
- System_Font,TE_Center);
- s_text_item:=Add_DItem(dialog,G_Text,None,2,11,14,1,0,$1180);
- Set_DText(dialog,s_text_item,'Total Score > ',System_Font,TE_Left);
- score_item:=Add_DItem(dialog,G_Text,None,16,11,5,1,0,$1180);
- IF temp_data.total_score<0 THEN temp_data.total_score:=0;
- Get_Real_string(temp_data.total_score,transfer);
- Set_DText(dialog,score_item,transfer,System_Font,TE_Left);
- IF place_show=TRUE THEN Get_Place(item);
-
- ok_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 7,13,8,2,3,(4096*Green+256*Black+128));
- Set_DText(dialog,ok_btn,'OK',System_Font,TE_Center);
- cancel_btn:=Add_DItem(dialog,G_BoxText,Selectable|Exit_Btn,
- 22,13,8,2,2,(4096*Red+256*Black+128));
- Set_DText(dialog,cancel_btn,'Cancel',System_Font,TE_Center);
- Show_Mouse;
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,violate_item);
- cancel:=FALSE;
- IF button=cancel_btn THEN cancel:=TRUE;
- Get_DEdit(dialog,violate_item,transfer);
- Make_Integer(transfer,temp_data.violation);
- Get_DEdit(dialog,start_item,temp_data.start_time);
- Get_DEdit(dialog,end_item,temp_data.end_time);
- Get_DEdit(dialog,start_m_item,transfer);
- Make_Real(transfer,temp_data.start_miles);
- Get_DEdit(dialog,end_m_item,transfer);
- Make_Real(transfer,temp_data.end_miles);
- IF temp_data.end_miles>temp_data.start_miles THEN
- temp_data.total_miles:=temp_data.end_miles-temp_data.start_miles;
- End_Dialog(dialog);
- Delete_Dialog(dialog);
- IF NOT cancel THEN
- BEGIN
- IF temp_data.end_time<>'000000' THEN Compute_Time;
- rally_data[edit[item]]:=temp_data
- END;
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Edit_Data(title, item : INTEGER);
-
- { This procedure will draw the first main edit dialog box. It may be
- exited without changing the contents, save the contents and return
- to the menu, or save and go to the second edit screen}
-
- VAR
- cancel : BOOLEAN;
- transfer : STRING[25];
- m_item : STRING[27];
- dash_item,
- next_btn : INTEGER;
-
- BEGIN
- temp_data:=rally_data[edit[item]];
- Hide_Mouse;
- dialog:=New_Dialog(15,0,0,39,16);
- name_item:=Add_DItem(dialog,G_FText,Editable,2,1,34,1,0,$1180);
- Set_DEdit(dialog,name_item,'Team > _________________________',
- 'XXXXXXXXXXXXXXXXXXXXXXXXX',temp_data.team_name,
- System_Font,TE_Left);
- dash_item:=Add_DItem(dialog,G_Text,None,1,2,37,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_DText(dialog,dash_item,'-------------------------------------',
- System_Font,TE_Center);
- driver_item:=Add_DItem(dialog,G_FText,Editable,2,3,34,1,0,$1180);
- Set_DEdit(dialog,driver_item,'Driver > _________________________',
- 'XXXXXXXXXXXXXXXXXXXXXXXXX',temp_data.driver,
- System_Font,TE_Left);
- nav_item:=Add_DItem(dialog,G_FText,Editable,2,4,34,1,0,$1180);
- Set_DEdit(dialog,nav_item,'Nav > _________________________',
- 'XXXXXXXXXXXXXXXXXXXXXXXXX',temp_data.nav,
- System_Font,TE_Left);
- obs1_item:=Add_DItem(dialog,G_FText,Editable,2,5,34,1,0,$1180);
- Set_DEdit(dialog,obs1_item,'Obs1 > _________________________',
- 'XXXXXXXXXXXXXXXXXXXXXXXXX',temp_data.obs1,
- System_Font,TE_Left);
- obs2_item:=Add_DItem(dialog,G_FText,Editable,2,6,34,1,0,$1180);
- Set_DEdit(dialog,obs2_item,'Obs2 > _________________________',
- 'XXXXXXXXXXXXXXXXXXXXXXXXX',temp_data.obs2,
- System_Font,TE_Left);
- pos_time_item:=Add_DItem(dialog,G_FText,Editable,2,7,21,1,0,$1180);
- Set_DEdit(dialog,pos_time_item,'Position Time > __:__',
- '9999',temp_data.time_position, System_Font,TE_Left);
- division_item:=Add_DItem(dialog,G_FText,Editable,2,8,15,1,0,$1180);
- Set_DEdit(dialog,division_item,'Grouping > ____',
- 'nnnn',temp_data.division, System_Font,TE_Left);
- Get_Integer_string(temp_data.correct,transfer);
- correct_item:=Add_DItem(dialog,G_FText,Editable,2,9,14,1,0,$1180);
- Set_DEdit(dialog,correct_item,'Correct > ____',
- '9999',transfer, System_Font,TE_Left);
- Get_Integer_string(temp_data.calls,transfer);
- calls_item:=Add_DItem(dialog,G_FText,Editable,2,10,17,1,0,$1180);
- Set_DEdit(dialog,calls_item,'Help Calls > ____',
- '9999',transfer, System_Font,TE_Left);
- Get_Integer_string(temp_data.late_to_position,transfer);
- late_item:=Add_DItem(dialog,G_FText,Editable,2,11,31,1,0,$1180);
- Set_DEdit(dialog,late_item,'Minutes late to position > ____',
- '9999',transfer, System_Font,TE_Left);
- ok_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn,
- 3,13,8,2,2,(4096*Green+256*Black+128));
- Set_DText(dialog,ok_btn,'OK',System_Font,TE_Center);
- next_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 16,13,8,2,4,(4096*Blue+256*Black+128));
- Set_DText(dialog,next_btn,'Cont',System_Font,TE_Center);
- cancel_btn:=Add_DItem(dialog,G_BoxText,Selectable|Exit_Btn,
- 28,13,8,2,2,(4096*Red+256*Black+128));
- Set_DText(dialog,cancel_btn,'Cancel',System_Font,TE_Center);
- Show_Mouse;
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,name_item);
- cancel:=FALSE;
- IF button=cancel_btn THEN cancel:=TRUE;
- Get_DEdit(dialog,name_item,temp_data.team_name);
- Get_DEdit(dialog,driver_item,temp_data.driver);
- Get_DEdit(dialog,nav_item,temp_data.nav);
- Get_DEdit(dialog,obs1_item,temp_data.obs1);
- Get_DEdit(dialog,obs2_item,temp_data.obs2);
- Get_DEdit(dialog,pos_time_item,temp_data.time_position);
- Get_DEdit(dialog,division_item,temp_data.division);
- Get_DEdit(dialog,correct_item,transfer);
- Make_Integer(transfer,temp_data.correct);
- Get_DEdit(dialog,calls_item,transfer);
- Make_Integer(transfer,temp_data.calls);
- Get_DEdit(dialog,late_item,transfer);
- Make_Integer(transfer,temp_data.late_to_position);
- End_Dialog(dialog);
- Delete_Dialog(dialog);
- IF NOT cancel THEN
- BEGIN
- rally_data[edit[item]]:=temp_data;
- m_item:=CONCAT(' ',temp_data.team_name);
- Menu_Text(menu2,item,m_item)
- END;
- IF button=next_btn THEN Edit2(title, item);
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- PROCEDURE Do_Menu2( title , item : INTEGER );
-
- BEGIN
- IF title = data1_title THEN Edit_Data(title, item);
- IF title = data2_title THEN Edit_Data(title, item);
- IF title = data3_title THEN Edit_Data(title, item);
- IF title = data4_title THEN Edit_Data(title, item);
- IF title = exit_title THEN
- BEGIN
- Menu_Normal(menu2, title);
- Erase_Menu( menu2 );
- Draw_Menu( menu );
- which_menu:=menu;
- END
- ELSE Menu_Normal(menu2, title);
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Sw_Place(place : INTEGER; str,str2,str3 : str25);
-
- VAR
- color,
- text_item,
- text2_item,
- dash_item,
- cat_item,
- place_item,
- name_item,
- score_item,
- q_btn : INTEGER;
- pstring,
- pstrng1,
- pstrng2,
- pstrng3,
- pstrng4 :STRING[42];
-
- BEGIN
- pstrng1:='The FIRST place winner for the category';
- pstrng2:='The SECOND place finisher for the category';
- pstrng3:='The THIRD place finisher for the category';
- pstrng4:='The LAST place finisher for the category';
- IF place = 1 THEN pstring:=pstrng1;
- IF place = 2 THEN pstring:=pstrng2;
- IF place = 3 THEN pstring:=pstrng3;
- IF place = 4 THEN pstring:=pstrng4;
-
- dialog:=New_Dialog(8,0,0,44,13);
- IF place<>4 THEN color:=Green*4096+Black*256+128+4*16+Green
- ELSE color:=Red*4096+Black*256+128+4*16+Red;
- text_item:=Add_DItem(dialog,G_BoxText,none,1,1,42,2,-2,color);
- Set_Dtext(dialog,text_item,' DISPLAY RESULTS! ',
- System_Font,TE_Center);
- dash_item:=Add_DItem(dialog,G_Text,none,1,4,42,1,0,$1180);
- Obj_SetState(dialog,dash_item,Disabled,False);
- Set_Dtext(dialog,dash_item,'--======================================--',
- System_Font,TE_Center);
- place_item:=Add_DItem(dialog,G_Text,none,1,5,42,1,0,$1180);
- Set_Dtext(dialog,place_item,pstring,System_Font,TE_Center);
- cat_item:=Add_DItem(dialog,G_Text,none,1,6,42,1,0,$1180);
- Set_Dtext(dialog,cat_item,str,System_Font,TE_Center);
- name_item:=Add_DItem(dialog,G_BoxText,none,6,7,32,1,-1,color);
- Set_DText(dialog,name_item,str2,System_Font,TE_Center);
- score_item:=Add_DItem(dialog,G_Text,none,1,9,42,1,0,$1180);
- Set_Dtext(dialog,score_item,str3,System_Font,TE_Center);
- q_btn:=Add_DItem(dialog,G_BoxText,Selectable|exit_btn|Default,
- 19,10,6,2,3,(4096*Green+256*Black+128));
- Set_DText(dialog,q_btn,'OK',System_Font,TE_Center);
- Center_Dialog(dialog);
- button:=Do_Dialog(dialog,0);
- End_Dialog(dialog);
- Delete_Dialog(dialog)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Do_Last(title : INTEGER; VAR str : str25;
- temp_array : place_array ; VAR count : INTEGER);
-
- BEGIN
- count:=max_participants+1;
- REPEAT
- count:=count-1;
- IF temp_array[count].used=TRUE THEN
- str:=rally_data[temp_array[count].team_number].team_name;
- UNTIL temp_array[count].used=TRUE;
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Do_Menu3( title, item : INTEGER );
-
- VAR
- place,
- count : INTEGER;
- str,
- str2,
- str3 : STRING[25];
- temp_arr : place_array;
- period : CHAR;
-
- BEGIN
- IF title = overall_title THEN
- BEGIN
- IF item = first_o_item THEN place:=1
- ELSE IF item = second_o_item THEN place:=2
- ELSE IF item = third_o_item THEN place:=3
- ELSE IF item = last_o_item THEN place:=4;
- str:='OVERALL';
- str2:=rally_data[score_places[place].team_number].team_name;
- Get_Real_String(rally_data[score_places[place].team_number].total_score,
- str3);
- IF place = 4 THEN
- BEGIN
- Do_Last(title,str2,score_places,count);
- Get_Real_String(rally_data[score_places[count].team_number].total_score,
- str3)
- END;
- Delete(str3,6,1);
- Sw_Place(place,str,str2,str3)
- END;
-
- IF title = time_title THEN
- BEGIN
- IF item = first_t_item THEN place:=1
- ELSE IF item = second_t_item THEN place:=2
- ELSE IF item = third_t_item THEN place:=3
- ELSE IF item = last_t_item THEN place:=4;
- str:='TIME';
- str2:=rally_data[time_places[place].team_number].team_name;
- str3:=rally_data[time_places[place].team_number].total_time;
- IF place = 4 THEN
- BEGIN
- Do_Last(title,str2,time_places,count);
- str3:=rally_data[time_places[count].team_number].total_time
- END;
- Sw_Place(place,str,str2,str3)
- END;
-
- IF title = miles_title THEN
- BEGIN
- IF item = first_m_item THEN place:=1
- ELSE IF item = second_m_item THEN place:=2
- ELSE IF item = third_m_item THEN place:=3
- ELSE IF item = last_m_item THEN place:=4;
- str:='MILEAGE';
- str2:=rally_data[miles_places[place].team_number].team_name;
- Get_Real_String(rally_data[miles_places[place].team_number].total_miles,
- str3);
- IF place = 4 THEN
- BEGIN
- Do_Last(title,str2,miles_places,count);
- Get_Real_String(rally_data[miles_places[count].team_number].total_miles,
- str3)
- END;
- period:='.';
- Insert(period,str3,Length(str3));
- Sw_Place(place,str,str2,str3)
- END;
-
- IF title = div_title THEN
- BEGIN
- IF item = div1_item THEN place:=1
- ELSE IF item = div2_item THEN place:=2
- ELSE IF item = div3_item THEN place:=3
- ELSE IF item = div4_item THEN place:=4;
- str:='BY GROUPING';
- FOR count:=1 TO max_participants DO
- BEGIN
- temp_arr[count].used:=FALSE;
- temp_arr[count].score:=0;
- temp_arr[count].team_number:=count
- END;
- FOR count:=1 TO 8 DO
- BEGIN
- temp_arr[count].score:=division_array[count].average;
- IF division_array[count].name<>' ' THEN temp_arr[count].used:=TRUE;
- END;
- Do_Order(temp_arr);
- Get_Real_String(temp_arr[place].score, str3);
- str2:=division_array[temp_arr[place].team_number].name;
- IF place = 4 THEN
- BEGIN
- Do_Last(title,str2,temp_arr,count);
- Get_Real_String(temp_arr[count].score, str3);
- str2:=division_array[temp_arr[count].team_number].name
- END;
- Delete(str3,6,1);
- Sw_Place(place,str,str2,str3)
- END;
-
- Menu_Normal(menu3, title);
- IF title = exit2_title THEN
- BEGIN
- Erase_Menu( menu3 );
- Draw_Menu( menu );
- which_menu:=menu
- END
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- PROCEDURE Event_Loop;
-
- VAR
- which : INTEGER;
- msg : Message_Buffer;
-
- BEGIN
- REPEAT
- which := Get_Event( E_Message , 0, 0, 0, 0,
- false, 0, 0, 0, 0, false, 0, 0, 0, 0, msg,
- dummy, dummy, dummy, dummy, dummy, dummy );
- { Since we only asked for message events, we don't need to check that
- we did, indeed, get a message event. }
- IF which_menu=menu THEN
- BEGIN
- Do_Menu( msg[3], msg[4] );
- IF msg[4]=quit_item THEN quit:=TRUE
- END
- ELSE IF which_menu=menu2 THEN Do_Menu2( msg[3], msg[4] )
- ELSE IF which_menu=menu3 THEN Do_Menu3( msg[3], msg[4] );
- UNTIL quit = TRUE
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- Procedure Display_Intro;
-
- VAR
- d_box : Dialog_Ptr;
- text1,
- text2,
- text3,
- text4,
- text5,
- dash,
- q_btn : INTEGER;
-
- BEGIN
- d_box:=New_Dialog(8,0,0,50,11);
- text1:=Add_DItem( d_box, G_BoxText,none,1,1,48,2,1,(4096*Green)+
- (256*Black)+128+(16*7)+Green);
- Set_DText(d_box,text1,' Car ''Fun'' Rally Scoring Program ',System_Font,
- TE_Center);
- text2:=Add_DItem( d_box,G_Text,none,0,3,50,1,0,$1180);
- Set_DText(d_box,text2,'by ',System_Font,TE_Center);
- text3:=Add_DItem(d_box,G_Text,none,0,4,50,1,0,$1180);
- Set_DText(d_box,text3,'David B. Chiquelin',System_Font,TE_Center);
- dash:=Add_DItem(d_box,G_Text,none,1,5,48,1,0,$1180);
- OBJ_SetState(d_box,dash,Disabled,FALSE);
- Set_DText(d_box,dash,'--===========================--',
- System_Font,TE_Center);
- text4:=Add_DItem(d_box,G_Text,none,0,6,50,1,0,$1180);
- Set_DText(d_box,text4,'Portions of this product are Copyright (c) 1986,',
- System_Font,TE_Center);
- text5:=Add_DItem(d_box,G_Text,none,0,7,50,1,0,$1180);
- Set_DText(d_box,text5,'OSS and CCD. Used by permission of OSS.',
- System_Font,TE_Center);
- q_btn:=Add_DItem(d_box,G_Button,Selectable|Default|Exit_Btn,
- 23,9,5,1,0,$1180);
- Set_DText(d_box,q_btn,'OK',System_Font,TE_Center);
- Center_Dialog(d_box);
- dummy:=Do_Dialog(d_box,0);
- End_Dialog(d_box);
- Delete_Dialog(d_box)
- END;
-
- { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - }
-
- BEGIN {Main Program}
- quit:=FALSE;
- place_show:=FALSE;
- FOR dummy:=1 TO 8 DO
- score_ability[dummy]:=FALSE;
- IF Init_Gem >= 0 THEN
- BEGIN
- Init_Mouse;
- Menu_Setup;
- which_menu:=menu;
- Draw_Menu( menu );
- Hide_Menu;
- Display_Intro;
- Event_Loop;
- Erase_Menu( menu );
- Erase_Menu( menu2 );
- Erase_Menu( menu3 );
- Delete_Menu( menu );
- Delete_Menu( menu2 );
- Delete_Menu( menu3 );
- Exit_Gem
- END {Init_Gem}
- END.
-
-