subroutine newcmd(Cmdid,Status) implicit none c c Comments here c c I cmdid (i) Command id c O status (i) Error flag (0=OK) c integer Cmdid, Status c c Local variables c logical logpar character*100 strpar integer intpar, listnum, dlistnum, listmax parameter(listmax = 100) real*4 realpar, listary(listmax) real*8 dblpar, dlistary(listmax) Status = 0 c c Check number of arguments here c c Note: wrongargs prints arguments which are unaccounted c for and sets status to -1 c call numcarg(cmdid,argc,status) if ( argc.ne.0 ) wrongargs(cmdid, status) c c This is just an example where the command takes no arguments c command usage -> command parameter=value parameter=value argument c A couple of options are available for retrieving arguments: c c Returns next argument as string c call nextcarg(cmdid, argument, MAX_STRLEN, status) c c Returns concatenation of all remaining arguments c call catcarg(cmdid, therest, MAX_STRLEN, Status) c c c Retrieve parameters c CALL GPARL(Cmdid,'LOGPAR',logpar,status) CALL GPARS(Cmdid,'STRPAR',strpar,status) CALL GPARI(Cmdid,'INTPAR',intpar,status) CALL GPARR(Cmdid,'REALPAR',realpar,status) CALL GPARD(Cmdid,'DBLPAR',dblpar,status) CALL GPARLR(Cmdid,'LISTPAR',listary,listnum,listmax,status) CALL GPARLD(Cmdid,'DLISTPAR',dlistary,dlistnum,listmax,status) if ( status.ne.0 ) return c c Command body c return end