TweetFollow Us on Twitter

Jul 88 Mousehole
Volume Number:4
Issue Number:7
Column Tag:Mousehole Report

Mousehole Report

By Rusty Hodge , Mousehole BBS

MouseHole Goes Multi-User!

Rusty Hodge, Sys Op

In an effort to provide a more complete communications forum for Macintosh programmers and developers, MouseHole has dramatically increased our capacity.

• Five Incoming Lines

• Access to USENET

• Real-Time conversation area

• Email gateways to Arpa, Usenet, UUCP and Internet

• Special Vendor Support Areas

MouseHole is free to MacTutor subscribers. (There is a seperate download system that charges $10 annually.) To join, use your modem to call (714) 921-2252 (1200/2400 baud). If you connect at 1200 baud you may need to hit <return> to have the system adjust to yur baud rate. At this point you will get a message like this:

Type ‘hole’ to login to MouseHole.


Type hole. You will then get the MouseHole BBS login:

BBS login:

Now type ‘none’.

You will then be provided with everything you need to know to set up an account online. You may want to think about a username- 10 characters or less, with the letters a-z, period or dash.

You can get help at any prompt by typing ‘?’. Backspace is defined as ^H.

How To Reach MouseHole users via Electronic Mail

If you are connected to any of the Usenet, UUCP, Internet or Arpanet networks, you can send mail to MouseHole users at the following address:

UUCP: ucsd!crash!pnet06!{user}

Internet: {user}

ARPA: crash!pnet06!{user}

Finally, Orange County is now a PC Pursuit area (at 1200 baud only). This should make calling MouseHole much more affordable for those who are a long distance call to us. PC Pursuit is a discount modem dialing system that gives you unlimited after-hours calling to selected cities over GTE Telenet’s packet switched network. Currently, it is about $25 a month for service. Contact Telenet at (703) 689-6000 for more details.

If you have any questions, you can reach me at:

UUCP: {anywhere}!ucsd!crash!hodge!rusty


Macnet: rusty (I don’t check in here too often)


The Lounge area is a multi-user chat feature. We plan on scheduling some meetings for special interest groups. The times are as follows:

Mondays, 9PM (Pacific) Pascal Programmers Group

Tuesdays, 9PM C Programmers Group

Wednesdays, 9PM Basic Programmers

Thursdays, 8PM Pest Control - Bug Finders Nite

All 4 modem ports are active. We are using new modems on the first two lines and don’t seem to have problems with them resetting to 1200 baud.

From: rusty

Subject: Multi-User MouseHole

So, since everyone has been mailing me and asking mostly the same questions, I will answer a few of them here. This system runs P-net (People Net), and operates on an AT&T 3B1 Unix PC. The system has 7 serial ports, an internal 1200 modem, console, 2mb RAM and a 70mb hard disk. The processor is a 68010. Currently we are using 4 modem ports, of the remaining 3 ports one is hooked to a diagnostics terminal, one is switched between my Mac SE and the other Unix PC (Mini 1mb/20mb model), and the final port is being interfaced to the Amateur Radio Packet Network (like a modem over Ham Radio). Some of the features that this thing has are:

- Real time chatting

- heirachial structure to message area

- links to Usenet/UUCP

- Context-sensitive help anywhere by pressing ‘?’

The new number (921-1090) will eventually be in rotary with 2252 after we get all the 2400 baud modems working properly. Besides ‘hole’ you can type ‘pnet’ or ‘bbs’. There are some other logins for specific company Unix accounts. Sorry for being 2 days early.

From: thecloud

Subject: Board numbers

A related question, which I’ve asked before: what became of the BBS that was running at (921-2255)? Also, I haven’t yet figured out how to get all the unread messages continuously (without typing a carriage return after each). Is there a way to do this? Just some typical “changeover complaints,” I suppose...I wonder how long this one will last...)

From: rusty

Subject: Re: Board numbers

Typing # turns bulk-read mode on. I promise this software will last for many years to come. The 921-2255 number is now in rotary and operative at 1200 baud again.

From: thecloud

Subject: auto read

OK, next question: is there a way to cancel bulk-read mode, once started? With hundreds of unread messages to go, I suddenly realized I “couldn’t stop,” and had to hang up. Don’t recall seeing it in the downloadable documentation... -k

From: rusty

Subject: Re: Stopping

You can use the interrupt key. Set it in the M/odify account parameters. When you interrupt, you will see two stars (**) and what you are doing will be aborted.

You can download the Pnet documentation by going to the V/arious menu and A/ttaching to my (rusty) directory. Then download the file pdoc.all using the protocol of your choice.

From: the_cloud (Ken McLeod)

Subject: TearOffPalettes Error

The TearOffPalettes source, as published in the April 1988 issue of MacTutor, contains an error which doesn’t exist in the fully functional “Source Code Disk #31” version. Of course, there weren’t any errors introduced into the PaletteWDEF.c file, since it wasn’t even printed. In the TearOffMDEF.c file (the menu definition), the function ChooseItem() includes the following line:

if(!(tearOffMGlobals)->itemHilited)  {         
 hiliteItem = (tearOffMGlobals)->currentItem;  /* wrong! */    (tearOffMGlobals)->itemHilited 
= true;       }   

This is NOT correct, and should instead be:

 if(!(tearOffMGlobals)->itemHilited)  {          
 saveItem = (tearOffMGlobals)->currentItem;  /* right! */      (tearOffMGlobals)->itemHilited 
= true;       } 

as it is in the Source Code Disk version, else the hiliting gets screwed up real good.

From: lsr (Larry Rosenstein)

Subject: MF Background Bug

I just got the May MacTutor and on page 12 is a question about a possible MultiFinder bug. This bug is described in Tech Note #177. The letter had the bug almost right. It doesn’t depend on the application having no windows. The bug shows up if:

(1) an application has the background bit set and calls WaitNextEvent with a sleep value > 50 and

(2) the application becomes the frontmost application because another application quits.

The maximum sleep value is dependent on the machine; larger values could be used on a Mac Plus and Mac SE. Also, condition 2 can be satisfied by running and then closing a DA. The bug is fixed in the upcoming 6.0 system. You can tell if the fix is in place by using the SysEnvirons call and checking the system version. (The Tech Note gives the wrong number for the check; the version should be greater than $0430.) My TimeKeeper program does this check and when running under System 6.0 will sleep for up to 1 minute under MF. (BTW, it also utilizes the Sound Manager on the Plus/SE under 6.0.)

From: wayne (Wayne Correia)

Subject: Apple raises SIMM prices!

>From AppleLink: April 29, 1988

Memory Expansion Kit Price Increases

Due to the worldwide shortage of DRAM memory, Apple has incurred significant price increases from our suppliers industry-wide. Effective May 1, 1988, Apple will increase the retail prices of the Apple 1 MB Memory

Expansion Kit (256K) and Apple 2 MB Memory Expansion Kit (1MBit). The new prices will appear on the May 15th Apple Confidential Price List. The following prices reflect our new cost structure:

Product: New Old

Apple 1 MB Exp. Kit (M0218) $349.00 $249.00

Apple 2 MB Exp. Kit (M0219) $849.00 $599.00

Effective May 8, 1988, Apple will increase the retail prices of the LaserWriter II NTX 1MB Memory Expansion Kit and LaserWriter II NTX 4MB Memory Expansion Kit. Although these new prices will not appear on the Apple Confidential Price List until June, the pricing will be reflected in the price list addendum that will be posted under the Apple Programs icon on AppleLink on May 15th. The following prices reflect our new cost structure:

Product: New Old

LW II NTX 1MB Exp. Kit (M6005) $349 $249

LW II NTX 4MB Exp. Kit (M6006) $1699 $1199

Apple will honor the pricing on all orders you have already placed. This price increase is NOT retroactive, and will only affect orders placed on or after May 1, 1988 on the Apple 1 MB Memory Expansion Kit and Apple 2 MB Memory Expansion Kit and orders placed on or after May 8, 1988 for the LaserWriter II NTX 1MB Memory Expansion Kit and LaserWriter II NTX 4MB Memory Expansion Kit. Although Apple will make every effort to purchase DRAM to meet your needs, we expect the shortage to continue throughout the calendar year. We are exploring every avenue to increase RAM availability. [We are starting to track how old memory backlog is. My order dates to Feb. 88. If you have memory on backorder from Apple, please let us know how long you are still waiting for your developer order to be filled. -Ed]

From: davidw (David Whiteman)

Subject: Technote/Claris Question

Does anyone know whether the old Apple Technotes describing the file formats of MacWrite, MacPaint and MacDraw documents are accurate for the recent versions of the applications released by Claris?

From: rick (Rick Boarman)

Subject: Re: Technote/Claris Question

As far as I know the MacWrite 5.0 file format is the same as 4.6. MacDraw II has a completely different structure than v1.9. You can still save a drawing as a standard PICT though.

From: davidw (David Whiteman)

Subject: Re: Technote/Claris Question

Greetings, Claris finally returned my phone call: Basically with MacPaint and MacDraw, the two new versions have an entirely different document format, but if you create a document following the guidelines as described in the Apple technotes the new programs can still read it. With MacWrite 5.0 there are some subtle changes in the document format. Claris will not make the specifications for the newer versions public, nor post them, but if you write, and have a good reason for asking for them and sign an NDA, they will furnish it. [So much for document format standards! Neither the new MacWrite or Word 3.01 formats are now easily accessable to developers. -Ed]

From: mikesteiner (Mike Steiner)

Subject: Word Perfect and FullWrite

A friend received the release versions of both of these programs within the past week. Some observations: The Word Perfect manual stinks; it is written like an MS DOS manual (considering its antecedents, that is not too surprising), but the program is very Mac-like and friendly. Fullwrite is a memory hog! On a 1 meg Mac, it can’t open a new document if TOPS is running; and even without TOPS, there isn’t enough memory to do all the functions (especially graphics). This program really requires at least 2 megs to run. Also, an 8 page MS Word document (no graphics) that Word Perfect converted in 3 seconds took 13 minutes for FullWrite to convert!

From: johnh (John Hubbard)

Subject: TIFF

Who created TIFF (Tagged Image File Format) ? What exactly is it ? How can I obtain DETAILED technical information on TIFF ?

From: rick (Rick Boarman, Claris Corp.)

Subject: Re: TIFF

TIFF was created by Aldus Corp. It’s currently being revised into version 5. Their number is 206-628-6593.

From: adail (Alan Dail, Hampton, VA)

Subject: LaserJet

Does anyone know of a printer driver that will allow the Mac to print to an HP LasetJet series printer?

From: rusty

Subject: Re: LaserJet

SoftStyle has drivers for the LaserJet. I seem to recall that they are in Hawaii, if that helps. They used to advertise a lot, too.

From: rdclark (Richard Clark, Tustin, CA)

Subject: SoftStyle

Their LaserJet driver creates 72 dot/inch graphics (Imagewriter quality) at Imagewriter speeds, as I remember. (This was 1.5 years ago -- the product may have improved since then, but I doubt it.)

From: bhall (Brian Hall, Houston, TX)

Subject: Re: SoftStyle

In general, I’ve had bad luck with SoftStyle. If you absolutely have to connect something that can’t be connected any other way, then use them. Otherwise, use the other option. (Hey, Rusty, when will 2400 be working reliably? I get a lot more line noise at 1200....)

From: rusty

Subject: Re: Baud Rate

It is working 95% of the time now. The first 2 lines have the Mitsuba modems which work correctly. The second 2 have the PP modems which are now working properly half of the time. Soooo, if you call the 2252 number and are one of the first two callers on, it works all the time. I should have new modems early next week for the remaining lines.

From: ericj (Eric C. Johansen)

Subject: Laserjet

The current drivers from Softstyle for the Laserjet, are really pathetic. They’re not TOPS compatible, require lots of RAM just to operate, and employ a RAM-based spooler, (which is optional of course). The graphic resolution is reduced to 72 DPI, and the fonts used are strictly proprietary, you can’t even use the native Times and Helvetica fonts, but must use the ones supplied by Softstyle. Look into the Grappler LQ that will someday come from Orange Micro. From what I’ve been told, the driver at one time emulated the Imagewriter LQ, i.e. 240 dpi, but now it’s supposed to be something better. We’ll see.

