 *** Welcome to SAD Ver.1.4.4.2k64 built at 2026-10-19 14:46:59 +0900 ***
 *** Today: 01:36:15 Wednesday 11/18/2026 ***
 OFF LOG;ON ECHO;READ 77 ;           1
! v2next B2 項目 5: VISIT で FitFunction・FitValue・ElementValues・OpticsProlog・OpticsEpilog を退避し、BYE で戻す (USE は 5 つとも消す)。gs と全行一致。
! 条件: 3 GeV の小さな LINE 2 本 (RING、R2)。ElementValues は Packages/Couple.n の変数。
MOMENTUM = 3 GEV;
DRIFT D1 = (L=1) D2 = (L=0.5);
QUAD QF = (L=0.3 K1=0.7) QD = (L=0.3 K1=-0.6);
MARK ST = ();
LINE RING = (ST QF D2 QD D1);
LINE R2 = (ST QD D2 QF);
FFS;
 *** SADScript Initialization: <SAD>/Packages/init.n ***
 *** Run time Environment:     <SAD>/Packages/init.local.n ***
 RFSW RADCOD RAD  FLUC  INTRA POL   COD  DAPER EMIOU K64   FOURI SMEAR
   F     F     F     T     F     F     T     F     F     T     F     T
 USE RING; CELL; CALC;
Out[1]:= USE
 Matched. (  0.000    ) DP = 0.01000  DP0 = 0.00000  ExponentOfResidual = 2.0  OffMomentumWeight =   1.000  CALEXP  
$$$       f AX    #######  #  -1.030478 $$$       f BX    #######  #   3.639144 $$$       f NX    #######  #    .121594
$$$       f AY    #######  #   1.158726 $$$       f BY    #######  #   4.407174 $$$       f NY    #######  #    .059726
$$$       f LENG  #######  #   2.100000
 ElementValues={K1[QF]:>0.5};
 FitFunction:=1+2;
 FitValue=7;
 OpticsProlog=11;
 OpticsEpilog=12;
 Print["A ",ElementValues," ",FitFunction," ",FitValue," ",OpticsProlog," ",OpticsEpilog];
A {K1[QF]:>.5} 3 7 11 12
 VISIT R2;
 Print["B ",ElementValues," ",FitFunction," ",FitValue," ",OpticsProlog," ",OpticsEpilog];
B ElementValues FitFunction FitValue OpticsProlog OpticsEpilog
 ElementValues={K1[QD]:>0.1};
 FitValue=99;
 BYE;
 Print["D ",ElementValues," ",FitFunction," ",FitValue," ",OpticsProlog," ",OpticsEpilog];
D {K1[QF]:>.5} 3 7 11 12
 VISIT R2;
 ElementValues={K1[QD]:>0.1};
 VISIT RING;
 Print["E ",ElementValues];
E ElementValues
 BYE;
 Print["F ",ElementValues];
F {K1[QD]:>.1}
 BYE;
 Print["G ",ElementValues];
G {K1[QF]:>.5}
 USE R2;
 Print["H ",ElementValues," ",FitFunction," ",FitValue," ",OpticsProlog," ",OpticsEpilog];
H ElementValues FitFunction FitValue OpticsProlog OpticsEpilog
 BYE;
 ???-FFS-Error-BYE without VISIT. 
 Exit;
 FFS                  end:  CPU time =     0.002 sec
 Design orbit length =   1.0000000000000000     
 RFSW RADCOD RAD  FLUC  INTRA POL   COD  DAPER EMIOU K64   FOURI SMEAR
   T     F     F     T     F     F     T     F     F     T     F     T
 In[2]:=  ???-getbuf-end of input stream
