current:
home
/ I \
sub sub sub
/ \ / \ / \
SUB sub sub sub sub sub
/ \ / \
SUB SUB sub sub
What I want:
home
/ I I \
SUB sub sub sub
/ \ /\ /\ /\
SUB SUB sub sub sub sub
I want to move the directories in CAPS. I have more directories and info
than the diagrams and really don't want to re-enter all of it. I also don't
really want the directories in to home as the diagram suggests.
Thanks ahead of time.
_ ___
________________________________ [*\ /***\_
|gsh...@magnus.acs.ohio-state.edu|........... ---************)-|
================================ ' b
>I was wondering if anyone had a program for the HP28s (I guess that a HP48
>program would also work) that would move a complete directory,
>subdirectories and contents to a diferent level (path) ie.
I have two programs, PKG and UNPKG, which can be used to effect this, if
used with my MAP (lispish for iterate over list) function.
You may have to add a recursion around them if you're too nested to iterate
by hand.
Routines to wrap a variable name & its contents as a attribute-value pair,
and to restore a variable from such pair.
PKG
<< -> s << s RCL s SWAP 2 -> LIST s PURGE >>
UNPKG
<< LIST-> DROP SWAP STO >>
MAP
<< 46 FS? -> L f f46
<< L 1
DO GETI f EVAL 3 ROLLD
UNTIL 46 FS?
END DROP
IF DUP TYPE 6 ==
THEN RCL
END SIZE ->LIST
IF f46
THEN 46 SF
ELSE 46 CF
END
>>
>>
Notes: Flag 46 is the endo-of-list-on-GETI flag.
Yes I could save flags & restore, but then I have
to know I've got 64-bit wordsize, which gives me two pieces of
state to save & restore -- might be fewer lines of code, but not
necc. simpler or smaler in net memory.
This won't work on arrays, since Arrays' SIZE is incompatible with ->LIST.
I could check the type of the L-arg and the types of the results to see
what kind of SIZE I get and whether to create a LIST or ARRAY, but I just
have an AMAP for applying functions to the cells of arrays; if I need to
operate on the rows of an array, I EDIT it and change the outer [] to {}.
To move a directory,
go into offending directory;
VARS <<PKG>> MAP;
go up one level & delete;
navigate into new directory, creating it if necessary;
with the nested list from above at first-of-stack,
<<UNPGK>> MAP.
If you automate this procedure, you could use an IFERR on the RCL of the
variable 's' to detect directories and invoke recursion.
- - - - - - -Legal B*S* - - - - - - - -
The preceding is copylefted software created by William Ricker.
Copyleft is defined by the Gnu Public License; in summary: You may use it
and hack it, but not sell it without my permission; if you hack it,
post your changes and mail a Cc: to me. This legal b*s* is required only
because some people are *selling* 48SX software. I hereby waive the
requirement of the Gnu Public License that my notice & GPL pointers be
included in copies of sourcecode on HP28 & HP48 platforms only.
To get a copy of the GPL, contact GNU or check out the GNUnews grups.
--
Bill Ricker -- formerly w...@wang.com -- now w...@world.std.com
(and sometimes WRI...@Northeastern.EDU)
"The freedom of the press belongs to those who own one."
--
Bill Ricker -- formerly w...@wang.com -- now w...@world.std.com
(and sometimes WRI...@Northeastern.EDU)
"The freedom of the press belongs to those who own one."