From: bruceh (Bruce Henderson)

Subject: Developers Needed

My Company is Gibbs and Associates, we are the leading system on the Macintosh for CAM [ computer aided machining/manufacturing]. We are currently seekeing developers to add to our programming staff. If you are well versed in MPW Pascal and working on LARGE projects, give me a call at (818) 700 8854.

From: davidw (David Whiteman)

Subject: Mac II ADB problems

Some time ago I posted asking for information about problems with the ADB port on the Mac II.

After talking to some hardware experts I discovered the following: Apparently if you disconnnect anything from the ADB port while the Mac is powered on you may briefly short some pins. This causes a fuse to blow on the Mac II motherboard. Which would eventually mean that you would have to buy a new motherboard as the fuse is soldered in. The whole point is that if you are going to connect or disconnect the mouse or the keyboard power off the Mac first.

From: rdclark (Richard Clark)

Subject: Re: Mac II ADB problems

There’s another reason to power down before changing ADB devices. Each ADB device has a microprocessor in it, and this mpu receives a “reset” command from the Mac at powerup. If you connect another ADB device in after the machine has been powered up (or disconnect and reconnect an existing device), the new device will not be reset properly.

From: polaris (Jamal Hannan)

Subject: attention

Hey rusty... how do we alert any of the people that are on that we would like to chat with them at the lounge?

From: rusty

Subject: Re: attention

Actually, there isn’t an easy way to alert people to go to the lounge. However, Mail is checked at most prompts, so if you send a letter to someone online, they usually are notified within a minute. Sleazy, but it works.

From: davidk (Dave Kosiur, Fullerton, CA)

Subject: Hard Disk

I need to get a 20 Meg hard disk for my wife’s Mac Plus. Does anyone have any recommendations? Send me E-mail.

From: greg (Greg Kearney, Casper, WY)

Subject: HD 2

I am hunting for an old HD20 serial for the National Federation of the Blind of Wyoming office they were given a Mac 515e and have no money to upgrade so we’re looking for someone who is feeling charaable or needs a tax deduction. I have done some software for them including a talking finder and such but they do need this hard Disk. Leave me EMail.

From: peterg (Peter Giotta, Hb, CA)

Subject: Hard Drive for Mac+

Have had a DataFrame (XP20) hooked to my Plus for slightly over a year with no problem whatsoever. They do cost more though than your average hard drive however. [The new DataFrame XP150 has been getting very good marks in the trade press. We’re looking seriously at getting one of these babies for MacTutor. -Ed]

From: greg (Greg Kearney, Casper, WY)

Subject: ProFiles and Macintosh

Anyone know if you can run a old profile off a macintosh for a hard drive? I have the chance to get one for next to nothing and want to know if there is any use for it. Thanks

From: rusty

Subject: Re: ProFiles and Macintosh

You can use ProFiles on Lisas/Mac XLs, but not regular Macs. ProFiles are only really useful to people running Apple //’s under the UCSD P-system...

From: arlen (Arlen P Walker, Milwaukee, WI)

Subject: Generic Postscript Printer

I’m trying to talk my boss into planting a Mac II on my desk. Unfortunately it needs to be able to talk to the DEC LN03R that we currently have (something about not having budgeted for a second laser). I’ve tried the serial laserwriter driver we got from our local dealer, but it comes with some sort of a script file and no documemtation for the script. It still seems to want to talk with the printer by Apple’s own protocol, and the DEC wants nothing to do with it. Does anybody out there have any ideas?? I can write my own driver if I have to, but I’m a recent emigre to Macdom so I’d still appreciate some hints.

From: phopeful

Subject: Re: General Comp. PLP

I have the PLP. Though I may have no info about it that would be helpful to you, feel free to ask.

From: davestol (Dave Stoler, Anaheim, CA)

Subject: Source for DEC Printer Driver

GDT Softworks has several printer drivers designed for the Mac. They had one for my C. Itoh F10 Printer that could handle all of the usual tricks -- Bold, Underline, etc... You can write them at: GDT Softworks 2800 Douglas Road, Suite D Burnaby, B.C. Canada V5C5B7 Good luck!

From: wbigelow (Wendell Bigelow)

Subject: Missing Application Icon

I’ve created an application and added my own Application icon and icon for the files it will create. I do not see the fancy icon in the Finder when I view by icon, just the default application icon. I’ve read several places about removing the “Deskktop” file and otherwise forcing FINDER to rebuild the desktop and go out amongst ye Applications and re-build the BNDL resources. This worked for a previous version of the application (and the files it had created) that uses the same icon image but has a different resource type (4 character doo-dah). I’ve deleted that particular BNDL resource and even managed to set the “bundle” bit in the GET INFO dialog in ResEdit for my application and forced desktop no avail... [The best solution is to use a series of similar creator tags and to change the creator tag with each new icon you wish to use with a version of the program. Then when the bundle bit is set, the Finder will install the new icon with the new creator tag. However, if the tag has been previously used, you have to make the Desktop file “forget” the old icon associated with that creator tag. This is very difficult. It is much easier to teach the Desktop about a new creator tag and icon than to make it forget the icon associated with the old tag. -Ed]

From: the_cloud (Ken McLeod)

Subject: Finder BNDL checklist

Did you: Make sure your application ICN# (and any ICN#s for documents created by your application) have corresponding FREF’s?

Make sure there’s a corresponding resource with ID=0 for whatever your application’s creator type is? Make sure the BNDL’s owner is the same as this creator type? Rebuild the desktop by holding down the Option and Command keys when quitting to the Finder? [Be careful of this step; sometimes things get messed up, especially if you have a very full hard disk. -Ed]

From: davidf (David Fandel)

Subject: List Manager/MacApp problem

Are there any MacApp experts out there? I am working on a list manager object that is a descendent of DialogItem. I have gotten the modal dialog box routines to work correctly. (ie. the scrollbars work, items are selected, etc.) But when I call the same routines from a modeless dialog routine the scrollbars do not show up initially. If the list is selected the paging regions and the thumb appear and move, but they can’t be selected. The up and down arrows never show up. And if another window hides them they are not updated when the other window is moved. My call to this routine is based on a slightly modified DemoDialogs modeless dialog call. My code is as follows:

aDialogView.ILMDialogView(    );  
 {override - calls IDialogView}   
aWindow := aDialogView.MakeOwnWindow(FALSE);  
 {creates window}   
IF aWindow <> NIL then     
 aWindow.fFreeOnClosing := TRUE;       
 aWindow.fOpenInitiallly := FALSE;       
 SimpleStagger(   );       
 aListView := aDialogView.DefineSimpleList(4, 18,TRUE,FALSE,theString); 

{this is the call that places the List listed in theString into item 
number 4 of the Dialog Box in an 18 pixel high cell.  The TRUE means 
a rectangle is drawn around the list and the FALSE means the list is 
NOT alphabetized};     

The DefineSimpleList procedure runs new and FailNil on TSimpleList (a DialogItem descendent) and then calls the ISimpleList initialization routine which basically makes the list and attaches it to the DialogPtr after coercing it to a WindowPtr. Any clues on why the scrollbars go out to lunch when it is modeless? Have I forgotten an important call?

From: dcamp (David Camp, El Paso, TX)

Subject: cdev’s

Hi! Can somebody show me the link command required to link the sample cdev in inside Mac V? Or the link command for the ApplFont cdev in MacTutor V3#10? This is for MPW Pascal by the way... I can’t seem to nail it down and several people on GEnie can’t either. [All you need is a code resource. Do you need a special link command to get the MPW linker to create code resources? -Ed]

From: billgabrenya (Bill Gabrenya)

Subject: Generating random numbers

I am having some trouble generating random numbers using the Random function. Calling the function 10,000 times in which I re-seed Randseed every 10 calls with Tickcount will sometimes produce an even distribution within the range of numbers I need, and sometimes it will produce a very skewed distribution.

From: thought.police (William Evans)

Subject: Random Numbers

Bill, the normal (no pun intended) way of using a random number generator is to seed it _once_ (typically from the clock) and then let it run without reseeding it. I haven’t used random numbers on the Mac yet, but I would suppose this technique would work. Seeding the generator from the clock every ten calls could conceivably foul things up: especially if you call the generator very frequently, and probably even if you don’t. Is there any reason you’re doing multiple seedings? If so, let’s hear ‘em. If not, why not try seeding just once and letting us know if that fixes the problem?

From: the_cloud (Ken McLeod)

Subject: StartSound problem

I recently used HeapShow to check out a program I’m writing, and discovered to my chagrin that a handle wasn’t getting unlocked, causing heap fragmentation. I tracked the problem down to this bit of code, which involves calling StartSound asynchronously:

TheSound^^.FFSound.count := fixratio(1, TheSound^^.rate);  
WITH TheSound^^ DO  
 StartSound(@FFSound, WaveLen, pointer(Syn));  

When (Syn) is -1, the sound is produced synchronously; however, when (Syn) is 0 and the sound is being produced asynchronously, the handle never gets unlocked. In fact, my calls to HLock and HUnlock the handle appear to have no effect... I removed them, and the handle was STILL locked on exit from the routine. Does anyone know if there’s something I’m doing wrong here, or if there’s a problem with StartSound? I seem to recall some thread about StartSound here before... I should mention that my handle to the sound is declared as a global variable... is that a factor?

From: lsr (Larry Rosenstein)

Subject: Re: StartSound problem

There is a general problem with your code as written, which could manifest itself as a locked handle (but I don’t know for sure). The problem is that StartSound expects a pointer to the sound data. Locking the handle is the right thing to do, except that it has to be locked for the duration of the sound. If you call StartSOund synchronously, then there is no problem. If you call it asynchronously, then you can’t unlock the handle until the sound finishes. The correct thing to do is to use a completion routine to detect when the sound is finished, set a flag, and unlock the handle when your program sees the flag set. You can’t unlock the handle in the completion routine, because it runs at interrupt level, and could have interrupted the Memory Manager. (If you use a global flag, you also have to be careful to setup A5 correctly, and watch out for MultiFinder.) I don’t know if this could cause the handle to stay locked, but it could certainly cause problems playing out the sound if you unlock the handle while the sound is playing.

From: the_cloud (Ken McLeod)

Subject: More StartSound...

Well, I tried setting a flag after I called StartSound asynchronously (passing nil for a completion routine), and putting a few lines of code in my main event loop to unlock the handle if SoundDone was true and the flag was set. It should have worked...but didn’t. Then I got an inspiration, and thought of StopSound; so... this works:

if (unlockMeFlag and SoundDone)  then
 unlockMeFlag := FALSE;

But without the StopSound call, the handle remains locked! If we get past SoundDone there should be no need to call StopSound; this is truly bizarre. StopSound “executes the sound’s completion routine” as well as cancelling any pending calls (there aren’t any), so perhaps it won’t allow the handle to be unlocked if a sound is played asynch until some sort of completion routine is called? I dunno... anyway, StopSound did the trick.

From: jimr (Jim Reekes)

Subject: Re: More StartSound...

The glue code in MPW for StopSound unlocks the handle created by StartSound. StopSound glue checks for the handle and will unlock it for you. The meaning behind all of this is to call StopSound before ExitToShell. )]> reekes <[(

From: tony (Tony Fashoro, San Jose, CA)

Subject: Calling Code Resources

Help, I want to write a standalone code resource using LS Pascal. I need to know how to call the code resource form within an application. I beleive I have to use the resource manager to load and lock the resource and then do something to the handle returned by the resource manager. What is that something ?

From: think (Richard Siegel, Bedford, MA)

Subject: Re: Calling Code Resources

Calling the code resource is pretty straightforward:

procedure CallCode(arg1, arg2,...,argN, codeH);
INLINE $205F, $2050, $4E90;   

The first N arguments are the arguments that your code resource’s MAIN routine expects, and “codeH” is a handle to your code resource.

NOTE: Before calling the above procedure, you should either lock the code resource (you can set its locked bit in the resource attributes, if you want) or make provision for it to lock itself. If the code resource moves while it’s executing, you’re dead... --Rich Siegel, THINK Technologies

From: adail (Alan Dail)

Subject: MPW

Does anyone know when the new versions of MPW and MacAPP are supposed to be available, and what is new in the new version?

From: lsr (Larry Rosenstein)

Subject: Re: MPW

The following are guesses as to dates. A beta of MacApp 2.0 should be available in a couple of months from APDA. A beta of MPW 3.0 should be available in the fall. The list of new features is fairly long, but here are some highlights. MacApp 2.0 contains support for views larger than 32K pixels, a redesigned display architecture (instead of Frames & Views, everything is a View), programs can create a hierarchy of views from a resource (there will be an interactive editor for the resource), the debugger will let you browse through the object that are in memory, better support for MF and styled TextEdit, the usual bug fixes and improvements. MPW 3.0 will have a symbolic debugger, support for running tools in the background, a source code control system, a bunch of new tools (a parser generator, a scriptable AppleShare server mounter, ...), the Pascal compiler has a better way to save its symbol tables (replaces $LOAD)

From: polaris (Jamal Hannan)

Subject: Resource Problems

Hello. I need a little help here... I am writing a program in Pascal & one of the procedures in it needs to get hex data from a resource of type DATA into an array, where each byte can be utilized individualy... I can’t seem to get my program to work.. here it is:

 myArray = ARRAY[1..10] OF INTEGER;
 myArrayPtr = ^myArray;
 myArrayHdl = ^myArrayPtr;
 filename : STR255;
 theResID : INTEGER;  
 theRefNum : INTEGER;   
 anArrayHdl : myArrayHdl; 

PROCEDURE QuickAndDirty;   
 theRefNum := OpenResFile(filename);     
 anArrayHdl := myArrayHdl(Handle(GetResource(‘DATA’, theResID)));   
 END; { QuickAndDirty }   

 filename := ‘Rscs’;   
 theResID := 1000;  

Anyone know whats wrong? Can you show me a routine that would work?

From: thecloud (Ken Mcleod, La Habra, CA)

Subject: Re: Resource Problems

Is it possible that GetResource(‘DATA’, theID) is conflicting with a DATA resource in another open resource file (like the compiler, or the System?) Perhaps using Get1Resource instead of GetResource might help... (just a guess, nothing more).

From: lsr (Larry Rosenstein, Cupertino, CA)

Subject: Re: Resource Problems

It is possible to get a resource conflict. In your application, however, your application resource file, or any resource file that you open will be searched first. Only if it is not found there will other opened resource files be searched. (Also, under MultiFinder, other applications won’t be visible at all.) Get1Resource might solve the problem. Also, you can see if this is in fact the problem by calling HomeResFile on the resource you get and see if it coming out of the resource file you expect.

From: polaris

Subject: resource

Help... It was written in Lightspeed Pascal & I had the linker automatically include the resource file so I didn’t need to call GetResource Anyway... that code WOULDNT work and simply by looking at it probaly wouldn’t tell anyone much.... anyway, I wrote some compleatly different code and it worked... here it is:

PROGRAM Open; {Jamal Hannan ... 5/18/88} 
 thing : PACKED ARRAY[1..200] OF INTEGER;    
 {setup addressable array block}   
 resType : STR255;  
 resID : INTEGER; 
 resHandle : Handle;
 resPtr, thingPtr : Ptr;
 blockSize : Size; 
 resType := ‘DATA’;{load up the resource...} 
 resID := 1000;  
 resHandle := GetResource(resType, resID);  
 resPtr := resHandle^;  
 {get resource pointer from handle}  
 thingPtr := @thing;
 {get pointer to point to array block}    
 blockSize := GetHandleSize(resHandle);    
 {get size of data block} 
 BlockMove(resPtr, thingPtr, blockSize); 
 {move res data into array space} 

The previous code was really something mostly written by someone on EchoMac (sort of a FIDO or OPUS email system for Macs)... it really didn’t work for me so I wrote my own. I think the problem with the last section of code was some Ptr or Handle type coersion... some pointers ended up pointing to the wrong memory blocks... NOW what I need is a bit of code that will save an ARRAY into a RESOURCE.. exactly the opposite of the above... but I am having alot of trouble... can anyone help me with that?

From: rdclark (Richard Clark, Tustin, CA)

Subject: Saving an array to a resource

Well, if what you want to do is save an array intact, and restore the exact same array to the exact same state, you can do the following: (* DANGER! DANGER! DANGER! This code has not been tested! *)

procedure DumpArray(theArray: arraytype; theRes: resType; resNum: integer); 
 scratchHand: Handle;     
 thisResFile: integer;     
 done : boolean;     
{If an old copy of the resource exists, remove it }  
thisResFile := CurResFile; 
{Should be done in main program, since you want the resource number of 
your application. }   
done := false;     
 scratchHand := GetResource(theRes, resNum);       
 if (scratchHand <> nil) then         
 if (HomeResFile(scratchhand) <> (thisResFile)) then        
 done := true;       
{ We have one or more copies of this same resource in our file, so delete 
it (and dispose of the body) }       
until done; 
 { Now, we can create a handle to hold the array }
scratchHand := Newhandle(sizeof(arraytype));     
 { Copy the data from the array to the resource }
BlockMove(@theArray, scratchHand^, sizeof(arraytype));       
 { Now, put the resource into your resource file }   
AddResource(scratchHand, theRes, resNum, ‘’);     
 { Checks to be sure there’s disk space } WriteResource(scratchHand); 
{Save it }

From: bzweig (Bruce Zweig)

Subject: LS Pascal & Radius SANE

If you use LightSpeed Pascal v.1.11 (the update that works with the 68020 in debugging mode) and the Radius SANE init for the Radius accelerator with ‘881 then the SANE function Round(x:real) is screwed up. It always rounds downward, so, for example, round(3.6) = 3. If you do a GetRound, it claims to be rounding toNearest, and even if you then do an explicit SetRound(toNearest) it still rounds as if it were set TowardZero. If you pull Radius SANE out of your system folder, then rounding works OK, so you’d think the problem is with Radius. On the other hand, if you leave Radius SANE in and use the old MacPascal, then round() works OK there too. The Radius guy I spoke to said that the problem isn’t necessarily theirs because they haven’t heard about it in connection with anything but LightSpeed Pascal. The THINK guy, naturally, said it was a Radius problem. I hope that posting this gets them to find out the problem, and anyone else using this setup should be forewarned.

From: rguerra (Rich Guerra)

Subject: Multifinder questions

I have a couple of questions regarding programming for Multifinder.

1) I’m trying to write an application that will be able to sublaunch another application while running under MF, but does not itself close. Control is transferred to the newly launched application which is now in the foremost layer. I’ve tried the code in Tech Note 126 (Sublaunching) and set the two high bits of LaunchFlags as specified in an addendum to the Multifinder developer’s documentation. However, the application gets launched and my application quits. Has anyone tried this code and made it work?

2) How does one determine how much memory is a) allocated for an application under MultiFinder and b) how do you determine the amount of the allocated space that is actually used. (i.e., something similar to the Finder About box that gives all this information graphically) Any suggestions would e appreciated.

