HDTenEightyP/NetNews huggingface dataset:
From: bayes@hplvec.LVLD.HP.COM (Scott Bayes)
Newsgroups: comp.sys.mac.programmer
Subject: Re: dereferencing Handles( was Re: incrementation differences/THINK C 4.0 vs. 5.0)
Date: 9 Sep 92 19:48:18 GMT
Organization: Hewlett-Packard Co., Loveland, CO

> Your remaining choices are semi-colon, comma and =. In this case,
> semi-colon and comma are semantically identical, so that's not much of a
> problem. Deciding between = and the others is slightly tricky. You can
> resolve this, in part, by seeing which variables have been initialized.
> If only one of the five variables has been initialized, the answer is
> almost certainly = (otherwise, you'd be assigning something to an
> uninitialized variable). Similarly, if both c and e (for example) have
> just been initialized, you're almost certainly missing a semi-colon.
> 

How do I tell which ones are initialized?

I might do this:

extern void dosomething;

dosomething(&c);

Is c now initialized or not? How can the compiler tell?

Lots of library routines do this kind of stuff.

The problem I see is that we expect a compiler to be RIGHT. If it's
not RIGHT, then development of my application and its stability are
both at great risk. It's tough enough to get a compiler to produce
rock-solid code, without having it guess.

ScottB
From: ksand@apple.com (Kent Sandvik)
Newsgroups: comp.sys.mac.programmer
Subject: Re: CD rom version of new IM (where? how much?)
Date: 10 Sep 92 17:53:14 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple

In article <lasl4gINNg86@pollux.usc.edu>, mharm@pollux.usc.edu (Michael
Harm) wrote:
> 
> Hi. A while ago there was a brief mention on this list
> of the new IM series, and a CD rom version thereof. 
> Can anyone tell me where such an animal is available,
> and how much it will cost?  Is it available through APDA?
> Mail order?  When will the whole lot of it be available?

You could get Blue Notes versions of new and alpha/beta
versions on the ETO CDs. Otherwise I don't know of any plans
about future IM CD releases (I'm sure it will happen).

Kent Sandvik/DTS
"I would rather have a thousands idiots attacking my position, than
have one idiot helping to defend it."	[Paraphrased from Voltaire]
-------------------
Kent Sandvik (UUCP: ....!apple!ksand; INTERNET: ksand@apple.com)
DISCLAIMER: Private activities on the Net.
From: John_Miller@mindlink.bc.ca (John Miller)
Newsgroups: comp.sys.mac.programmer
Subject: GetColor bug (was RE: NON-QUICKDRAW GAMES)
Date: 9 Sep 92 20:46:59 GMT
Organization: MIND LINK! - British Columbia, Canada
Distribution: world

In article <18lbbfINNsdp@agate.berkeley.edu>,
Ben Haller (deadman@garnet.berkeley.edu) writes
>  BTW, anybody noticed the charming System 7 bug that when the
> Color Picker comes up, after you dismiss it it leaves the CLUT
> fucked up?  Charming.  They haven't fixed that one yet, have they?

Yep.  Been meaning to post a message about that for months
now.  Haven't tried Apple's latest color stuff, but as of
Tuned-up System 7, the bug was still there.  Didn't
occur under System 6 with or without 32-Bit QuickDraw.

Rather annoying behaviour for a call that is documented to put
everything back the way it was.  Fortunately, writing an
crude alternate color dialog for CLUT devices was quick
enough, but it was an frustrating last minute discovery.

(I had a good excuse for not using the Palette Manager.
I was colorizing HyperCard's stack window.  The Palette
Manager doesn't think that attaching a palette to a
B&W window is a very groovy idea.)

I guess Apple engineers only use 24-bit displays these days.
Goes along with those 2 gigabyte disk drives and 64 Meg
of RAM they use for running MPW/CFront/MacApp/OtherNeatTools.  :) :)

John Miller
Symplex Systems

Newsgroups: comp.sys.mac.programmer
From: tom@dtint.uucp (Thomas R. Kimpton)
Subject: Re: MPW C++ Bundle For Sale
Keywords: mpw, c++, c
Organization: Digital Technology, International
Date: Thu, 10 Sep 92 22:30:23 GMT

In article <1992Sep10.214935.4171@dtint.uucp> tom@dtint.uucp (Thomas R. Kimpton) writes:
>In article <18612tINN5it@network.ucsd.edu> dpb@sdchemw2.ucsd.edu (Doug P. Book) writes:
[deleted]
Oops, hit F, instead of R. (embarrassed face).

-- 
---
Tom Kimpton                            tom@dtint.dtint.com
Digital Technology Int.                (801)226-2984	
500 W. 1200 South, Orem UT, 84057      FAX (801) 226-8438
From: REEKES@applelink.apple.com (Jim Reekes)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Sound Loop in a with a Modal Dialog?
Date: 8 Sep 92 21:28:14 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple Computer, Inc.

In article <1992Sep3.145524.8874@utkux1.utk.edu>, danny@utkux1.utk.edu
(Danny W. McCampbell) wrote:
> 
> Hi.  I want to play a sound continuously while a modal dialog is 
> present on the screen.  I have successfully go the loop to work
> without the modal dialog statement but the loop is only executed
> twice when I call modal dialog.  Here is  some sample code:
> 
> dialogtrue := true;
> while dialogtrue do
> begin
>   FlushSndChannel(mySndChan);
>   if SoundisStopped(mySndChan) then
>   begin
>     PlaytheSound(mySndChan);
>   end;
>   ModalDialog(nil, itemHit);			{Call Modal Dialog until the user clicks in the dialog}
>   if itemHit = 1 then
>     dialogtrue := false;
> end;
> StoptheSound(mySndChan);
> DisposDialog(AboutDialog);				{Dispose of the Dialog}
> 
> The sound plays only twice then stops playing.  Any ideas how I can
> do this successfully?  Thanks in advance.

The approach I would take is to start the sound, then call ModalDialog.
You need to use the callBackCmd and a CallBackProc.  You first play the
sound (ie. bufferCmd) then issue the callBackCmd.  When the sound ends
your CallBackProc is called.  This will call SndDoCommand with another
bufferCmd to start the sound again.

The approach you have outlined above will always be starting and stopping
the sound for events caused by the user.

-----------------------------------------------------------------------
Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
                             |          Sound Manager Expert
Apple Computer, Inc.         | RAll opinions expressed are mine, and do
20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
Cupertino, CA 95014          |       employer, Apple Computer Inc.S
Newsgroups: comp.sys.mac.programmer
From: RJONES1@ua1vm.ua.edu
Subject: Shareware compilers
Organization: The University of Alabama, Tuscaloosa
Date: Sun, 6 Sep 1992 07:25:21 GMT

  Are there any shareware or freeware compilers for the Mac?  If so, what are
they, which ones are best, and where can they be found?  Thanks in advance.
From: sdorner@qualcomm.com (Steven Dorner)
Newsgroups: comp.sys.mac.programmer
Subject: IUTimeString 411 gaffe?
Date: 15 Sep 92 18:31:20 GMT
Followup-To: comp.sys.mac.programmer
Organization: Qualcomm, Inc

411 says the following about IUTimeString:

>pascal void IUTimeString(long dateTime,Boolean wantSeconds,Str255 result)
>...
>Given a date and time as returned by the Operating System Utility
>routine ReadDateTime, IUTimeString returns in the result parameter a
>string that represents the corresponding time of day.
>...Notice that the time contains a space in place of a
>leading zero when the format specifies "no leading zero", so the length
>of the result is always the same.

Is it just me, or is this last sentence wrong?  I don't seem to get a
leading space when I call IUTimeString with a small time.

I've taken a quick look in the other online dox, and can find no mention of
this, one way or another.
--
Steve Dorner, Qualcomm, Inc.
Giving one of them new-fangled Mac newsreaders a try.
Newsgroups: comp.sys.mac.programmer
From: afisher@netcom.com (Alan Fisher)
Subject: Help with TPopup in MacApp 3.0
Date: Wed, 09 Sep 92 17:47:41 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 


How do you define a TPopup with a dynamic selection list (e.g., client list
from database)?

