%GI ;GLOBAL INPUT ; APJ849 01/11/00 ; Compiled December 21, 2000 16:00:47 ; +--------------------------------------------------------+ ; | Copyright 1986-2000 by InterSystems Corporation, | ; | Cambridge, Massachusetts, U.S.A. | ; | All rights reserved. | ; | | ; | Confidential, unpublished property of InterSystems. | ; | | ; | This media contains an authorized copy or copies | ; | of material copyrighted by InterSystems and is the | ; | confidential, unpublished property of InterSystems. | ; | This copyright notice and any other copyright notices | ; | included in machine readable copies must be reproduced | ; | on all authorized copies. | ; +--------------------------------------------------------+ ;%system.INC ; LRS439 06/30/00 ;%ST.INC DAS309 10/20/99 N S $ZT="ERRDEV",$ZE="" ;no variables escape! W !,"Global input",! D IN^%IS Q:POP I IO=$I W !,"(cannot load from THIS device)" Q S x=$$header^%Wgr(IO_":"_IOPAR,5,0),DESC=$p(x,$c(13,10),1),DAT=$p(x,$c(13,10),2) U 0 W !,"Globals were saved on ",DAT,!,"with description: ",$p(DESC,"~Format=",1),! OPT R !,"Input option: ",ASN G ERRNO:ASN="" S ASN=$$UC($E(ASN)) I "AS"'[ASN W ! DO W ! G OPT . W !?4,"Select A to restore all globals" . W !?4," or S to select globals to restore, one by one." I IOT="MT"!(IOT="BT") O @(IO_":"_IOPAR) D READYMT I POP Q A ; s fmt=5 i '($zv["VMS") i IO?2N u IO w *-5 c IO ;magtape s dev=IO_":"_IOPAR s gui=0 s mask="*" i ASN="A" s confo=0,confr=0 e s confr=1,confo=0 s x=$$main^kuWgr(dev,fmt,mask,confo,confr,gui) s $zt="" u 0 q ERRDEV ;error while preparing (opening file) to load globals S $ZT="",ZE=$ZE,$ZE="" U 0 I ZE]"" W !,"Received error: ",ZE C IO Q ERRNO S $ZT="" U 0 W !,"No globals loaded.",! C IO Q READYMT U IO S %Z=$ZA U 0 I %Z\64#2=1 Q ;is READY R !,"Enter when tape is ready or STOP...",X I $$STOP(X) S POP=1 Q ;entered STOP or similar G READYMT UC(x) q $zcvt(x,"u") YN(P,D,t) N R,X S P=$G(P),D=$E($G(D)_"?"),t=$G(t) ;ask Yes/No w/ Prompt,Default S D=$S("Yy"[D:"Yes => ","Nn"[D:"No => ",1:"") ;Yes, No or no default F W !,P_"? "_D Read:t R:t Read:'t R DO I "^YN"[R Q ;timed or non-timed read . S X=R,R=$TR($E(R_D_"?"),"yn","YN") I "^YN"'[R W " enter Yes or No, please" S POP=(R="^") W $E($S(R="N":"No",R="Y":"Yes",1:""),$L(X)+1,3) Q R STOP(x) S x=$$UC($E(x,1,4)) Q (x["EXIT")!(x["STOP")!(x["QUIT")!(x["HALT")!($E(x)="^")