From: thotpolc (Bill Evans, Irvine, CA)

Subject: Complaint Time

Okay, fellas it’s Complaint Department time.

Complaint One:

In the MacsBug documentation there is mention of something called the “current heap zone” under the HX, HC, and HD commands, and by implication also the HS and HT commands. This is completely different from the “current heap zone” as discussed in Inside Macintosh and determined by the TheZone global variable (at $118). It’s quite good that they’re different; it gives one a certain debugging flexibility. But (at least in MPW 1.0) the MacsBug documentation doesn’t say that they’re different. So when I forgot to change TheZone back to the application heap, I didn’t suspect it at first because the HC command quite innocently told me that my current heap was still the application heap. So beware. Check $118 if you want to know whether your program is working in the right heap zone.

Complaint Two:

The Inside Macintosh documentation for Secs2Date (p. II-380) says that it returns a pointer to a date/time record. Wrong. You set up the pointer in A0 to a date/time record for which you have allocated the space, and Secs2Date will fill that record. One would expect IM to be more clear on this point, since in most cases it is scrupulously careful in questions of this sort.

Complaint Three:

I’m sure most people who are interested know this, but I’ll state it for the record. The Inside Macintosh documentation for GetHandleSize (p. II-33) says “in case of an error, GetHandleSize returns 0”. Wrong. In case of an error, GetHandleSize returns the (less-than-zero) error codes listed at the bottom of the page. But those result codes aren’t quite right, either. They show noErr as meaning “No error”. Actually, in case of no error, you get the (greater than or equal to zero) size.

Complaint Four:

This last one isn’t about documentation; it’s about a botch in design details of QuickDraw. When you use the Memory Manager to get and resize handles and pointers and the like, you have adequate warning when an operation fails because of lack of memory. You can go off and pursue an alternative course of action without bombing the system. Not so when QuickDraw causes you to run out of memory. The best you can do is make the current heap be something whose grow zone function at least warns the user that he’s run out of memory -- but even this function, returning “failure” to QuickDraw, can’t prevent QuickDraw from bombing “25”. If we’re encouraged (and rightly so) to be fastidious about checking for no more memory with Memory Management traps, why can’t we be given the same opportunity with QuickDraw? Granted, a region may be fouled up beyond repair if QuickDraw runs out of main memory, but can’t it just then set it to contain nothing and let us decide what to do from there? [I’m convinced no one at Apple understands the proper way to do memory management on the Mac or they would have told us by now. It is the number one “black magic” art of Macintosh Programming. Scott Knaster’s books made the best effort at the subject, but that only scratched the surface of what is needed. -Ed]

From: cmkrnl (Eric Slosser)

Subject: recover from a HD crash

The following program is meant to read the last block of SCSI drive 0 and copy it to the 2nd block. The purpose is to overwrite a corrupted Master Directory Block so that Disk First Aid will be able to repair the disk. (As outlined in Tech Note #134, p.11) This is my first attempt at using PB driver calls, so I’ve messed something up. I get an ‘Illegal Err’ during the PBRead. The PC is somewhere in ‘Create’ (according to Macsbug). Anyone care to comment (once you stop laughing) on this?

PROGRAM FixDisk;   
USES {$LOAD PasSymDump} Memtypes, Quickdraw, OSIntf, ToolIntf, PackIntf; 

 SCSI_Zero_dQRefNum = -33;  { IM IV-215 and IM II-191 } 
 theQHdr : QHdrPtr;   { IM II-373 }        
 aQElem  : QElemPtr;  { IM IV-181 }        
 thePB   : ParamBlockRec;         
 theBuffer: ARRAY [1..128] OF INTEGER; { total size = 512 }         
 SizeOfVol: LONGINT;        
  err     : OSErr;   
 theQHdr := GetDrvQHdr;         
 aQElem := theQHdr^.qHead;           
 { we are going to babysit this code }           
 { Go through queue, looking for SCSI device ZERO }         
 WHILE aQElem <> theQHdr^.qTail DO       
 {we do this to get the ioVRefNum}                 
 IF (aQElem^.DrvQElem.dQRefnum <> SCSI_Zero_dQRefNum) 
 aQElem := aQElem^.DrvQElem.qLink;           
 IF (aQElem^.DrvQElem.dQRefnum = SCSI_Zero_dQRefNum) THEN            
 { It’s an 80MB drive, so we have to combine 2 fields for the size } 
 SizeofVol := BSL( aQElem^.DrvQElem.dQDrvSz2, 16 ) + aQElem^.DrvQElem.dQDrvSz; 
 WITH thePB DO                         
 ioCompletion := NIL;                         
 ioVRefNum := aQElem^.DrvQElem.dQDrive;                         
 ioRefNum := SCSI_Zero_dQRefNum;                         
 ioBuffer := @theBuffer;                         
 ioReqCount := 512;                        
 ioPosMode := fsFromStart;                         
 ioPosOffset := (SizeofVol -1)*512;                         
 END; { of filling in the param block }                 
 err := PBRead( @thePB, FALSE ); 
 { we die inside this call. Why?}                 
 IF (err<>noERR) THEN                         
 { ... the code would go on here to mimic the above, only writing }  

From: gbryan (Geoff Bryan)

Subject: LSP Interfaces

Has anyone seen a more complete set of interfaces for the ROM & System routines beyond what Think put out last fall? If not, it looks like a long session of porting over the MPW 2.0 interface files. (What started me on this quest was the discovery that the Shutdown Manager routines do not seem to be in last fall’s 1.11 update package. Don’t know what else is missing or different.) [We have blasted Think repeatedly for taking so long to keep LS Pascal up to date with the latest set of goodies from Apple. There is a new version coming, they tell me, but, like the LS C update, who knows when? If nothing is forth coming at the Boston Expo, you can bet we will blast them again! -Ed]

From: pepnerd (Peter Kramer)

Subject: menus

I’m just a beginner at programming the mac. I’m trying to set up menus using the code in “Using the Macintosh Toolbox with C” by Takatsuka et. al. I’m not sure how to call InitGraf() in the situation where I have not set up any windows, only menus. In my development system the example (Aztec C) the call to InitGraf() uses the argument &thePort. However I cannot find where thePort is defined. Its quite distressing to double click on an applicaton icon and get nothing but a bomb!

From: ericlim (Eric Lim, Flushing, NY)

Subject: Re: menus

I’m not familiar with Aztec because I’m using MPW C 2.0.2 and I think the variable thePort is defined in the “Quickdraw.h” header or include file.

From: think

Subject: Re: menus

It’s not important to know where thePort is defined; all that’s important is that you pass the correct series of initializations in order to get your application started:

 InitDialogs(NIL); }  

