{$I-}program RT;{ Version of October, 1993}                {this short shell uses a variety of units from the Personality-Motivation-Performance (PMC) lab}                {to adapt this shell to other programs is easy, just set the main program that it should call}				{adapted from the STROOP-like RT programs written in 1991-1992}				{modified to allow for cleaner and more modifiable code}				{The main modifications have been to standardize the units with the other PMC programs}				{As well as to split RT and Scoring procedures into two units to allow for more rapid modification}	uses    {the basic PMC utilities + specific ones for reaction time}		Globals_unit, {defines constants across all PMC programs}		Utilities_unit, {useful utilities for windows and file manipulations}		Exper_unit,   {useful experimental procedures}		TimingRoutines, {mainly out of date timing procedures  external library for reaction time -- if MacPlus}		RT_unit, {the main set of rt experiments including simple and various choice rts}		Score_RT_unit, {scoring routines for these RT programs}		Dialog_unit;    {dialog procedures -- actually dialog_unit_exp}begin		 {RT}                               {first, some global parameters need to be set from this shell}	lastmenu := 9;       {must be specified in program.  Should match resource file}	summarized := false;   {global variable  -- set in this program}	STARTUP;  {various MAC type initializations}	InitScreen;   {set the screen to the size of this Mac}	debug_RT := false;	Set_RT_Defaults(131);  {go get the RT defaults from the dialog number for RT Defaults}                                            {one of the parameters is whether or not to allow the experimenter to change parameters}                                            {this way we can give stand alone programs to subjects or tailor them in experiments}	if get_rt_params then    {the normal way for the program to work is to ask the experiment to fix parameters}		begin			dont_quit := Tell_about(101, 103); {give an introduction to the program -- quit if cancel is selected}                               {the Main Event Loop is repeated until Go or Quit is selected in the File menu}                               {this allows parameters to be set in the menu bars while waiting to start the experiment}			if dont_quit then				begin					repeat {wait until told to quit  (i.e., a mouse down or key press)}                {process all calls to the menus in order to set parameters or start the program}						begin  {this is the "main event loop" of the shell}							CheckForCommand;     {use this  to allow for menus and options}                                                     {all menu selections are handled here}                                                      {parameters are passed to the program through setting ShMenu.N[m] to specific values}							if SHmenu.two[5] then          {option 3 (go)  was selected in the file menu}								begin									Stroop_RT;                             {run the stroop program with its various options}									SHmenu.two[5] := false;           {turn go off after running}									Checkitem(mymenus[2], 5, false);									summarized := true;									wait_for_go;									Score_RTs;    {call the scoring program to give output to the subject}									wait_for_quit;									ShMenu.two[3] := true;								end;							if SHmenu.two[6] then            {option 6 was selected in the file menu, i.e., the score option}								begin									Score_RTs;                           {report the scores for a particular subject}									SHmenu.two[6] := false;									Checkitem(mymenus[2], 6, false);									SHmenu.two[3] := true;          {it is time to quit}								end;						end;					until SHmenu.two[3]; {end of repeat loop -- i.e., the third value of the file menu  (quit)}					close(datafile);					message(180);				end;		end	else		begin   {the stand alone version  -- measures mood, gives an RT task, then measures mood again}			ClearMenuBar;              {hide it so the subject can not see it}			DrawMenuBar;       {this line with the one above hides the menu}			dont_quit := Tell_about(841, 842); {give an introduction to the program}			if dont_quit then  {quit if cancel was selected}				begin					dont_quit := Time_of_day(845);  {ask the subject for their initials and find out the time of day}					if dont_quit then						begin							sliders(833, mood1);   {measure mood}							Stroop_RT;                             {run the stroop program with its various options}							sliders(833, mood2);   {measure mood again}							store_mood(mood1);      {writes this to the end of the data file}							store_mood(mood2);							close(datafile);							DrawMenuBar;     {redraw the menus -- they have been reloaded already}						end;				end;			message(180);    {thank you for using the PMC programs}		end;end.