00001
00002 c
00003 c Copyright (c) 1986,1987,1988,1989,1990,1991,1992,1993,
00004 c by Steve McMillan, Drexel University, Philadelphia, PA.
00005 c
00006 c All rights reserved.
00007 c
00008 c Redistribution and use in source and binary forms are permitted
00009 c provided that the above copyright notice and this paragraph are
00010 c duplicated in all such forms and that any documentation,
00011 c advertising materials, and other materials related to such
00012 c distribution and use acknowledge that the software was developed
00013 c by the author named above.
00014 c
00015 c THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
00016 c IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
00017 c WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00018 c
00019
00020 subroutine nextcmd(string,istart,ns,prompt)
00021 save
00022 c
00023 c Simple parser. Return in string(1:ns) the next input command.
00024 c Commands may be issued several to a line, delimited with a semicolon.
00025 c If no commands are left in the current line, prompt for and read in
00026 c a new command line.
00027 c
00028 c This routine is used by the "2dplot" subpackage.
00029 c
00030 save
00031 character*(*) string,prompt
00032 character*200 line
00033 c
00034 data iscolon/0/nl/-1/line/' '/
00035 c
00036 if (ns.lt.0) line = ' '
00037 c
00038 10 if (iscolon.gt.nl) then
00039 c
00040 call devoff
00041 call getstring(prompt,1,len(prompt),line)
00042 c
00043 c Strip off trailing blanks and non-significant semicolons.
00044 c
00045 nl = len(line)
00046 iscolon = nl+1
00047 call stripbl(line,nl,*10,*10)
00048 iscolon = 0
00049 c
00050 end if
00051 c
00052 c Split the line into individual commands.
00053 c
00054 string = ' '
00055 call getnext(line,nl,iscolon,ic0,ic1,string,ns)
00056 c
00057 c Strip leading blanks, convert the current command to lowercase,
00058 c and locate the start of the argument list.
00059 c
00060 call cleanup(string,ns,istart,*10)
00061 c
00062 c Note: The entire command is string(1:ns)
00063 c The argument list is string(istart:ns)
00064 c
00065 end