hp 50g sort order in Filer - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: hp 50g sort order in Filer (/thread-103110.html) |
hp 50g sort order in Filer - Rich Messeder (US) - 11-26-2006 I was sure that I had seen the Filer sort my dir entries in dir-name-sorted followed by filename-sorted when I pressed the Order key. But now I cannot get this to work. Is there a method for doing this?
What I am looking for: I have the regular soft key options available, but not a 1-button sort as above.
Rich
Re: hp 50g sort order in Filer - Gerson W. Barbosa - 11-26-2006 I don't know if the filer has an option for this kind of sorting. Meanwhile try this:
<< VARS SORT ORDER 15 TVARS ORDER
Gerson.
Re: hp 50g sort order in Filer - James M. Prange (Michigan) - 11-26-2006 After you've chosen a port or directory from the "tree" view, press NXT twice to get SORT as the last menu item on that page; TYPE is the closest to what you want. I think that even then, within each type, objects are sorted according to their "storage order" rather than alphabetically.
You can use some "keyboard shortcuts" within the filer too. Instead of choosing the sort option from a choosebox you can press:
Regards,
Edited: 26 Nov 2006, 4:01 p.m.
Re: hp 50g sort order in Filer - Rich Messeder (US) - 11-26-2006 Thanks for the code. I tried it, and it works fine for me. If there are no dirs in the list, then it errors, but that's OK because it has already sorted the files. This code appears to work (I'm new to programming this class of calculator) because all the entries, irrespective of type, are sorted in the first pass; then the second specifies only dir-type entries and those are ORDERed, bubbling the non-dir-types to the bottom of the list, but still sorted. My references do not show a type 15 for dir types. I tried Filer6, and I can see that it is more powerful than the builtin Files command, but is will not do what I want. I am likely to use it to manage my SD card, however, as it appears to do what the builtin program will not do.
Thanks to both for your help. Re: hp 50g sort order in Filer - James M. Prange (Michigan) - 11-26-2006 Ah, I was thinking that you wanted the display of objects sorted in the filer. Note that if you want to make it permanent, the filer also has the ORDER operation.
But for permanent sorting, Gerson's program seems better. If you care to avoid the possible error, then change it to: %%HP: T(3);
Regards, Edited: 26 Nov 2006, 8:40 p.m.
Re: hp 50g sort order in Filer - Gerson W. Barbosa - 11-26-2006 Hello James, Thanks for the improvement! I will use it from now on. I had noticed the error Rich mentioned but then I didn't care about it because I use this mostly to keep my HOME directory sorted that way, and there's always other directories therein. I once wrote a program that avoided the double sorting, but I can't find it anymore. I remember it was much longer. Anyway, the 50G is so fast this is not a problem. Regards,
Gerson.
Re: hp 50g sort order in Filer - Rich Messeder (US) - 11-26-2006 Quote: I could have lived with the display, I suppose. Although I can see an additional benefit to having the directory sorted so that the VAR key gives me predictable results. But in any event, I couldn't get any keystroke combination in either the builtin or Filer6 to give me the results I wanted. Thanks to your input, though, I tried this...
%%HP: T(3)A(R)F(.); ...and it seems to work just fine.
Rich
Re: hp 50g sort order in Filer - James M. Prange (Michigan) - 11-27-2006 Yes, that should work; just two different approaches to dealing with the possibility of an empty list. Assuming that last arguments saves are enabled, LASTARG may give different results.
Regards, Sorted directories - James M. Prange (Michigan) - 11-27-2006 Hello Gerson, You're welcome, of course.
A possible disadvantage is that often I don't really want a
Note that the 28 series and 48SX/S don't have a built-in SORT
Also note that these programs can take a long time to execute.
To avoid an error if used on an empty directory, we could use: %%HP: T(3);But one wouldn't be likely to want to use such a program on an empty directory anyway, so why bother? Well, I did so as a step in developing a recursive sorted order program that will work on the current directory and any subdirectories (which may happen to be empty): %%HP: T(3);Or one could use a subprogram stored in a local variable which calls itself recursively. In this case, the program can be stored with any global name without changing the name within the program. Note that a "compiled local name" is used because I use the name in the subprogram before the local variable actually exists. %%HP: T(3);
Other, perhaps better, programs could be made, for example perhaps
Oh, by the way, for the Classic RPN aficionados who feel that
Regards, Re: hp 50g sort order in Filer - James M. Prange (Michigan) - 11-27-2006 PS: Within the Filer, pressing unshifted N does EVAL, which is on the same key, which is the reason for requiring the RightShift N for sorting by name.
Regards, Re: Sorted directories - Antonio Maschio (Italy) - 11-27-2006 Why don't you put this as an article?
-- Antonio
|