else if (str[0] == 35)
    {
      /* '#' comment line, do nothing */
      nni--;			/* don't count as instruction */
    } else if (str[0] == 59)
    {
      /* ';' comment line, do nothing */
      nni--;			/* don't count as instruction */
    } else if (str[0] == 10)
    {
      /* empty line, do nothing */
      nni--;			/* don't count as instruction */
    } else if ((p = strstr(str, "firstevent")) != NULL)
    {
      nret = sscanf(str, "%s %i", str1, &firstEvent);
      CheckNoArgs(nret, 2, str);
      printf("will start sorting at event %d\n", firstEvent);
      fflush(stdout);
    } else if ((p = strstr(str, "exit")) != NULL)
    {
      printf("will skip rest of chat file\n");
      fclose(fp);
      printf("\n");
      printf("chat file: <%s> closed\n", name);
      printf("processed %i sort instructions and %i lines\n", nni, nn);
      printf("\n");
      fflush(stdout);
      return (0);
    } else if ((p = strstr(str, "abort")) != NULL)
    {
      printf("will abort\n");
      fclose(fp);
      printf("\n");
      printf("chat file: <%s> closed\n", name);
      printf("processed %i sort instructions and %i lines\n", nni, nn);
      printf("\n");
      fflush(stdout);
      exit(0);
    } else if ((p = strstr(str, "output")) != NULL)
    {
      if(!HaveRootFileName)
        {
        nret = sscanf(str, "%s %s", str1, ROOTFile);
        CheckNoArgs(nret, 2, str);
        printf("will store spectra in rootfile: %s\n", ROOTFile);
        UseRootFile = 1;
        fflush(stdout);
        }
      else
        {
        printf("ignoring chatfile option - since rootfile name is specified on commandline\n");
        };
    } else if ((p = strstr(str, "sharedmem")) != NULL)
    {
      st = nret = sscanf(str, "%s %s %i", str1, ShareMemFile, &SizeShareMemFile);
      CheckNoArgs(nret, 3, str);
      printf("will use shared memory file: %s\n", ShareMemFile);
      printf("__of max size: %i bytes\n", SizeShareMemFile);
      UseShareMemFile = 1;
      fflush(stdout);
    } else if ((p = strstr(str, "startmapaddress")) != NULL)
    {
      nret = sscanf(str, "%s 0x%x", str1, &StartMapAddress);
      CheckNoArgs(nret, 2, str);
      printf("will start shared mem at address: 0x%8.8x\n", StartMapAddress);
      fflush(stdout);
    } else if ((p = strstr(str, "include")) != NULL)
    {
      nret = sscanf(str, "%s %s", str1, str2);
      CheckNoArgs(nret, 2, str);
      printf("will now include chatscript %s\n", str2);
      fflush(stdout);
      GSSort_read_chat(str2);
      printf("done including chatscript %s\n", str2);
      fflush(stdout);
    } else if ((p = strstr(str, "rootfileoption")) != NULL)
    {
      if (!InputSourceOnCommandLine)
      {
	nret = sscanf(str, "%s %s", str1, ROOTFileOption);
	CheckNoArgs(nret, 2, str);
	printf("will update %s with option <%s>\n", ROOTFile, ROOTFileOption);
	if ((p = strstr(ROOTFileOption, "UPDATE")) != NULL)
	{
	  UpdateRootFile = TRUE;
	  printf("will update root file\n");
	} else if ((p = strstr(ROOTFileOption, "RECREATE")) != NULL)
	{
	  UpdateRootFile = FALSE;
	  printf("will recreate root file\n");
	} else
	{
	  printf("option <%s> not valid!\n", ROOTFileOption);
	  printf("valid options are: RECREATE or UPDATE\n\n");
	  exit(0);
	};
      } else
      {
	printf("__ignoring chatscript option since it is specified on command line\n");
      };
      fflush(stdout);
    } else if ((p = strstr(str, "printevents")) != NULL)
    {
      nret = sscanf(str, "%s %i", str1, &NumToPrint);
      CheckNoArgs(nret, 2, str);
      printf("will print details of the first %i events\n", NumToPrint);
      fflush(stdout);
    } else if ((p = strstr(str, "beta")) != NULL)
    {
      nret = sscanf(str, "%s %f", str1, &Beta);
      CheckNoArgs(nret, 2, str);
      printf("will use Beta (v/c) correction of %f\n", Beta);
      fflush(stdout);
    } else if ((p = strstr(str, "dumpevery")) != NULL)
    {
      nret = sscanf(str, "%s %i", str1, &DumpEvery);
      CheckNoArgs(nret, 2, str);
      printf("will dump to output file every %i minutes\n", DumpEvery);
      fflush(stdout);
    } else if ((p = strstr(str, "hiresdatamult")) != NULL)
    {
      nret = sscanf(str, "%s %f", str1, &HiResDataMultFactor);
      CheckNoArgs(nret, 2, str);
      printf("will multiply hi res data with factor %f\n", HiResDataMultFactor);
      fflush(stdout);
    } else if ((p = strstr(str, "egemin")) != NULL)
    {
      nret = sscanf(str, "%s %i", str1, &egemin);
      CheckNoArgs(nret, 2, str);
      printf("will require %i minimum germanium signal\n", egemin);
      fflush(stdout);
    }