TweetFollow Us on Twitter

Oct 89 Mousehole
Volume Number:5
Issue Number:10
Column Tag:Mousehole Report

Mousehole Report

By Rusty Hodge & Larry Nedry, Mousehole BBS

From: Willcox

Re: Deleting a Folder

I am having trouble deleting a folder using the Low Level File Manager routines. I have created a folder and put some temporary files in it. At the end of my program, I would like to delete this directory. I am trying to use PBHDelete. I first delete all the files in this folder. Then, I try to close the working directory with PBCloseWD since I opened it with PBOpenWD. Then I call PBHDelete. I get error -47, fBsyErr, File is busy. I have tried various parameters in PBHDelete (WDid, vRefnum, name of folder), but I still get -47. Also, when I do this with MultiFinder turned off, I can not delete the folder from the Finder, it too says the folder is busy. Help.

From: Adept

Re: Deleting a Folder

When doing any PBOpen calls, you have to be sure to set your ioWDProcID to ‘ERIK’, the magic ‘longint’, otherwise it will be undeletable by the finder (until reboot), You might be calling PBClose with something != PBOpen and != to ‘ERIK’..

From: Mikec

Re: Setting current folder

Bryce, I am excited to see your message #878 that creates new folders. I have been wanting to do this for an application for a long time. But I am just starting to program and have little idea how to fit your listed code into a procedure that will create the folder. Can you help me by listing a more complete procedure or uploading a text file? I use LSP and would be delighted to hear from you.

From: Tony

Re: Setting current folder

Mike, Below is the list of a function call CreateFolder. I believe this will do what you want. It takes as parameter the name of the folder and the volume reference of where to put the folder. In return, it will pass back and errorcode and the FolderID. The folderId is in fact the Directory Id and can be used a vRefNum (volume reference no) in any of your File I/O calls.

Function CreateFolder(FolderName:str255; vRefNum : integer;
varFolderId:longint):OSErr;
Var
 Blk:HParamBlockRec;
 errorcode :OSErr;
begin
   with blk do
    begin
     ioCompletion := nil;
     ioNamePtr := @FolderName;
     ioVrefNum := vRefNum;
     ioDirId := 0;
   end;
  errorcode := PBDirCreate(@blk,false);
 FolderID := blk.ioDirId;
 CreateFolder := errorcode;
end;

Hope this helps.

From: Shaper

Re: List Manager problem...

Does anyone have any source code for the List Manager routines? I got the source to the LDEF’s in the Think Pascal library on CompuServe and tried to use that source but it’s kind of strange because he used custom LDEFs with variable column numbers. I want to use the LDEF that comes in the system file to make a list of people’s names, and I can get the list to appear but the only way to scroll it is to click on someone’s name and then drag downward to scroll down - the arrow buttons don’t work for some reason. Also, it doesn’t always hilite the cell that you click on, so you have to keep clicking on different parts of the list cntl until one does hilite before you can scroll up or down...

From: Jumpcut

Re: List Manager problem...

If you don’t specify a LDEF, the List Manager will use the standard system LDEF. You can then set the list’s selFlags to make sure things get selected properly. CHeck around page 270 of IMIV. I was having similar problems after I changed the font and style of the window the list was in. First thing to check - make sure your window is a noGrowDocProc, or else the grow box (whether you draw one or not) will keep mouseDown events from scrolling the list down. I’m sure you’re using LClick, so I won’t bother to mention that. My only other suggestion is to avoid the obviously stupid (unlike me) and remember to change the font & face before creating the list.

From: Inbox

Re: Endless lists

I’m doing a numerical analysis of a chaos/pattern generation problem, but I’ve been temporarily delayed by the need of array-like structures with their original size unknown. Beginner C skills decrease my programming self-confidence, so I would like to hear you comments on the topic of lists... I did the following:

  typedef struct mystruct{
            int myint;
            mystructptr nextstruct;
            } *mystructptr;

But, I cannot do that because *mystructptr isn’t yet recognized by the compiler. Should I make nextstruct a ptr and then coerce it when creating a new structure? If not, what are your suggestions?

Thanks for listening, _inBox_

P.S. Is there any C trick for making self-referencing things like this one

(I mean a language directive of some kind...)

From: Siegel

Re: Endless lists

For a self-referential structure (say, a linked list): .

typedef struct element {
  int field1;
  long field2;
  struct element *next;
} element, *elementPtr;

Since this is the Mac, why not use a handle-based structure to support an array of dynamic size? As in:

typedef int *PInt, **HInt;
.
{
 Hint myIntHandle = NewHandle(0);
.
 /* sorry for the caps slipup above */
 SetHandleSize(myIntHandle, (long)nIntegers * sizeof(int));
 (*myIntHandle)[nIntegers - 1] = someValue; /* assign the last element 
*/
}

From: Inbox

Re: Endless lists

Thanks a lot. And just when I thought that I was out of the woods....

