OpenVMS Source Code Demos

SENSE_NONSENSE.COM

$!================================================================================================
$! title : csmis$com:sense_nonsense.com
$! author: NSR - 2010-07-20
$! use   : add the following line to your personal "login.com" found in directory SYS$LOGIN
$!         sens*e :== @CSMIS$COM:SENSE_NONSENSE.COM ! toggle DCL between case sensitive and normal
$! note  : modify "CSMIS$COM" as required. Use "SYS$LOGIN" if script is in your directory
$!       : DCL symbols must be declared in uppercase so they work properly from lower-case mode
$!================================================================================================
$    NAM = "-i-script: "+ F$ENVIRONMENT("PROCEDURE")		!
$    LIN = "==========="					!
$    J = F$LENGTH(NAM)						!
$    I = F$LENGTH(LIN)						!
$LOOP:
$    IF (I .LT. J)
$    THEN
$	LIN = LIN +"="
$	I = I + 1
$	GOTO LOOP
$    ENDIF
$    SAY := WRITE SYS$OUTPUT					!
$    VMS == F$GETSYI("VERSION")					!
$    IF (VMS .LES. "V7.2")					!
$    THEN							!
$	SAY "-w-oops, this program requires VMS version 7.2 or higher"
$       EXIT							!
$    ENDIF							!
$    IF P1 .EQS. ""						! IF USER WANTS TO TOGGLE
$    THEN							!
$	YADA = F$TRNLNM("SENSE_NONSENSE_STATE","LNM$JOB")	!
$	IF (YADA .EQS. "S")					! IF SENSITIVE
$	THEN							!
$	    P1 = "N"						! THEN MAKE NON-SENSITVE
$	ELSE							!
$	    P1 = "S"						! ELSE MAKE SENSITIVE
$	ENDIF							!
$    ENDIF							!
$    IF (P1 .EQS. "S")						!
$    THEN
$	SAY LIN
$	SAY NAM
$	SAY "-i-mode: setting your DCL to case sensitive"
$	SET PROC/CASE=SENS/PARSE=EXTENDED
$	DEF/JOB/NOLOG SENSE_NONSENSE_STATE "S"
$	SAY LIN
$	EXIT
$    ENDIF
$    IF (P1 .EQS. "N")						!
$    THEN
$	SAY LIN
$	SAY NAM
$	SAY "-i-mode: setting your DCL to case non-sensitive"
$	SET PROC/CASE=BLIND/PARSE=TRADITION
$	DEF/JOB/NOLOG SENSE_NONSENSE_STATE "N"
$	SAY LIN
$	EXIT
$    ENDIF
$	SAY LIN
$	SAY NAM
$	SAY "-w-oops: P1 '",P1,"' is not supported"
$	SAY "-i-mode: no change"
$	SAY LIN
$	EXIT