All the examples in the Programmer's Guide to MacApp (3.0) refer to CMNU 
resources that you have to define using ResEdit.  So how do you define the 
items in a menu dynamically and attach it to a TPopup?

Any ideas and code samples would help.

Thanks

-- 
Alan Fisher/Razi Mohiuddin
Software Partners, Inc.  999 Commercial Street, Palo Alto, CA 94303
Email: afisher@netcom.com;     Phone: (415) 857-1110;      Fax: 415-857-1404
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: GetColor bug (was RE: NON-QUICKDRAW GAMES)
Organization: Kalamazoo College
Date: Fri, 11 Sep 1992 17:12:07 GMT

Joe.Francis@dartmouth.edu (Joe Francis) writes:
>brad@vedge.UUCP (Brad Fowlow) writes:
>
>> Any thoughts on a PM-friendly way to get back the "normal"
>> system palette when my last paletted window dies,
>> just as happens when the app quits?
>
>I'm hopeful that someone else will post a more elegant way, but one way
>to do what you want is to detect when you are closing your only window,
>EraseRect it's portRect, and set it's Palette to the system palette,
>*then* close the window.  

On the puzzle page in develop #11 (available from ftp.apple.com), Kon &
Bal write: "In 32-Bit QuickDraw David Van Brink extended the Palette
Manager to include a routine called PaletteMgrExit. This routine is
called automatically for you when your application quits, thus restoring
the default color state."

Macsbug doesn't know that word, but you might want to try snooping
around (maybe step through ExitToShell, not that I'd like to try it).
Maybe you could shut down and re-init the Palette Manager?

Somehow I doubt that using an undocumented trap qualifies as an
"elegant" solution, but I thought I'd pass it along...
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 The essence of OOP:  "After some hacking, I finally got the program to
 work, but I'm still not sure why." - David Marcovitz (marcovitz@uiuc.edu)
From: chuck@gte.com (Chuck Hoffman)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Need small example of playing a sound in THINK C.
Date: 9 Sep 92 14:19:17 GMT
Followup-To: comp.sys.mac.programmer
Organization: GTE Laboratories

In article <1992Sep7.001953.570@nynexst.com>, rsilvers@powwow.nynexst.com
(Rob Silvers) wrote:
> 
> 	I have gotton the Mac to play sampled sound resources in
> THINK C, but I am having trouble playing a synthesized square wave.
> Could someone send me a small example of playing a simple note?

I did it recently this way, to play a sound asynchronously:

I used ResEdit to create (and preview play) a 'snd ' resource (trailing
blank required) with the following hexidecimal values.  Actually, I created
a template for ResEdit to make this easy.  Sound resource number should be
above 8191.  I used 9000.

============   'snd ' RESOURCE:

0001               Format 1
0001											   	Number of mod/synth's is 1
000100000000       Note synth id is 1, and null initial parm
0003               Number of commands
002B00FF00000000   Amplitude command (full blast)
002C008000000000   Timbre command (half between square and sine)
002803E800000036   Note command (1000 half miliseconds, F-sharp/A-flat)

============  TO PLAY THE SOUND:

SndCommand    myCallbk;

------------
disposeAlmaMater = FALSE;
myCallbk.cmd = callBackCmd;
myCallbk.param1 = NIL;
myCallbk.param2 = (long) &disposeAlmaMater;
SetItem (myMenuHandle[3], AlmaMaterItem, myStifleStr);
mySoundH = GetResource ('snd ', 9000);
HLock (mySoundH);
mySndChPtr = NIL;
myErr = SndNewChannel (&mySndChPtr, NIL, NIL,
    (ProcPtr) myCallBack);
myErr = SndPlay (mySndChPtr, mySoundH, TRUE);
myErr = SndDoCommand (mySndChPtr, &myCallbk, TRUE);

============   TO STOP THE SOUND

sndRC = SndDisposeChannel (mySndChPtr, TRUE);
HUnlock (mySoundH);
ReleaseResource (mySoundH);
disposeAlmaMater = FALSE;

============   CALLBACK ROUTINE

pascal void	myCallBack(SndChannelPtr workChPtr, SndCommand workCmd)
{
	*((Ptr) workCmd.param2) = (char) 0x08;  /* set flag in disposeAlmaMater */
	return;
}	

============

I'm a real beginner at this sound stuff, so postings of any other ways
would be of interest to me as well.


Chuck Hoffman
chuck@gte.com
GTE Laboratories, Waltham, Massachusetts, USA
(617) 466-2131
=====================================
I'm not sure why we're here, but I am sure that while we're here we're
supposed to help each other.
=====================================
From: mharm@pollux.usc.edu (Michael Harm)
Newsgroups: comp.sys.mac.programmer
Subject: CD rom version of new IM (where? how much?)
Date: 9 Sep 1992 12:46:24 -0700
Organization: University of Southern California, Los Angeles, CA
Distribution: world
NNTP-Posting-Host: pollux.usc.edu

Hi. A while ago there was a brief mention on this list
of the new IM series, and a CD rom version thereof. 
Can anyone tell me where such an animal is available,
and how much it will cost?  Is it available through APDA?
Mail order?  When will the whole lot of it be available?

Thanks much.

Mike Harm
mharm@pollux.usc.edu
Univ. of Southern California
---------------------------------------------------------------
"I agree that 'two times two makes four' is an excellent thing;
but if we are dispensing praise, then 'two times two makes five'
is sometimes a most charming little thing as well."
                 -Fyodor Dostoevsky,   "Notes From Underground"

-- 
-------------------------------------------------------------------
From: bx341@cleveland.Freenet.Edu (Robert E. Winston)
Newsgroups: comp.sys.mac.programmer
Subject: Re: FAQ request
Date: 12 Sep 92 05:21:21 GMT
Organization: Case Western Reserve University, Cleveland, Ohio (USA)
NNTP-Posting-Host: hela.ins.cwru.edu


 > Is there a FAQ for this group?

Is this a FAQ FAQ?

From Sumex:

info-mac/tech/csmp-faq-1.txt
From: baer@qiclab.scn.rain.com (Ken Baer)
Newsgroups: comp.sys.mac.programmer
Subject: Problems with GrowWindow().
Date: 15 Sep 92 19:35:48 GMT
Organization: SCN Research/Qic Laboratories of Tigard, Oregon.


I have a mysterious problem with the toolbox GrowWindow() call.  When I click
on the window's growbox, I don't get an Xor'd rect that follows the mouse, and
the values returned and put in the rect are way off screen.  I used code
from the book Macintosh Programming Primer volume 1.  I'm at a loss why this
isn't working.  Here is the code fragment of what I'm doing.  BTW, other
events coming into this window work fine.

 BOOL MsgToMessage( WINDOW window, EventRecord *event )
{
   short thePart, theMenu, theItem, lo, high;
   WindowPtr whichWindow;
   static LONG lasttick = 0, newtick;
   LONG menuChoice, windSize;
   Str255 accName;
   short accNumber, itemNumber;
   GrafPtr port;
   RECT sizeRect;

   Message.Class = 0;        

   switch (event->what) {
   case mouseDown:
      thePart = FindWindow( event->where, &whichWindow );
      switch (thePart) {
         case inGrow:
            windSize = GrowWindow( whichWindow, event->where, &sizeRect );
            if ( windSize != 0 ) {
               GetPort( &port );
               SetPort( (GrafPtr)whichWindow );
               EraseRect( &whichWindow->portRect );
               lo = LoWord(windSize);
               high = HiWord(windSize);
               SizeWindow( whichWindow, lo, high, TRUE );
               InvalRect( &whichWindow->portRect );
               SetPort( port );
            }
            break;
      }
      break;
   }
}

I am #including all relevent function prototypes.

Am I missing something obvious?  Any helpful comments will be appreciated.
	-Ken Baer.
	baer@qiclab.scn.rain.com
-- 
    //    -Ken Baer.  Programmer/Animator, Hash Enterprises
  \X/     Usenet: baer@qiclab.UUCP  /  Office: (206)573-9427
          "Hey, I think a glacier just passed us!" - Andy from Joyride
Newsgroups: comp.sys.mac.programmer
From: kent@sunfs3.Camex.COM (Kent Borg)
Subject: Re: Animated Cursor
Organization: Camex Inc., Boston MA
Date: Wed, 09 Sep 1992 18:42:32 EDT

In article <BuBnpJ.AEu@unix.amherst.edu> mbabramo@unix.amherst.edu (MICHAEL BERNARD ABRAMOWICZ) writes:
>Another possible approach is to use the Vertical Retrace Manager.
>This is pretty easy if you have New Inside Macintosh: Processes,
>since full source code is conveniently provided. 
>
>Michael Abramowicz
>
>Disclaimer: I wrote the first version of the chapter as an Apple
>summer intern, so I am somewhat biased. But it really is easy.

And I didn't like it when I saw it.  No, I have no gripes (or opinions
actually) with the quality of the code, my complaint (often repeated
here) is that a VBL task should *not* be used to spin a cursor.  It is
dishonest.

