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

FSCLMPOS.m

Go to the documentation of this file.
  1. FSCLMPOS ;SLC/STAFF-NOIS List Manager Protocol Other Sort ;4/22/94 11:06
  1. ;;1.1;NOIS;;Sep 06, 1998
  1. ;
  1. SORT ; from FSCLMP
  1. I ^TMP("FSC LIST CALLS",$J)'>1 Q
  1. N CNT,DIC,DIR,DONE,LASTCNT,NUM,OK,SORT,X,Y K DIC,DIR,SORT,Y
  1. S CNT=0,OK=1,DIC=7107.2,DIC(0)="AEMOQZ",DIC("S")="I $P(^(0),U,3)'[""W"",'$D(SORT(""N"",$P(^(0),U)))",DIC("A")="Sort by: "
  1. S DONE=0 F D I DONE Q
  1. .D ^DIC
  1. .I $D(DUOUT)!$D(DTOUT) S DONE=1,OK=0 Q
  1. .I Y<1 S DONE=1 Q
  1. .S CNT=CNT+1,SORT(CNT)=Y(0),SORT("N",$P(Y,U,2))=""
  1. .I CNT>4 S DONE=1 W !,"Limit of 5 fields only."
  1. .I CNT=1 S DIC("A")="and then sort by: "
  1. K DIC,SORT("N"),Y
  1. I 'OK Q
  1. I '$O(SORT(0)) Q
  1. W !!,"The list will be sorted by:",!
  1. S (LASTCNT,CNT)=0 F S CNT=$O(SORT(CNT)) Q:CNT<1 S LASTCNT=CNT W CNT,") ",$P(SORT(CNT),U,2),$S($O(SORT(CNT)):", ",1:"")
  1. S DIR(0)="LAO^1:"_LASTCNT
  1. S DIR("A")="Select any fields to be sorted in descending order or <return>: "
  1. S DIR("?",1)="Descending order will sort from Z to A or highest value first."
  1. S DIR("?",2)="This is useful for sorting most recent dates first or"
  1. S DIR("?",3)="numeric value fields. Enter any of the sequence numbers of"
  1. S DIR("?",4)="the fields you have selected to sort by. (ex. 1,3-4)"
  1. S DIR("?",5)="If you want all fields sorted in ascending order, enter <return>."
  1. S DIR("?",6)="Enter '^' to exit without sorting or '??' for more help."
  1. S DIR("?")="^D HELP^FSCU(.DIR)"
  1. S DIR("??")="FSC U1 NOIS"
  1. D ^DIR K DIR
  1. I $D(DIRUT),Y'="" Q
  1. F CNT=1:1 S NUM=$P(Y,",",CNT) Q:NUM<1 S SORT(NUM,"D")=""
  1. D SORT^FSCUS(.SORT)
  1. Q