# # # # SRD command line generator # ========================== # # Author: William Wood # # Address: Computer Center # Institute For Cancer Research # 7701 Burholme Ave. # Philadelphia, Pa. 19111 # (215) 728 2760 # # Version: 1.0 # # Date: May 14, 1981 # # # # ******************************************************* # * * # * THIS SOFTWARE WAS DEVELOPED WITH SUPPORT * # * FROM THE NATIONAL INSTITUTES OF HEALTH: * # * NIH CA06927 * # * NIH CA22780 * # * * # * DIRECT INQUIRIES TO: * # * COMPUTER CENTER * # * THE INSTITUTE FOR CANCER RESEARCH * # * 7701 BURHOLME AVENUE * # * PHILADELPHIA, PENNSYLVANIA 19111 * # * * # * NO WARRANTY OR REPRESENTATION, EXPRESS OR * # * IMPLIED, IS MADE WITH RESPECT TO THE * # * CORRECTNESS, COMPLETENESS, OR USEFULNESS * # * OF THIS SOFTWARE, NOR THAT USE OF THIS * # * SOFTWARE MIGHT NOT INFRINGE PRIVATELY * # * OWNED RIGHTS. * # * * # * NO LIABILITY IS ASSUMED WITH RESPECT TO * # * THE USE OF, OR FOR DAMAGES RESULTING FROM * # * THE USE OF THIS SOFTWARE * # * * # ******************************************************* # * * # * THIS SOFTWARE WAS DESIGNED FOR USE ON A * # * PDP-11/70 OPERATING UNDER IAS V3.0 USING * # * THE FORTRAN-IV PLUS COMPILER. * # * * # ******************************************************* # # gcmd - get command line from MCR, TS, or terminal # This routine may be used by programs wishing to receive a # time sharing message (command line) from XEQ, a # command line from MCR, or a command line from the terminal # directly using a prompt. # # By William Wood, Sept 1980 # define(MCR,-2) define(MESSAGE,-1) define(TERMINAL,0) define(EOS,0) define(EOF,-10) subroutine gcmd(lun, prompt, buf, len, maxlen, source) byte prompt(1), buf(1) integer lun, len, maxlen, source integer i, j, junk logical first data first/.true./ len = 0 if (first) { first = .false. call getmcr(buf, len) if (len > 0) { source = MCR for (i = 1; i < len; i = i+1) if (buf(i) == ' ') break j = i for (i = i+1; i <= len; i = i+1) buf(i-j) = buf(i) len = len - j } else { call reccml(buf, len) source = MESSAGE } } if (len <= 0) { source = TERMINAL if (lun == 0) len = EOF else { repeat call readpr(lun, prompt, buf, len, maxlen-1, junk) until(len >= 0 | len == EOF) } } buf(max0(1, min0(maxlen, len+1))) = EOS return end # reccml - stub for IAS specific receive timesharing message subroutine reccml(buf, len) byte buf(1) integer len len = -80 return end