Spinning cursors are not just there to be cute, they are to assure the
user that things are still progressing, their speed and cadence can
convey information about the progress of short procedures.  (Long
procedures should get cancelable progress thermometers, not spinning
cursors.)

If you use an effort-saving VBL to spin your cursor you are unlikely
to put in the extra work needed to make the cursor representative of
whether there really *is* any progress going on.  

Spinning cursors is not a background task, it is part of the Real Work
of your application, do it in the Real Code.  Save VBLs for background
activities.


--
Kent Borg            kent@camex.com or (when it is *working*) kentborg@aol.com
                                            H:(617) 776-6899  W:(617) 426-3577
As always, things look better when some costs are left out.
						      -Economist 3-28-92 p. 94
From: peterc@cubetech.com (Peter Creath)
Newsgroups: comp.sys.mac.programmer
Subject: How does MultiFinder switch programs? (Q)
Date: Sun, 13 Sep 92 08:58:48 CDT
Organization: Cube Technologies
Reply-To: peterc@cubetech.com
Distribution: world
            

How does MultiFinder/Sys7Finder do it?  How does it switch the program
flow to a background program?  And how does it switch foreground applications?

I am asking for answers on an 68030 assembly level.  What registers
is it messing with?  Does it merely pull the other app's registers
out of storage and restore them?  Or what?