AAARGGGHHHH !!!!! The Mac’s random number generator turns out to be unusable by any self-respecting chaosologist for any purpose. I used statistical analysis to determine its bias, and then compared it to tables of acceptable fluctuations. And guess what, it SUCKS!!! (pardon the language)... So I set out to write a random number generator. Done. And, here comes the big one: how can I raise small integers to humongous powers??!! For example, 5^10000 will definitely cause an overflow for C’s “pow” function. The max number that can be stored in a 64 bit variable is 1.84467E19. But, 5^10000 or something similar just blew me out of the water.

Any suggestions are very very welcome. (and needed....).........

From: Apage

Re: Endless lists

If you’re using a Mac II the 881 uses the extended precision format to 80 bits. If you have a mac with an 882 (which can be dropped in with no trouble and few tools), the precision goes out to 96 bits.

From: Inbox

Re: Endless lists

Ah, but are you talking about the mantissa or the whole number? For example, my HP 28S (calculator) has a 12-digit mantissa and allows powers up to 500. With the 96 bit format the max is 28. Maybe the calculator scheme holds for the Mac?! Then only the mantissa is limited by the bits of a format. Take Matematica, for example... It can do number crunching with infinite precision and allows mega-powers. I guess it uses its own package but....

From: Tron

Re: Receiving events from a DA

Does anyone know how to receive events from a DA that is written in LSC? In IM #1, page 446, it says that the control routine receives in the csParam field a pointer to an event record. Hence:

     case 2:   /*  control  */
        switch (p->csCode) {
           case accEvent
               DoEvent((EventRecord *)p->csParam);
               break;
        }

I figured that this would work, yet I cannot handle any events in my DoEvent routine. Anyone ever dealt with DA’s from LSC before?

From: Macguru

Re: Receiving events from a DA

Have you set up your DA’s Event mask to tell it what events you are expecting to receive? This is done in the header.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »

Price Scanner via MacPrices.net

Apple AirPods Pro with USB-C return to all-ti...
Amazon has Apple’s AirPods Pro with USB-C in stock and on sale for $179.99 including free shipping. Their price is $70 (28%) off MSRP, and it’s currently the lowest price available for new AirPods... Read more
Apple Magic Keyboards for iPads are on sale f...
Amazon has Apple Magic Keyboards for iPads on sale today for up to $70 off MSRP, shipping included: – Magic Keyboard for 10th-generation Apple iPad: $199, save $50 – Magic Keyboard for 11″ iPad Pro/... Read more
Apple’s 13-inch M2 MacBook Airs return to rec...
Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices currently... Read more
Best Buy is clearing out iPad Airs for up to...
In advance of next week’s probably release of new and updated iPad Airs, Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices for up to $200 off Apple’s MSRP, starting at $399. Sale prices... Read more
Every version of Apple Pencil is on sale toda...
Best Buy has all Apple Pencils on sale today for $79, ranging up to 39% off MSRP for some models. Sale prices for online orders only, in-store prices may vary. Order online and choose free shipping... Read more
Sunday Sale: Apple Studio Display with Standa...
Amazon has the standard-glass Apple Studio Display on sale for $300 off MSRP for a limited time. Shipping is free: – Studio Display (Standard glass): $1299.97 $300 off MSRP For the latest prices and... Read more
Apple is offering significant discounts on 16...
Apple has a full line of 16″ M3 Pro and M3 Max MacBook Pros available, Certified Refurbished, starting at $2119 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free... Read more
Apple HomePods on sale for $30-$50 off MSRP t...
Best Buy is offering a $30-$50 discount on Apple HomePods this weekend on their online store. The HomePod mini is on sale for $69.99, $30 off MSRP, while Best Buy has the full-size HomePod on sale... Read more
Limited-time sale: 13-inch M3 MacBook Airs fo...
Amazon has the base 13″ M3 MacBook Air (8GB/256GB) in stock and on sale for a limited time for $989 shipped. That’s $110 off MSRP, and it’s the lowest price we’ve seen so far for an M3-powered... Read more
13-inch M2 MacBook Airs in stock today at App...
Apple has 13″ M2 MacBook Airs available for only $849 today in their Certified Refurbished store. These are the cheapest M2-powered MacBooks for sale at Apple. Apple’s one-year warranty is included,... Read more

Jobs Board

Licensed Practical Nurse - Womens Imaging *A...
Licensed Practical Nurse - Womens Imaging Apple Hill - PRN Location: York Hospital, York, PA Schedule: PRN/Per Diem Sign-On Bonus Eligible Remote/Hybrid Regular Read more
DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
Operating Room Assistant - *Apple* Hill Sur...
Operating Room Assistant - Apple Hill Surgical Center - Day Location: WellSpan Health, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Read more
Solutions Engineer - *Apple* - SHI (United...
**Job Summary** An Apple Solution Engineer's primary role is tosupport SHI customers in their efforts to select, deploy, and manage Apple operating systems and Read more
DMR Technician - *Apple* /iOS Systems - Haml...
…relevant point-of-need technology self-help aids are available as appropriate. ** Apple Systems Administration** **:** Develops solutions for supporting, deploying, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.