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

LADKERM2.m

Go to the documentation of this file.
  1. LADKERM2 ;SLC/RWF/DLG - BUILD A KERMIT FILE TO SEND ;2/8/90 14:50 ;
  1. ;;5.2;AUTOMATED LAB INSTRUMENTS;;Sep 27, 1994
  1. ;Call with X=data, LAKTYPE=record type, TSK=instrument #
  1. ;Files the records in ^LA(TSK,"O",n)
  1. Q
  1. L1 S:'$D(LAKRM) LAKRM=94,LAKSEQ=0 S:LAKTYPE="S" LAKSEQ=0
  1. I LAKTYPE'="S" D POUND:X["#",QCTRL:X?.E1C.E
  1. F IX2=0:0 D L2 Q:X']""
  1. Q
  1. L2 S LAKSPK=$C(LAKSEQ+32)_LAKTYPE_$E(X,1,+LAKRM),X=$E(X,LAKRM+1,299)
  1. D SPACK^LADKERMI S LAKSEQ=LAKSEQ+1#64
  1. L ^LA(TSK) S O=^LA(TSK,"O")+1,^("O")=O,^("O",O)=LAKSPK L
  1. Q
  1. POUND F I=2:1 S I=$F(X,"#",I) Q:I<1 S X=$E(X,1,I-2)_"#"_$E(X,I-1,999)
  1. Q
  1. QCTRL F I=2:1 Q:I>$L(X) I $A(X,I)<32 S X=$E(X,1,I-1)_"#"_$C($A(X,I)+32)_$E(X,I+1,999)
  1. Q
  1. START ;A call is made to here once to do setup.
  1. S LAKTYPE="S",X="~} @-#N1" D L1
  1. Q
  1. END ;At the end of data a call is made to here.
  1. S LAKTYPE="Z",X="" D L1 S LAKTYPE="B",X="" D L1,SEND L G QUIT
  1. Q
  1. SEND L ^LA(TSK,"P") Q:$S($D(^LA(TSK,"P")):$P(^("P"),"^",2),1:"QUIT")'="QUIT" Q:^LA(TSK,"O")'>^LA(TSK,"O",0)
  1. S ^LA(TSK,"P")="KERMIT^OUT",^("P3")=0,T=TSK L ^LA("Q") S Q=^LA("Q")+1,^("Q")=Q,^("Q",Q)=T L
  1. Q
  1. DATA ;A call is made to here for each record in the load list.
  1. S LAKTYPE="D" D L1 Q
  1. Q
  1. NEXT ;Finish old file start new.
  1. I LAKTYPE'="S" S LAKTYPE="Z" D L1
  1. S LAKTYPE="F",X="S "_LRFILE D L1
  1. Q
  1. QUIT K C,CHKSUM,LAKRM,LAKSEQ,LAKSPK,LAKTYPE,X,O
  1. Q