Please mail me all responses at peterc@cubetech.com (cubetech!peterc
doesn't work).  I will post a summary (assuming I get some answers)...

----------------------------------------------------------------------------
Peter Creath                 "When I was a boy I was told that anybody could
peterc@cubetech.com           become president; I'm beginning to believe it."
                                                           -- Clarence Darrow
From: bpb9204@tamsun.tamu.edu (Brent)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Offscreen bitmap problem
Date: 6 Sep 1992 07:25:04 GMT
Distribution: usa
Organization: Texas A&M Univ., Inc.

bpb9204@tamsun.tamu.edu (Brent) writes:
|
|I am writing a small fractal graphics application that generates basic B/W
|images.
|I decided on using an offscreen
|bitmap and draw to both bitmaps simultaneously. 

I got it working about an hour after I posted.  I went back and studied
my code, really thought about what I was trying to do and also studied the
IM chapters again.  Finally, it worked.

Now that this offscreen stuff is working (and it's neat), I was able to add
image saving to a file, proper updates, etc.  It's fleshing out nicely.

Thanks to all who helped: John, Jim, Kenneth and the UMPG.

-Brent
From: ksand@apple.com (Kent Sandvik)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Things I'd like to see: SourceBug
Date: 6 Sep 92 00:34:11 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple

In article <1992Sep3.220659.25883@verity.com>, anders@verity.com (Anders 
> This assumes that the list is sorted, which isn't necessarily true
> - TKeySelectionBehavior works in weird ways (from the user's
> perspective) on non-sorted list.  Perhaps a flag to turn it on
> would be better than always having it on.

Thanks for the hint. When I think about it, TKeySelectionBehavior 
should work independently if the TTextListView is sorted or not.

I will add this to our TODO MacApp bug database.

Kent
Newsgroups: comp.sys.mac.programmer
From: ulfis@cyklop.nada.kth.se (Anders Ulfheden)
Subject: CTB undocumented routines and Think Libs
Organization: Royal Institute of Technology, Stockholm, Sweden
Distribution: comp
Date: Tue, 8 Sep 1992 21:35:13 GMT

The file <CommResources.h> contains the glue for some *undocumented* CTB
routines:

...
pascal Handle CRMGetToolResource (short procID, ResType theType, short theID);
pascal void   CRMReleaseToolResource (short procID, Handle theHandle);
...
pascal OSErr  CRMFindCommunications(short *vRefNum, long *dirID);
...

When I use CRMGetToolResource() in my code (CommToolbox library added) I get
a "undefined CRMGetToolResource" link error.

I can't find any description in my Inside CTB (published 1991) or in
MPW's 411 help file for the CTB. Can someone from Symantec or Apple help me
out?

Tnx!

ulfis
--
+------------------------------------------------------------------------------
|  Anders Ulfheden
|  USENET:  ulfis@nada.kth.se		AppleLink: SW0429
|  Royal Institute of Technology
|  Stockholm, Sweden
Newsgroups: comp.sys.mac.programmer
From: siegel@world.std.com (Rich Siegel)
Subject: Re: Think C MacHeaders weirdness
Organization: GCC Technologies
Date: Thu, 10 Sep 1992 12:32:34 GMT

In article <72240@apple.Apple.COM> mkelly@Apple.COM (Michael Kelly) writes:
>
>OK, this is strange.  I had a simple program that first initialized the
>toolbox with InitFonts, etc., in the correct order, and then went on to
>make some File Manager calls.  The initialization routine was in a separate
>file from both main and the rest of the program.  I wasn't including
>MacHeaders in the Prefix.  I ran the program with the debugger, and it
>crashed violently in the toolbox initialization routine.  I tried a few
>things, none of which made any difference.  I finally #included MacHeaders
>at the top of the file, and then it worked.  Weird.
>
>The next call was in a different file.  It was to FSMakeFSSpec, which failed,
>saying the volume didn't exist.  There was nothing wrong with the call.  I
>#included MacHeaders, on a whim, in that file, and magically the function
>worked as it should.
>
>The next call was to OpenWD, in yet another file.  It stopped in the
>debugger with a bus error inside MacTraps2.  "Well, this is silly," I
>thought, and I put MacHeaders in the Prefix.  Now the program works as
>it should (well, except for some other unrelated things....)
>
>So, any ideas?  Has anyone run into this sort of weirdness before?

No wierdness at all. All of the calls you've mentioned here are implemented
through glue in an external library (MacTraps and MacTraps2 in this case).
Since you called them with the correct spelling, you didn't get link errors,
but because you didn't include either <MacHeaders> or the appropriate
Toolbox headers (File.h would be appropriate here), the compiler rightly
concluded that the undeclared functions used the C calling convention
and returned an 'int'. Bad news, since all Toolbox calls are 'pascal'
functions. By including <MacHeaders>, you get declarations for all of
the functions whose functions are prototyped in the headers that
MacHeaders was built from, so this doesn't happen.

R.



-- 
-----------------------------------------------------------------------
Rich Siegel                              Internet: siegel@world.std.com
Software Engineer & Toolsmith
GCC Technologies
From: stauffer@cc.swarthmore.edu (Glenn Stauffer)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Best text compression?
Date: 9 Sep 92 00:31:45 GMT
Organization: Swarthmore College Computing Center
X-Xxmessage-Id: <A6D2BE0CF601433A@mac8.beardsley.swarthmore.edu>
X-Xxdate: Tue, 8 Sep 92 01:31:08 GMT
X-Useragent: Nuntius v1.1.1d9

In article <D88-JWA.92Sep7111945@dront.nada.kth.se> Jon W{tte,
d88-jwa@dront.nada.kth.se writes:
>Source avaialble for the macintosh is LZRW-1b which is a high-
>speed, LZ-77 derivative.
>
>"Yabba" is an LZ-78 relative that also is in the public domain.
>

Does anyone have the address of an FTP site for the LZ* source?
Newsgroups: comp.sys.mac.programmer