Changeset 241 for trunk


Ignore:
Timestamp:
Feb 1, 2006 9:54:40 AM (14 years ago)
Author:
forrest
Message:

out sleep

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Test/Cbc_ampl.cpp

    r240 r241  
    243243    int found=0;
    244244    int foundLog=0;
    245     const char * something[]={"sleep","solve","branch","duals","primals"};
     245    int foundSleep=0;
     246    const char * something[]={"solve","branch","duals","primals"};
    246247    for (i=0;i<info->numberArguments;i++) {
    247248      unsigned int j;
     
    251252        if (!strncmp(argument,check,sizeof(check))) {
    252253          found=(int)(j+1);
    253           break;
    254254        } else if (!strncmp(argument,"log",3)) {
    255255          foundLog=1;
     256        } else if (!strncmp(argument,"sleep",5)) {
     257          foundSleep=1;
    256258        }
    257259      }
    258       if (found)
    259         break;
    260260    }
    261261    if (foundLog) {
     
    271271      info->arguments=(char **) realloc(info->arguments,(info->numberArguments+1)*sizeof(char *));
    272272      info->arguments[info->numberArguments++]=strdup("-solve");
    273     } else if (found==1) {
    274       /* loop to let user copy .nl file */
    275       int j;
    276       for (j=0;j<10;j++) {
    277         fprintf(stderr,"You can copy .nl file %s for debug purposes or attach debugger\n",saveArgv[1]);
    278         sleep(60);
    279       }
     273    }
     274    if (foundSleep) {
     275      /* let user copy .nl file */
     276      fprintf(stderr,"You can copy .nl file %s for debug purposes or attach debugger\n",saveArgv[1]);
     277      fprintf(stderr,"Type q to quit, anything else to continue\n");
     278      char getChar = getc(stdin);
     279      if (getChar=='q'||getChar=='Q')
     280        exit(1);
    280281    }
    281282  }
Note: See TracChangeset for help on using the changeset viewer.