1000 EXTEND & ! SET.BAS - Example of a utility to trap a suboption of a complex & ! DCL command (in this case, SET HOST). & ! & ! V1.0-00 - 11-May-88 - tmk & ! 1010 CMD$=SYS(CHR$(7%)) & ! Get user's SET command & \ CMD2$=CVT$$(CMD$,32%) & ! Convert to upcase & \ I%=INSTR(1%,CMD2$,"/") & \ I%=LEN(CMD2$) IF I%=0% & ! Get location of first option, or length if none & \ J%=INSTR(1%,CMD2$," HO") & ! Get location of HOST option - attempt 1 & \ GOTO 1020 IF J%<>0% & ! If found as HO & \ J%=INSTR(1%,CMD2$," HO") & ! Get location of HOST option - attempt 2 & ! Note: The above code is "HO" 1020 GOTO 1030 IF J%=0% & \ GOTO 1030 IF J%>I% & ! Skip if no HOST found before 1st option & \ A$=SYS(CHR$(6%)+CHR$(32%)+CHR$(1%)+STRING$(3%,0%)+"USER1"+CHR$(0%)) & \ GOTO 1030 IF MID(A$,3%,1%)=CHR$(0%) & ! Check for USER1 priv. Proceed if present & \ PRINT "?SET HOST requires USER1 privilege."+CHR$(7%)+CHR$(13%) & \ GOTO 32767 & ! Else give the error message 1030 A$=SYS(CHR$(14%)+"$_"+CMD$) & ! Issue the command directly to DCL 32767 END