Index: FLOWTOE3.mac.rou =================================================================== diff -u -r3389 -r3431 --- FLOWTOE3.mac.rou (.../FLOWTOE3.mac.rou) (revision 3389) +++ FLOWTOE3.mac.rou (.../FLOWTOE3.mac.rou) (revision 3431) @@ -576,13 +576,14 @@ For Set SortKey=$O(arSplit(SortKey)) Quit:SortKey="" Do . Set NTOENr=$$GETNUM^FLOW("KTO","KTO1"),NTLNr(NTOENr)="" . Set R=^KTO(LEVNr,TOENr,1),^KTO(LEVNr,NTOENr,1)=R + . Set ^KTO1(NTOENr)=LEVNr_D . Set (TLNr,LCount)=100 . For Set TLNr=$O(arSplit(SortKey,TLNr)) Quit:TLNr="" Do . . Set LCount=LCount+1 . . Do LMOVE(TOENr,TLNr,NTOENr,LCount) . Set ^KTO(LEVNr,NTOENr,0)=$$NEXTFREE(LEVNr,NTOENr),TLUNr=$$NEXTTLUNR(LEVNr,NTOENr)\100 . Set:$G(^KTO(LEVNr,NTOENr,4))