Typically, thePort is defined as an extern GrafPtr in Quickdraw.h (in LightspeedC) or in the appropriate header for other C compilers. --Rich Siegel, THINK Technologies

[The variable thePort is one of those mysterious Quickdraw global variables that no one ever talks about once you are convinced the proper call works correctly. The first few issues of MacTutor, over three years ago, addressed this subject in depth, explaining how the Quickdraw Globals are stored relative to A5 and how they work. The Mac system is responsible for the Quickdraw Globals maintenance. Refer to Volume 1 of The Best of MacTutor for more information. -Ed]

From: laskey (Jim Laskey, Halifax, NS)

Subject: Second Stack

Is there a safe way for an application to allocate a second system stack? TGS systems is currently developing a visual programming language known as Prograph. One of the main features of Prograph is the ability to perform editing and debugging of source code while in an execution state. All routine calling sequences are performed through a system stack as per normal. However, the state of the execution system stack must be kept separate from the system stack used during editing and debugging. The solution was to allocate a second system stack just for execution and use the defacto system stack for debugging and editing. Where does one allocate the second stack? For the sake of the stack sniffer this second stack was allocated between ApplLimit and A5. Early versions of Prograph used the following sequence to allocate the second stack;

newStack = ApplLimit;         
ApplLimit = newStack - DefltStack;

Until testing on the Mac II, this worked quite well. On the Mac II, strange things began happening whenever Prograph switched to the second system stack. Text would be not show up in menues and window frames were drawn incorrectly. The only noteable difference between the Mac II and the other systems was that DefltStack was 16k greater on the Mac II, presumably to handle colour Toolbox calls. The stack allocation algorithm was changed to the following;

newStack = ApplLimit + DefltStack / 2; MaxApplZone();

This works fine. However, what happens when a Toolbox call needs a large chunk of the stack? Is there a safe way for an application to allocate a second system stack?

[I don’t think so. This sounds like one of those nifty ideas that will probably never work since it will never quite match up with Apple’s changing system file, and MultiFinder evolution. I suggest you scrap this approach and try something less controversial. Can Apple DTS suggest a safe approach? -Ed]


Community Search:
MacTech Search:

Software Updates via MacUpdate

TextSoap 8.3.3 - Automate tedious text d...
TextSoap can automatically remove unwanted characters, fix up messed up carriage returns, and do pretty much anything else that we can think of to text. Save time and effort. Be more productive. Stop... Read more
Apple iTunes 12.6 - Play Apple Music and...
Apple iTunes lets you organize and stream Apple Music, download and watch video and listen to Podcasts. It can automatically download new music, app, and book purchases across all your devices and... Read more
Airmail 3.2.4 - Powerful, minimal email...
Airmail is an mail client with fast performance and intuitive interaction. Support for iCloud, MS Exchange, Gmail, Google Apps, IMAP, POP3, Yahoo!, AOL,, Airmail was designed... Read more
MacPilot 9.0.6 - Enable over 1,200 hidde...
MacPilot gives you the power of UNIX and the simplicity of Macintosh, which means a phenomenal amount of untapped power in your hands! Use MacPilot to unlock over 1,200 features, and access them all... Read more
Jamf Pro 9.98 - Powerful sysadmin/enterp...
Jamf Pro (formerly Casper Suite) is the EMM tool that delights IT pros and the users they support by delivering on the promise of unified endpoint management for Apple devices. At Jamf, connecting... Read more
PopChar 7.7 - $16.99 (51% off)
PopChar helps you get the most out of your font collection. With its crystal-clear interface, PopChar provides a frustration-free way to access any font's special characters. Features Expanded... Read more
RapidWeaver 7.3.1 - Create template-base...
RapidWeaver is a next-generation Web design application to help you easily create professional-looking Web sites in minutes. No knowledge of complex code is required, RapidWeaver will take care of... Read more
Sparkle Pro 2.1.4 - $79.99
Sparkle Pro will change your mind if you thought building websites wasn't for you. Sparkle is the intuitive site builder that lets you create sites for your online portfolio, team or band pages, or... Read more
Affinity Designer 1.5.5 - Vector graphic...
Affinity Designer is an incredibly accurate vector illustrator that feels fast and at home in the hands of creative professionals. It intuitively combines rock solid and crisp vector art with... Read more
djay Pro 1.4.3 - Transform your Mac into...
djay Pro provides a complete toolkit for performing DJs. Its unique modern interface is built around a sophisticated integration with iTunes and Spotify, giving you instant access to millions of... Read more

Failbetter Games details changes coming...
Sunless Sea, Failbetter Games' dark and gloomy sea explorer, sets sail for the iPad tomorrow. Ahead of the game's launch, Failbetter took to Twitter to discuss what will be different in the mobile version of the game. Many of the changes make... | Read more »
Splish, splash! The Pokémon GO Water Fes...
Niantic is back with a new festival for dedicated Pokémon GO collectors. The Water Festival officially kicks off today at 1 P.M. PDT and runs through March 29. Magikarp, Squirtle, Totodile, and their assorted evolved forms will be appearing at... | Read more »
Death Road to Canada (Games)
Death Road to Canada 1.0 Device: iOS Universal Category: Games Price: $7.99, Version: 1.0 (iTunes) Description: Get it now at the low launch price! Price will go up a dollar every major update. Update news at the bottom of this... | Read more »
Bean's Quest Beginner's Guide:...
Bean's Quest is a new take on both the classic platformer and the endless runner, and it's free on the App Store for the time being. Instead of running constantly, you can't stop jumping. That adds a surprising new level of challenge to the game... | Read more »
How to rake in the cash in Bit City
Our last Bit City guide covered the basics. Now it's time to get into some of the more advanced techniques. In the later cities, cash flow becomes much more difficult, so you'll want to develop some strategies if you want to complete each level.... | Read more »
PixelTerra (Games)
PixelTerra 1.1.1 Device: iOS Universal Category: Games Price: $.99, Version: 1.1.1 (iTunes) Description: The world of PixelTerra is quite dangerous so you need to build a shelter, find some food supply and get ready to protect... | Read more »
Tokaido™ (Games)
Tokaido™ 1.0 Device: iOS Universal Category: Games Price: $6.99, Version: 1.0 (iTunes) Description: Discover the digital adaptation of Tokaido, the boardgame phenomenon that has already sold more than 250,000 copies worldwide, and... | Read more »
Card Thief (Games)
Card Thief 1.0 Device: iOS Universal Category: Games Price: $1.99, Version: 1.0 (iTunes) Description: Card Thief is a solitaire style stealth game played with a deck of cards. In Card Thief you move through a deck of cards as a... | Read more »
Smilegate’s crafting battler Super Tank...
Super Tank Rumbleputs you in the seat of your very own, handcrafted tank. You can choose from over 100 different parts to create your Super Tank before taking it out to wreak havoc on your opponents in glorious PVP combat. Now, Smilegate is upping... | Read more »
The best games to play while you wait fo...
Mass Effect: Andromeda arrives this coming Tuesday and people are getting understandably antsy. There's a whole weekend standing between us and a brand new Bioware adventure. What's a geek to do? Well, you could certainly give these fine mobile... | Read more »

Price Scanner via

13-inch Touch Bar MacBook Pros on sale for up...
B&H Photo has the Apple 13″ Touch Bar MacBook Pros in stock today and on sale for up to $150 off MSRP. Shipping is free, and B&H charges NY sales tax only: - 13″ 2.9GHz/512GB Touch Bar... Read more
Today only! 15-inch 2.7GHz Space Gray Touch B...
B&H Photo has the new 2016 15″ 2.7GHz Space Gray Apple Touch Bar MacBook Pro in stock today and on sale for $300 off MSRP for today only. Shipping is free, and B&H charges NY sales tax only... Read more
New $329 iPad A Fabulous Value; 10.5-Inch iPa...
Part of the iPad upgrade/new model puzzle is now in place. Yesterday, as KGI Securities financial services group analyst Ming-Chi Kuo last summer predicted they would, Apple released a new low-cost 9... Read more
New 9.7-Inch iPad Features All Of The Fun...
Apple today updated its most popular-sized iPad, featuring a brighter 9.7-inch Retina display and best-in-class performance at its most affordable price ever, starting at $329 (US) with 32GB of... Read more
Apple Introduces iPhone 7 and iPhone 7 Plus (...
Apple today announced iPhone 7 and iPhone 7 Plus (PRODUCT)RED Special Edition in a vibrant red matte aluminum finish, in recognition of more than 10 years of partnership between Apple and (RED). This... Read more
Apple now offering Certified Refurbished 15-i...
Apple is now offering Certified Refurbished 2016 15″ Touch Bar MacBook Pros for $360-$420 off original MSRP. An Apple one-year warranty is included with each model, and shipping is free: - 15″ 2.6GHz... Read more
Apple Introduces Clips: A Free Innovative Way...
Apple today introduced Clips, a new app that makes it quick and fun for anyone to create expressive videos on iPhone and iPad. The app features a unique design for combining video clips, photos and... Read more
Urban Armor Gear Unveils Case For 4th Generat...
Orange County, California based Urban Armor Gear (UAG), designers of rugged, lightweight protective cases for phones, tablets and laptops, has released its latest drop-tested cases for Apple’s 4th... Read more
Most Users Continue To Prefer 5.0 to 5.3 Inch...
In the first half of 2016, US and UK smartphone users were most likely to be interested in purchasing a device with a 5.3″ or 5.0″ display. Findings in a new report from the User Experience... Read more
12-inch 1.2GHz Retina MacBooks on sale for up...
B&H has 12″ 1.2GHz Retina MacBooks on sale for up to $200 off MSRP. Shipping is free, and B&H charges NY sales tax only: - 12″ 1.2GHz Space Gray Retina MacBook: $1439.99 $160 off MSRP - 12″ 1... Read more

Jobs Board

*Apple* Retail - Multiple Positions - Apple,...
Job Description: Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, Read more
Fulltime aan de slag als shopmanager in een h...
Ben jij helemaal gek van Apple -producten en vind je het helemaal super om fulltime shopmanager te zijn in een jonge en hippe elektronicazaak? Wil jij werken in Read more
Starte Dein Karriere-Abenteuer in den Hauptst...
…mehrsprachigen Teams betreust Du Kunden von bekannten globale Marken wie Apple , Mercedes, Facebook, Expedia, und vielen anderen! Funktion Du wolltest schon Read more
Starte Dein Karriere-Abenteuer in den Hauptst...
…mehrsprachigen Teams betreust Du Kunden von bekannten globale Marken wie Apple , Mercedes, Facebook, Expedia, und vielen anderen! Funktion Du wolltest schon Read more
*Apple* Retail - Multiple Positions - Apple,...
Job Description: Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.