Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!ub!acsu.buffalo.edu From: cloos@acsu.buffalo.edu (James H. Cloos) Newsgroups: comp.sys.handhelds Subject: Re: hp48sx: variable rename? Message-ID: <68221@eerie.acsu.Buffalo.EDU> Date: 1 Apr 91 21:45:32 GMT References: Sender: news@acsu.Buffalo.EDU Organization: State University of New York @ Buffalo Lines: 49 Nntp-Posting-Host: lictor.acsu.buffalo.edu In article nelson@skid.ps.uci.edu (Matt Nelson) writes: |Is there a way to RENAME a variable (esp. a directory) on the 48sx? | |As far as I know, the only way to do this is to recall the variable to |the stack, store it under the new name, and delete the original copy of |the variable. This is fine for most objects, but renaming directories in |this fashion is extremely memory-intensive (it creates a second copy of the |entire directory on the stack) and very slow. Try to rename the root |directory of a large directory tree this way; there is a good chance that |you wont have enough memory, and if you do, it will take mucho time. | |I do not know how or where variable NAMES are stored and maintained (are |they contained within the directory object corresponding to the directory |they live in?), but it seems like it should be possible to dive into the |bowels of a couple of objects, change a few bytes, and voila, a new name. | |Am I missing something that already accomplishes this? Is it possible to |do? Does anybody else share my frustrations with this simple operation? |Do any of you ML programmers out there want to accept the challenge? | |Just venting a frustration that has been brewing since I got my 28s... I agree that this would be nice (another benefit is that you wouldn't need to reORDER the directory), but..... The format of teh directories is basically a pointer to the next entry, a name, and an object. The name is stored in size (1 byte long, counts the characters, not the nybbles), the acsii code of the name, and the size again. If the new name is the same length as the old name, fine. You can just go in and poke the new ascii code in. If this is not the case, it will require mem to be shifted around. Shouldn't be too difficult, but I'm tapped out at the moment, so someone else'll have to tackle it. (R&D perhaps [hint]?) I certainly would find such a program useful. As I would about 20 other things I'm working on at the moment [SIGH]. Check out #7059Ch for the address of the current directory. From there you can look thru mem for the entry you want to change. Change the (# of characters times 2) nybbles to the acsii values of the name you want, and voi la': the name has changed! Good luck! -JimC -- James H. Cloos, Jr. Phone: +1 716 673-1250 cloos@ACSU.Buffalo.EDU Snail: PersonalZipCode: 14048-0772, USA cloos@ub.UUCP Quote: <>