Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: LEXDMGO

LEXDMGO.m

Go to the documentation of this file.
  1. LEXDMGO ;ISL/KER - Defaults - Manager/Overwrite ;04/21/2014
  1. ;;2.0;LEXICON UTILITY;**80**;Sep 23, 1996;Build 1
  1. ;
  1. ; Global Variables
  1. ; None
  1. ;
  1. ; External References
  1. ; ^DIR ICR 10026
  1. ;
  1. ; LEXOVER Flag - Overwrite user defaults (Y/N)
  1. ; LEXDNAM Default name
  1. ; LEXDVAL Default value
  1. ; LEXX Return value
  1. ;
  1. OVER(LEXX) ; Replace existing defaults
  1. S LEXX=$$OVERW Q LEXX
  1. OVERW(LEXX) ; Ask to overwrite (replace)
  1. W !
  1. OVERP ; Get user response
  1. N DIR,DTOUT,DUOUT,DIRUT,DIROUT,X,Y
  1. S DIR("A")="Replace existing user defaults? "
  1. S DIR("B")="No",DIR(0)="YAO",DIR("?")="^D OVRH^LEXDMGO"
  1. S DIR("??")="^D OVRH^LEXDMGO" D ^DIR K DIR I Y[U S LEXX=Y Q LEXX
  1. S LEXX=0 S:+Y>0 LEXX=1 Q LEXX
  1. OVRH ; Overwrite help
  1. W !!," By answering No:"
  1. W !!," Existing defaults will have precedence over the selected changes"
  1. W !," Replacing or deleting existing defaults will not be allowed"
  1. W !," Adding defaults where none previously existed will be allowed"
  1. W !!," By answering Yes:"
  1. W !!," Selected changes will have precedence over existing defaults"
  1. W !," Adding defaults where none previously existed will be allowed",!
  1. D DISCHG Q
  1. OVRCHG ; Display effects of overwrite changes
  1. I +($G(LEXOVER))>0 D Q
  1. . W !,"Replace existing defaults:"
  1. . W " Yes, existing defaults will be changed",! D DISCHG
  1. I +($G(LEXOVER))'>0 D Q
  1. . W !!,"Replace existing defaults:"
  1. . W " No, existing defaults will remain unaltered",!
  1. Q
  1. DISCHG ; Display changes
  1. D CHG("LEXDICS","filter"),CHG("LEXSHOW","display")
  1. D CHG("LEXSUB","vocabulary"),CHG("LEXCTX","shortcuts")
  1. Q
  1. CHG(LEXDVAL,LEXDNAM) ; Changes
  1. I $G(@LEXDVAL)="" D Q
  1. . W !," No changes made to the default ",LEXDNAM
  1. I $G(@LEXDVAL)'="@" D Q
  1. . W !," Existing ",LEXDNAM," will be replaced"
  1. I $G(@LEXDVAL)="@" D
  1. . W !," Existing ",LEXDNAM," will be deleted"
  1. Q