From: jhmeyers@miu.edu (John H Meyers)
Subject: VARS SORT ORDER (fast directory ordering)
Date: 13 May 1998 00:00:00 GMT
Message-ID: <6jd1g4$qru$1@news.iastate.edu>
References: <6iv30a$2it$1@nnrp1.dejanews.com> <6iva55$9jg$1@nnrp1.dejanews.com> <35564d9c.0@isoit370.bbn.hp.com>,<6j89vs$ba1$1@nnrp1.dejanews.com>
Reply-To: jhmeyers@miu.edu
Organization: MIU Computer Services,  Fairfield, IA 52557.  Not Approved.
Newsgroups: comp.sys.hp48


In article <6j89vs$ba1$1@nnrp1.dejanews.com>,
Carlos Marangon <hpfb@usa.net> writes:

> do you know the SYSEVALs for VARS SORT ORDER ?
> It takes a long time to order vars in my HP48GX.

  Just using sysevals for the internal functions offers no
  appreciable time saving whatsoever, in this case, because
  the built-in internal functions are simply not efficient.

  With Hack lib, VARS SORT ORD will do nicely
  (the VARS command within the library supersedes the built-in VARS,
  when you newly enter or re-compile old programs in the command line).

  For fast stand-alone VARS replacements, see

  "Lightning-fast VARS command" 1997/11/15
  <http://www.dejanews.com/getdoc.xp?AN=289754439>

  For a fast stand-alone ORDER replacement, see
  ORD on Goodies Disk #10 (Utilities), by Mika Heiskanen.

  If you want the word ORDER in User-RPL programs to re-compile
  using the faster ORD program, you might store \<< ORD \>> in a
  variable named 'ORDER' in HOME; among the many ways to create
  the latter variable name is HOME 2050 DETACH 'ORDER' 2050 ATTACH
  (execute the first DETACH before attempting to type in 'ORDER').

The following makes *two* sorted lists for the current directory;
a sorted list of the directory names, and a sorted list of all
other variable names:

\<< VARS 15 TVARS IF DUP2 SAME THEN DROP SORT { }
    ELSE SORT SWAP 1 \<< DUP VTYPE 15 == { DROP } IFT \>>
    DOLIST SORT END \>>

Follow up with ORDER ORDER (or ORD ORD) to perform the actual ordering
(or just drop any list which is either empty or not to be ordered).

The following often accomplishes the same directory ordering faster,
even though it repeats the names of directories in the argument to
the ORDER command (without affecting the final result):

\<< 15 TVARS SORT VARS SORT + ORDER \>>

-----------------------------------------------------------
With best wishes from:   John H Meyers   <jhmeyers@mum.edu>
