The following warnings occurred:
Warning [2] Undefined array key 159351 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 159354 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 159366 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 159380 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 159381 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 159381 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 159380 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





A useful HP-50G program to keep the DIRs clean...



#2

Everyone has their personal preferences for organizing their homes, rooms, offices, etc. - even the directories and files on personal computers. I am a neat freak and like things to be highly organized. The way in which the directories and objects on my HP-50G are organized makes it easy for me to locate important things.

I like every directory from HOME on down to be organized like this: alphabetically with directories first and all other objects afterwards.

I like programs to clean up after they are run by making sure that the flags are restored to their pre-run state and I want the VAR menu to always be displayed.

I'm also an automation freak. On my Linux workstations, I have a collection of useful scripts that I wrote that make working with the system very easy. Likewise so for my HP-50G, I have written a series of useful programs that keep things organized the way I like them.

Here is a program I wrote (that resides in HOME) to relist all directories and objects to my liking. I'm posting it here so others may find usefulness with it too...

<<
"Relisting the Directory..." 1. DISP
{} DUP 'xA' STO 'xB' STO
VARS OBJ-> 1. SWAP
START
DUP 1. ->LIST SWAP VTYPE
IF 15. ==
THEN xA + 'xA' STO
ELSE xB + 'xB' STO
END
NEXT
xA SORT xB SORT + ORDER
{xA xB} PURGE 2. MENU
>>
'ReList' STO

I have it in the HOME's CST list, so it can run in any subdirectory and clean up whatever is the "current" directory.

P.S. Nobody is perfect, so I welcome suggestions for improvement.

Edited: 12 Nov 2009, 2:20 p.m.


#3

I use a very similar program on my 48GX. It's actually multiple programs - one of them to do the actual sorting, and one to recursively traverse the whole directory structure.

SORTALL: This is the program that sorts all directories beneath the current directory. It works by stepping through each directory in the current directory, and then running itself from within those directories. After that, it sorts the current directory, and goes back up one level. Run it in HOME to sort everything (except the hidden directory).

<< 0 { } \-> P DIRS
<< 15 TVARS 'DIRS'
STO DIRS SIZE
IF
THEN 1 DIRS
SIZE
FOR P DIRS P
GET EVAL SORTALL
NEXT
END PATH 1 DISP
SORTDIR UPDIR
>>
>>

SORTDIR: This is the program that actually does the sorting. The main version lives in HOME, and sorts into an alphabetical list of directories, followed by programs, followed by everything else. The "everything else" isn't alphabetized, to save time.

<< 8 TVARS DUP
IF SIZE 1 >=
THEN SORT ORDER
ELSE DROP
END 15 TVARS DUP
IF SIZE 1 >=
THEN SORT ORDER
ELSE DROP
END
>>

The reason this is a separate program is because I have a different version of SORTDIR stored in some directories where I want special sorting rules. For example, I have a directory with some custom units, and a CST menu. I hide all the actual unit variables by sorting them after an object with a null name, since CST provides better functionality than VAR does for unit menus, where it's rather easy to accidentally overwrite them. Then I have another directory where I only sort a couple program names to the front, and leave everything else as-is.


#4

Thanks Dave! I have Droid48 on my T-Mobile G1 cell-phone, so I'll add your code to the emulator and see how it works out. :)

#5

Quote:
[...]

<<
"Relisting the Directory..." 1. DISP
{} DUP 'xA' STO 'xB' STO
VARS OBJ-> 1. SWAP
START
DUP 1. ->LIST SWAP VTYPE
IF 15. ==
THEN xA + 'xA' STO
ELSE xB + 'xB' STO
END
NEXT
xA SORT xB SORT + ORDER
{xA xB} PURGE 2. MENU
>>
'ReList' STO

P.S. Nobody is perfect, so I welcome suggestions for improvement.


Bill,

You can replace "xA + 'xA' STO" with "'xA' STO+"

On the non-programming side, here's a trick for sorting things when the sort order isn't alphabetic. Prefix the name with a number. For example, sometimes I need one subdirectory for each month, so I call them 01Jan 02Feb 03Mar etc.

Thanks for sharing this utility.

Dave


#6

You're welcome, Dave - and thanks for improving it! :)


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 2,577 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  HP41 display clean up Wolfgang 4 1,414 02-18-2013, 02:13 AM
Last Post: Bruce Larrabee
  Elastic Collisions Program: HP 50g Eddie W. Shore 9 2,625 03-28-2012, 07:58 AM
Last Post: bluesun08
  How a little HP-50g program mutated into an iPhone app Peter Murphy (Livermore) 6 2,052 01-12-2012, 06:06 PM
Last Post: Norman Dziedzic
  Hp 50g finance program peacecalc 0 745 01-01-2012, 10:22 AM
Last Post: peacecalc
  HP 50g trilogy. The new HP 50g Blue (and II) Pablo P (Spain) 18 4,915 09-19-2011, 03:08 AM
Last Post: BruceH
  How should I clean my hp-15c JJDietrich 3 1,207 12-08-2010, 11:05 AM
Last Post: Martin Pinckney
  How to clean a 20B ? Karl-Ludwig Butte 4 1,383 12-07-2010, 10:38 AM
Last Post: Martin Pinckney
  How to install/ru​n this program in an Hp 50g. Vasheer 2 1,074 08-17-2010, 06:34 PM
Last Post: Daniel Oliva
  How to clean the buttons on HP 48G? Denizen 2 1,149 01-15-2009, 06:12 AM
Last Post: nacho

Forum Jump: