RGUTIN ;CAIRO/DKM - Platform specific inits;04-Sep-1998 11:26;DKM
;;2.1;RUN TIME LIBRARY;;Mar 22, 1999
;=================================================================
N RGOS,RGD,RGH,X
S U="^",X="ERROR^RGUTIN",@^%ZOSF("TRAP"),RGOS=$P(^%ZOSF("OS"),U,2)
I 'RGOS D
.D HOME^%ZIS,TITLE^RGUT("RTL Platform-specific Inits",1.6)
.S RGD(1)="$$TEST^RGUTIN(""RGUTIN""_%S)"
.S RGH(1)="Enter the name of this MUMPS environment for the RG-namespace"
.S RGH(2)="platform-specific initialization process."
.S RGOS=$$ENTRY^RGMSCLKP("^DD(""OS"")","UX","Operating System: ","B","*","RGD","",0,5,"","","HELP(.RGH)")
.W !!
D:RGOS>0 INIT(RGOS)
Q
INIT(RGOS) ;
N I,X,Y,Z
S X="RGUTIN"_RGOS,I=0
I '$$TEST(X) D Q
.X "ZL RGUTOS1 ZS RGUTOS"
.W !!,"Init not found for specified OS. Will use generic init.",!!
K ^TMP($J)
F Z=0,RGOS F X=$S(Z:3,1:1):1 S Y=$T(+X^@("RGUTIN"_Z)) Q:Y="" S I=I+1,^TMP($J,I)=Y
S $P(^TMP($J,1),";")="RGUTOS "
X "ZR F Z=1:1:I ZI ^TMP($J,Z) ZS:Z=I RGUTOS"
W !!,"Initialization completed for "_$P(^DD("OS",RGOS,0),"^")_" operating system.",!!
K ^TMP($J)
Q
TEST(X) X ^%ZOSF("TEST")
Q $T
ERROR W !!,"An error has occurred during initialization.",!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRGUTIN 1202 printed Nov 22, 2024@17:47:15 Page 2
RGUTIN ;CAIRO/DKM - Platform specific inits;04-Sep-1998 11:26;DKM
+1 ;;2.1;RUN TIME LIBRARY;;Mar 22, 1999
+2 ;=================================================================
+3 NEW RGOS,RGD,RGH,X
+4 SET U="^"
SET X="ERROR^RGUTIN"
SET @^%ZOSF("TRAP")
SET RGOS=$PIECE(^%ZOSF("OS"),U,2)
+5 IF 'RGOS
Begin DoDot:1
+6 DO HOME^%ZIS
DO TITLE^RGUT("RTL Platform-specific Inits",1.6)
+7 SET RGD(1)="$$TEST^RGUTIN(""RGUTIN""_%S)"
+8 SET RGH(1)="Enter the name of this MUMPS environment for the RG-namespace"
+9 SET RGH(2)="platform-specific initialization process."
+10 SET RGOS=$$ENTRY^RGMSCLKP("^DD(""OS"")","UX","Operating System: ","B","*","RGD","",0,5,"","","HELP(.RGH)")
+11 WRITE !!
End DoDot:1
+12 if RGOS>0
DO INIT(RGOS)
+13 QUIT
INIT(RGOS) ;
+1 NEW I,X,Y,Z
+2 SET X="RGUTIN"_RGOS
SET I=0
+3 IF '$$TEST(X)
Begin DoDot:1
+4 XECUTE "ZL RGUTOS1 ZS RGUTOS"
+5 WRITE !!,"Init not found for specified OS. Will use generic init.",!!
End DoDot:1
QUIT
+6 KILL ^TMP($JOB)
+7 FOR Z=0,RGOS
FOR X=$SELECT(Z:3,1:1):1
SET Y=$TEXT(+X^@("RGUTIN"_Z))
if Y=""
QUIT
SET I=I+1
SET ^TMP($JOB,I)=Y
+8 SET $PIECE(^TMP($JOB,1),";")="RGUTOS "
+9 XECUTE "ZR F Z=1:1:I ZI ^TMP($J,Z) ZS:Z=I RGUTOS"
+10 WRITE !!,"Initialization completed for "_$PIECE(^DD("OS",RGOS,0),"^")_" operating system.",!!
+11 KILL ^TMP($JOB)
+12 QUIT
TEST(X) XECUTE ^%ZOSF("TEST")
+1 QUIT $TEST
ERROR WRITE !!,"An error has occurred during initialization.",!
+1 QUIT