Subfile sort

475 pts.
Tags:
SQL
Subfile
I have a subfile program for updating, creating, and displaying item information the user can select from to create, view or update detail. The subfile shows item number, description, etc from my main file (i'll call itemnum1)and a vendor item number from an auxiliary file (itemnum2). My question is the users want to be able to hit a function key and have the subfile change from item number sort, to item description sort, or vendor item sort. the subfile currently is read from itemnum1 keyed on item number. Is there a way to sort the subfile without having to have multiple logicals?

Answer Wiki

Thanks. We'll let you know when a new response is added.

If it is a large file, you should use logical files.
If is is a small file, by useing arrays in a data structure you can do a SORTA.
Another option is to use SQL within your program and grab the records using the ORDER BY clause.

Discuss This Question: 10  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • filuphaze
    I am using ILE on an iseries.
    475 pointsBadges:
    report
  • The Most-Watched IT Questions: March 8, 2011 - ITKE Community Blog
    [...] 8. Do you have any suggestions for a member who’s trying to sort subfiles in a subfile program? [...]
    0 pointsBadges:
    report
  • Sloopy
    The first thing is, you can't sort subfiles. You would have to clear the subfile and reload it with data in the new order. The second thing is, since this is live transactions, it's better to reload anywy to be sure of getting the most up-to-date view of the data. If you already have logical files in the right order, then use them. Otherwise you can either create them, or if that's not good practice in your place use embedded SQL as suggested by CharlieBrown. Using arrays is possible, you can have the same number of elements as the subfile maximum - 9,999 - but then the data is not current.
    2,195 pointsBadges:
    report
  • Splat
    One method would be to use a keyed data queue to sort the data. Load the subfile records to the data queue, clear the subfile, then reload the subfile from the data queue. I agree with CharlieBrown though, you'd be better served using logical files to load the subfile.
    11,315 pointsBadges:
    report
  • brettharris
    Using embedded SQL in your RPGLE is a very quick and easy way to 'sort' the subfile on demand without having to creating multiple logical files. I'm finding that embedded SQL does a lot of things well.
    40 pointsBadges:
    report
  • bernard85
    you'll find here a example for sorting a subfile. I used pointer and dedicated procedure to sort the items.
         H DFTACTGRP(*NO) actgrp('U6')
         h bnddir('U6')
         Fjrnanzwwd CF   E             WORKSTN SFILE(SFL1:SF1RRN) InfDS(wsDS)
    
          /copy cpy,u6Ibm_h
          /copy cpy,u6env_h
          /copy cpy,u6ifs_h
          /copy cpy,u6index_h
          /copy cpy,u6jrn_h
          /copy cpy,u6msg_h
          /copy cpy,u6screen_h
          /copy cpy,u6tree_h
          /copy cpy,u6xml_h
    
          //˜Global fields
         D G               DS                  qualified
         d  screen                        3u 0 inz(1)
         D  change                         N
         D  error                          N
         D  lAnzs                          *
         d  lAnz                           *   dim(18) inz(*null)
         d  lAnz1                          *   inz(*null)
         d  lAnz1_b4                       *   inz(*null)
         d  lAnz9                          *   inz(*null)
         d  lAnz9_B4                       *   inz(*null)
         d  lOpts                          *   inz(*null)
         d  lActions                       *   inz(*null)
         d  jrnExt                       10a   varying
         d  jrnPath                      80a   varying
         d  indexPath                    80a   varying
         d  fToSort                        n
          //‚--------------------------------------------------------------------
          //‚main
          //‚--------------------------------------------------------------------
         d JRNANZWW        pi
          /free
         d  index          ds                  likeDs(tIndex) based(pIndex)
           //‚welcome message
           msg_SndPM(pgmID:env_getWelcomeMessage());
           //‚Title
           ZTL='Work with Journals analysis';
           //‚Load function keys
           screen_SetAction(g.lActions:x'33':'0':%pAddr(F3):'F3=Exit');
           screen_SetAction(g.lActions:x'36':'1':%pAddr(f6):'F6=Save');
           screen_SetAction(g.lActions:x'3a':'1':%pAddr(f10):'F10=Move to top');
           screen_SetAction(g.lActions:x'b8':'1':%pAddr(f20):'F20=Renumber');
           screen_SetAction(g.lActions:x'f1':'1':%pAddr(Enter));
           screen_SetAction(g.lActions:x'f4':*ON :%pAddr(rollUP  ));
           screen_SetAction(g.lActions:x'f5':*ON :%pAddr(rolldown));
           zFK=screen_getfkentitle(g.lActions);
           //‚Load options
           screen_SetOption(g.lOpts:'E':*null:%pAddr(trtOpt)
           :'E=Entries');
           screen_SetOption(g.lOpts:'X':*null:%pAddr(trtOpt)
           :'X=XML');
           zCH=screen_getChoicesEntitle(g.lOpts);
           //‚load index                                                         -
           g.jrnPath=env_getpath(cJournal);
           g.jrnExt=env_getExt(cJournal);
           g.indexPath=g.jrnPath+g.jrnExt+'.index';
           g.lAnzs=tree_xml2tree(g.indexPath
                                :%pAddr(index_XMLinput));
           if g.lAnzs=*null;
             pIndex=Tree_getNewItem(%addr(tIndex):%size(tIndex));
             g.lAnzs=tree_getNewLink(pIndex);
           endIf;
           //‚browse files from folder                                           -
           ifs_browseFiles(g.jrnPath:%paddr(procFile));
           //‚Sort elements                                                        -
           tree_Sort(g.lAnzs:%paddr(index_comparator));
           g.lAnz1=tree_getFirst(g.lAnzs);
           wrkScreen();
           *inlr=*on;
          /end-free
          //‚--------------------------------------------------------------------
          //‚work screen
          //‚--------------------------------------------------------------------
         pwrkScreen        b
          /free
           dow g.screen>0;
             if G.screen=1;
               Screen1();
             endif;
           endDo;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Screen 1 - display form
          //‚--------------------------------------------------------------------
         p Screen1         b
         d fkProcess       pr                  extproc(pAction)
          *
         d pAction         s               *   procptr
         d fcontrol        s               n
          /free
           if g.lAnz9<>g.lAnz9_b4;
             sync();
           endIf;
           if g.lAnz1<>g.lAnz1_b4;
             loadWA1();
             loadSf1();
             //‚more item or bottom of list
             if tree_getNext(g.lAnz9)=*null;
               mySflEnd='Bottom';
             else;
               mySflEnd='More...';
             endIf;
           endIf;
           //‚display activation                                                 -
           write msgCtl;
           write hdr1;
           *in88=*on;
           *in89=*off;
           exfmt ctl1;
           msg_rmvPM(pgmID);
           //‚get/launch function key                                            -
           pAction=screen_getActionfromKey(g.lActions:wsds.kp:fcontrol);
           g.Error=*off;
           if pAction=*null;
             msg_SndPM(pgmID:'Function key invalid');
           else;
             if fControl;
               control();
             endIf;
             if not g.Error;
               fkProcess();
             endIf;
           endIf;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚to process file in directory
          //‚--------------------------------------------------------------------
         pControl          b
         d Control         pi
          *
         d Anz             ds                  likeDs(tElement) based(pAnz)
         d pCheckProc      s               *   procptr
         d checkProc       pr              n   extproc(pCheckProc)
         d  lAnz                           *
         d pOption         s               *
          /free
           readc sfl1;
           dow not %eof();
             *in01=*off;
             pAnz=tree_getitem(g.lAnz(sf1rrn));
             if anz.seq<>xSeq;
               anz.seq=xSeq;
               g.fToSort=*on;
             endIf;
             tree_SetOption(g.lAnz(sf1rrn):xChoice);
             if xChoice<>'';
               pOption=screen_GetOptionfromChoice(g.lOpts:xChoice);
               if pOption=*null;
                 g.error=*on;
                 msg_SndPM(pgmID:'Option "'+xChoice+'" is not valid');
                 *in01=*on;
               else;
                 pCheckProc=Screen_GetCheckProcFromOption(pOption);
                 if pCheckProc<>*null;
                   *in01=CheckProc(g.lanz(sf1rrn));
                   g.error=g.error or *in01;
                 endIf;
               endif;
             endif;
    
             update sfl1;
             readc sfl1;
           enddo;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚to process file in directory
          //‚--------------------------------------------------------------------
         pProcFile         b
         d procFile        pi
         d  wPAth                       255a   const varying
          *
         d lAnz            s               *
         d Anz             ds                  likeDs(tElement) based(pAnz)
          /free
           //‚Only take "*.jrn"
           if %scan('.'+g.jrnExt:wPath)=0;
             return;
           endIf;
           lAnz=tree_getItemfromList(g.lAnzs:kElement:wPath);
           if lAnz<>*null;
             pAnz=tree_getItem(lAnz);
           //‚Case of a new analysis not yet listed
           else;
             pAnz=Tree_getNewItem(%addr(tElement):%size(tElement));
             anz.ID=wPath;
             anz.seq=0;
             tree_linkToParent(g.lAnzs:tree_getNewLink(pAnz));
           endIf;
           //‚to confirm existance of analysis
           anz.exists=*on;
           xml_read(g.jrnPath+wPath:%paddr(ProcNode):pAnz);
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Procedure node
          //‚--------------------------------------------------------------------
         pProcNode         b
         dProcNode         pi              n
         d    NodeDefine                       likeDs(xml_NodeDefine)
         d    pAnz_                        *   const
          *
         d anz             ds                  likeDs(tElement) based(pAnz)
          /free
           if nodeDefine.ID='JOURNAL';
             pAnz=pAnz_;
             anz.text=nodeDefine.text;
             return *on;
           endIf;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Loadind work area
          //‚--------------------------------------------------------------------
         p loadWA1         b
          *
         d lAnz            s               *
         d i               s              3u 0
          /free
           clear g.lAnz;
           lAnz=g.lAnz1;
           for i=1 to 18;
             g.lAnz(i)=lAnz;
             g.lAnz9=lAnz;
             lAnz=tree_getNext(lAnz);
           endFor;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Loadind subfile
          //‚--------------------------------------------------------------------
         p loadSF1         b
          *
         d Anz             ds                  likeDs(tElement) based(pAnz)
          /free
           //‚clear subfile
           *in88=*off;
           *in89=*on;
           WRITE ctl1;
           //‚Reload subfile
           for sf1rrn=1 to 18;
             if g.lAnz(sf1rrn)=*null;
               leave;
             endIf;
             xChoice=tree_getOption(g.lAnz(sf1rrn));
             pAnz =tree_getItem(g.lAnz(sf1rrn));
             xSeq =anz.seq;
             xID  =anz.ID;
             xTitle=anz.text;
             write sfl1;
           endFor;
           g.lanz1_b4=g.lanz1;
           g.lanz9_b4=g.lanz9;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Roll-UP
          //‚--------------------------------------------------------------------
         p RollUp          b
          /free
           if G.lAnz1=tree_GetFirst(G.lAnzs);
             msg_SndPM(pgmID:'You have reached the top of the list');
           else;
             g.lAnz9=tree_getPrev(g.lAnz1);
           endIf;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Roll-down
          //‚--------------------------------------------------------------------
         p RollDown        b
          /free
           if mySflEnd='Bottom';
             msg_SndPM(pgmID:'You have reached the bottom of the list');
           else;
             g.lAnz1=tree_getNext(g.lAnz9);
           endIf;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Enter
          //‚--------------------------------------------------------------------
         p Enter           b
         d lAnz            s               *
         d Choice          s              1a
         d pOption         s               *
         d pValProc        s               *   procptr
         d ValProc         pr              n   extproc(pValProc)
         d                                 *
          /free
           if g.fToSort;
             g.fToSort=*off;
             //‚Sort elements                                                      -
             tree_Sort(g.lAnzs:%paddr(index_comparator));
             g.lAnz1_b4=*null;
             return;
           endIf;
           //
           lAnz=tree_getFirst(g.lAnzs);
           dow lAnz<>*null;
             choice=tree_getOption(lAnz);
             if choice<>'';
               pOption=screen_getOptionFromChoice(g.lOpts:choice);
               pValProc=screen_GetValidationProcFromOption(pOption);
               if pValProc<>*null;
                 if not valProc(lAnz);
                   tree_setOption(lAnz:'');
                 else;
                   leave;
                 endIf;
                 g.lAnz1_b4=*null;
               endIf;
             endIf;
             lAnz=tree_getNext(lAnz);
           endDo;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚F3=Exit
          //‚--------------------------------------------------------------------
         p f3              b
          /free
           G.screen=0;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚F6=Save
          //‚--------------------------------------------------------------------
         p f6              b
          /free
           f20();
           xml_tree2xml(g.indexPath:g.lAnzs:%paddr(index_XmlOutput));
           g.screen=0;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚F10=Move to top
          //‚--------------------------------------------------------------------
         p f10             b
          /free
           if SFLCSRRRN=0;
             msg_SndPM(pgmID:'Wrong cursor position');
           else;
             g.lAnz1=g.lAnz(sflcsrrrn);
           endIf;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚F20=Renumber
          //‚--------------------------------------------------------------------
         p f20             b
          *
         d Seq             s             10u 0 inz(0)
         d lAnz            s               *
         d Anz             ds                  likeDs(tElement) based(pAnz)
          /free
           //‚Resequence elements                                                -
           lAnz=tree_getFirst(g.lAnzs);
           dow lAnz<>*null;
             pAnz=tree_getItem(lAnz);
             if Anz.seq=0;
               leave;
             else;
               Seq+=10;
               Anz.seq=seq;
             endIf;
             lAnz=tree_getNext(lAnz);
           endDo;
           g.lAnz1_b4=*null;
          /end-free
         p                 e
          //‚------------------------------------------------------------------- ----
          //‚Synch
          //‚------------------------------------------------------------------- ----
         pSync             b
         d Sync            pi
          *
         d i               s              3u 0
         d lX              s               *
          /free
           for i=1 to 18;
             lX=tree_getPrev(G.lAnz1);
             if lX=*null;
               leave;
             endIf;
             G.lAnz1=lX;
           endFor;
          /end-free
         p                 e
          //‚-----------------------------------------------------------------------
          //‚Procedures for validate option selected
          //‚-----------------------------------------------------------------------
         ptrtOpt           b
         d trtOpt          pi              n
         d  lAnz                           *
         d rtn             s              3u 0
         d anz             ds                  likeDs(tElement) based(pAnz)
         d cmd             s             80a   varying
         d option          s              1a
         D JRNENTWW        pr                  extpgm('JRNENTWW')
         D  returncode                    1A   const
         D  jrnPath                      50a   const
          /free
           option=tree_getOption(lAnz);
           pAnz=tree_getItem(lAnz);
           if option='X';
             cmd='dspf '''+g.jrnPath+anz.ID+'''';
             qcmdexc(cmd:%len(cmd));
           elseif option='E';
             jrnentww(' ':g.jrnPath+anz.ID);
           endIf;
           return *off;
          /end-free
         p                 e
    
    380 pointsBadges:
    report
  • bernard85
    here is the dspf bounded:
         A                                      DSPSIZ(27 132 *DS4)
         A                                      CHGINPDFT(UL)
         A          R HDR1
         A                                      OVERLAY
         A            ZTL          100   O  1  2DSPATR(HI)
         A            ZCH          125A  O  4  3COLOR(BLU)
         A                                  3  1'Type options, press Enter.'
         A                                      COLOR(BLU)
         A                                  6  2'Opt'
         A                                      COLOR(WHT)
         A                                  6  6'Order'
         A                                      COLOR(WHT)
         A                                  6 12'-- Analysis ID --------------------
         A                                      -'
         A                                      COLOR(WHT)
         A                                  6 48'-- Entitle ------------------------
         A                                      ------------------------------------
         A                                      -----------'
         A                                      COLOR(WHT)
         A          R SFL1                      SFL
         A  01                                  SFLNXTCHG
         A            XCHOICE        1A  B  7  3
         A  01                                  DSPATR(RI PC)
         A            XSEQ           5Y 0B  7  6EDTCDE(Z)
         A            XID           35   O  7 12
         A            XTITLE        80A  O  7 48
         A          R CTL1                      SFLCTL(SFL1)
         A*%%TS  SD  20170924  155740  BERNARD85   REL-V7R3M0  5770-WDS
         A                                      CF01 CF02 CF03 CF04 CF05 CF06 CF07
         A                                      CF08 CF09 CF10 CF11 CF12 CF13 CF14
         A                                      CF15 CF16 CF17 CF18 CF19 CF20 CF21
         A                                      CF22 CF23 CF24 ROLLDOWN ROLLUP
         A                                      CSRLOC(CSRTOROW   CSRTOCOL)
         A                                      OVERLAY
         A                                      SFLCSRRRN(&SFLCSRRRN)
         A  88                                  SFLDSP
         A N89                                  SFLDSPCTL
         A  89                                  SFLCLR
         A                                      SFLSIZ(0018)
         A                                      SFLPAG(0018)
         A            SFLCSRRRN      5S 0H
         A            CSRTOROW       3S 0H
         A            CSRTOCOL       3S 0H
         A            SF1RRN         4S 0H
         A            MYSFLEND      11A  O 26120DSPATR(HI)
         A            ZFK          115A  O 26  3COLOR(BLU)
         A          R MSGSFL                    SFL SFLMSGRCD(27)
         A            MSGSFLKEY                 SFLMSGKEY
         A            PGMID                     SFLPGMQ(10)
         A          R MSGCTL                    SFLCTL(MSGSFL)
         A                                      SFLDSP SFLDSPCTL SFLINZ
         A N98                                  SFLEND
         A                                      SFLPAG(1) SFLSIZ(2)
         A            PGMID                     SFLPGMQ(10)
    
    380 pointsBadges:
    report
  • bernard85
    here is the module used to sort items:   

              H nomain option(*NOSHOWCPY)
          /copy cpy,u6env_h
          /copy cpy,u6tree_h
          /copy cpy,u6xml_h
    
          /copy cpy,u6index_h
          //‚--------------------------------------------------------------------
          //‚get item for index family for Xml parser
          //‚--------------------------------------------------------------------
         pindex_XmlInput...
         p                 b                   export
         d index_XmlInput...
         d                 pi              *
         d   nodeDefine                        const likeDs(xml_nodeDefine)
          *
         d   index         ds                  likeds(tIndex) based(pIndex)
         d   element       ds                  likeds(tElement) based(pElement)
          /free
           if NodeDefine.ID=iINDEX;
             pIndex=tree_getnewitem(%addr(tIndex):%size(tIndex));
             return pIndex;
    
           elseif NodeDefine.ID=iELEMENT;
             pElement=tree_getnewitem(%addr(tElement):%size(tElement));
             element.ID    =xml_getAttAsString ('ID' :NodeDefine.atts);
             element.exists=*OFF;
             element.Seq   =xml_getAttAsInteger('SEQ':NodeDefine.atts);
             return pElement;
    
           endIf;
    
           return *null;
          /end-free
         p                 e
          //‚--------------------------------------------------------------------
          //‚Set line for Xml parser from node on index family
          //‚--------------------------------------------------------------------
         pindex_XmlOutput...
         p                 b                   export
         d index_XmlOutput...
         d                 pi                  likeDs(xml_nodeDefine)
         d   lNode                         *   const
          *
         d   nodeDefine    ds                  likeDs(xml_nodeDefine)
         d   index         ds                  likeds(tIndex) based(pIndex)
         d   element       ds                  likeds(tElement) based(pElement)
          /free
           nodeDefine.ID='';
           nodeDefine.atts='';
           nodeDefine.text='';
           if tree_getKind(lNode)=kIndex;
             nodeDefine.ID=iINDEX;
             pIndex=tree_getItem(lNode);
           elseif tree_getKind(lNode)=kElement;
             NodeDefine.ID=iELEMENT;
             pElement=tree_getItem(lNode);
             xml_setAttfromInteger(nodeDefine.atts:'SEQ':element.seq);
             xml_setAttfromString(nodeDefine.atts:'ID':element.ID);
           endIf;
           return nodeDefine;
          /end-free
         p                 e
          //‚-----------------------------------------------------------------------
          //‚Comparator
          //‚-----------------------------------------------------------------------
         pindex_comparator...
         p                 b                   export
         d index_comparator...
         D                 PI             3i 0
         D  lElement1                      *   const
         D  lElement2                      *   const
          *
         D element1        ds                  likeDs(tElement) based(pElement1)
         D element2        ds                  likeDs(tElement) based(pElement2)
          *
          /free
            pElement1=tree_GetItem(lElement1);
            pElement2=tree_GetItem(lElement2);
            //‚-1 1st is lower than 2nd element                                   ----
            //‚+1 1st is greater than 2nd element                                 ----
            //‚0  they are equal                                                  ----
            if     Element1.Seq>0 and Element2.Seq=0;
              return -1;
            elseif Element1.Seq=0 and Element2.Seq>0;
              return +1;
            elseif Element1.Seq<Element2.Seq;
              return -1;
            elseif Element1.Seq>Element2.Seq;
              return +1;
            elseif Element1.ID<Element2.ID;
              return -1;
            elseif Element1.ID>Element2.ID;
              return +1;
            endif;
            return 0;
          /end-free
         P                 E
    
    380 pointsBadges:
    report
  • bernard85
    function to sort items 

          //‚-----------------------------------------------------------------------
          //‚Sort childs of a link
          //‚-----------------------------------------------------------------------
         Ptree_Sort        B                   export                               Sort
         D tree_sort       PI
         D   lParent                       *   const
         D   pComparator                   *   const procptr
          *
         d  lCurrent       S               *
         d  lNext          S               *
          /free
           //‚Start on the 2nd link
           lCurrent=tree_getNext(tree_getFirst(lParent));
           dow lCurrent<>*null;
             lNext=tree_getNext(lCurrent);
             tree_sort2(lParent:lCurrent:pComparator);
             lCurrent=lNext;
           endDo;
          /end-free
         P                 E
          //‚-----------------------------------------------------------------------
          //‚Sort childs of a link part2
          //‚-----------------------------------------------------------------------
         Ptree_sort2       B
         D tree_sort2      PI
         D   lParent                       *   const
         D   lCurrent                      *   const
         D   pComparator                   *   const procptr
          *
         d  lPrev          S               *
         d  lFirst         S               *
         d  lPreceding     S               *
         d  lFollow        S               *
         d  lGreater       s               *
          *
         D Comparator      PR             3i 0 extproc(pComparator)
         D  lElement1                      *   const
         D  lElement2                      *   const
          /free
           //‚Do noting if the previous is smaller
           lPrev=tree_getPrev(lCurrent);
           if comparator(lPrev:lCurrent)=-1;
             return;
           endIf;
    
           //‚Browse the list until find a smaller item
           lFirst =tree_getFirst(lParent);
           Dow comparator(lPrev:lCurrent)<>-1;
             lGreater=lPrev;
             if lPrev=lFirst;
               leave;
             endIf;
             lPrev=tree_getPrev(lPrev);
           endDo;
    
           //‚Linking 2 brothers
           lFollow   =tree_getNextReal(lCurrent);
           lPreceding=tree_getPrevReal(lCurrent);
           tree_Link2Brothers(lPreceding:lFollow);
    
           //‚Linking to parent (before the greater)
           tree_LinkToParent(lParent:lCurrent:lGreater);
    
          /end-free
         P                 E
          //‚------------------------------------------------------------------- ----
          //‚get link following
          //‚------------------------------------------------------------------- ----
         ptree_getNextReal...
         p                 b
         d tree_getNextReal...
         d                 pi              *
         d  pLink_                         *   const
          *
         dLink             ds                  likeDs(tLink) based(pLink)
          /free
           pLink=pLink_;
           return link.next;
          /end-free
         p                 e
          //‚------------------------------------------------------------------- ----
          //‚get link preceding
          //‚------------------------------------------------------------------- ----
         ptree_getPrevReal...
         p                 b
         d tree_getPrevReal...
         d                 pi              *
         d  pLink_                         *   const
          *
         dLink             ds                  likeDs(tLink) based(pLink)
          /free
           pLink=pLink_;
           return link.prev;
          /end-free
         p                 e
    380 pointsBadges:
    report
  • azohawk

    I have done this many times, I use multiple logical files that that each represent one of the allowed sorts. As the user selects various sorts, the appropriate logical is used to load the subfile. 

    I have not had to write one of these for several years (not sure I have written many subfile programs for years for that matter), with imbedded QL being more prevalent, there may be a way to use SQL to accomplish this, I have not explored these options.


    2,845 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: