HDTenEightyP/NetNews huggingface dataset:
Organization: Penn State University
X-Vignette: Unix -- the operating system for the vowel-impaired.
Date: Thursday, 16 Apr 1992 09:14:05 EDT
From: Christopher Tate <CXT105@psuvm.psu.edu>
Newsgroups: comp.sys.mac.programmer
Subject: Re: diskInserted events
 <92105.142724CXT105@psuvm.psu.edu> <65498@apple.Apple.COM>

In article <65498@apple.Apple.COM>, Keith_Rollin@taligent.com (Keith Rollin)
says:
>
>[I asked the following:]                                                      r
>>
>> Be that as it may, what should my app be *doing* with them when it
>> sees them?  I have yet to write an application that needed to know
>> about these events, so why should I bother looking at them.
>>
>
>If you get a disk-inserted event with a result code of noErr, then you don't
>need to do anything. However, if the result code is not noErr, then you should
>call DIBadMount.

Ah, this explains quite a bit.  I assumed that since "something else" was
taking care of mounting the disks, "something else" would take care of
the initialization prompt, too.

And, it seems that *LOTS* of applications fail to do this.  One big, big
problem that we have in the PSU public Mac labs (Mac IIsi's, Sys. 7) is
that people get terminally confused by putting a disk in and watching
nothing happen.  MacWrite II (latest version) "eats" bad disks by not
calling DIBadMount, as does Darkside of the Mac 2.4 (is this fixed in
version 3?).  And so does MacPaint 2.0.

At last, I understand why we've been seeing this...  <whew>  And now
I *will* Do the Right Thing and call DIBadMount when appropriate.  Thanks
for the clarifications, everyone.

-------
Christopher Tate        |  "Computer Science has more real-world
                        |   applications than rotisserie baseball."
cxt105@psuvm.psu.edu    |
Bitnet:  CXT105@PSUVM   |       -- Ben Liblit, next-door neighbor
From: Pete.Gontier@p811.f70.n109.z1.fidonet.org (Pete Gontier)
Sender: Uucp@blkcat.UUCP
Newsgroups: comp.sys.mac.programmer
Subject: Anybody interested in a Clock program?
Date: Sat, 11 Apr 1992 00:03:59 -0500

 PP> From: potts@itl.itd.umich.edu (Paul Potts)

 PP> In article <34081@unix.SRI.COM> mxmora@unix.SRI.COM (Matt Mora) writes:

 PP> > In my constant vigil to replace all the Inits and cdevs I use
 PP> > with small applications since I use system seven, I wrote a program to
 PP> > replace SuperClock.

 PP> > How do you make a background only application?

 PP> If your application is background only it shouldn't have a user
 PP> interface. In this case you wouldn't initialize any of the managers
 PP> that provide the user interface. However since your application
 PP> *does* have a user interface...

Unfortunately, you can't even begin to compromise on this issue. I've had
a bg-only app crash just calling InitGraf. Ugly scene.

This sounds a lot like the perfect excuse to write directly to video RAM.

<<< Hey, what are you guys doing here? You're the Apple *what* police?
You can't do this, I'm an American citi<mmphgurble gack!>> Help! Help! >>>
Newsgroups: comp.sys.mac.programmer
From: zobkiw@world.std.com (Joe Zobkiw)
Subject: Re: TextWidth Weirdness
Organization: The World Public Access UNIX, Brookline, MA
Date: Fri, 10 Apr 1992 14:16:20 GMT

<< I am calling TextWidth to determine the width of a rectangle I need
to block out some text, but the width is always falling short of the
true width on the screen. It's coming out to be something like 80% of the
real width. So the longer the string the more characters it skips. Is
there something strange about TextWidth that I'm missing? >>

TextWidth probably works on the current port and the current font, size, and
style (etc.) so you should make sure all of these things are set correctly
before making to call.


-- 
<--------------------------------------------------->
 joe zobkiw                     zobkiw@world.std.com
 mac.synthesis.MIDI.development.C.asm.communications
>---------------------------------------------------<
From: dk2l+@andrew.cmu.edu (David McClain Koltas)
Newsgroups: comp.sys.mac.programmer
Subject: NEED HELP re:Mail order
Date: 6 Apr 92 21:36:03 GMT
Article-I.D.: andrew.gdsAF3m00WBKM8La9B
Organization: Fifth yr. senior, IM - Graphic Communications, Carnegie Mellon, Pittsburgh, PA


I'm planning on ordering a Mac system by mail order.  If you have any
strong oppinions (positive or negative) about companies you've delt with
in the past, please send me Email so that I can make the best choice.

Please Reply Directly to
dk2l+@andrew.cmu.edu

thanks in advance,

-dave
From: ksand@apple.com (Kent Sandvik)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How to write a WDEF
Date: 11 Apr 92 17:10:52 GMT
Organization: MacDTS Mongols

In article <1992Apr2.210140.4369@fcom.cc.utah.edu>,
mshields@jgravesnext.nurs.utah.edu (Mike Shields) writes:
> 
> 
> Can anyone point me in a direction which will give me some help in getting  
> going on writing a WDEF.  Is it in IM anywhere.  I'm at work and came up with
a  
> WDEF I want to do and don't have IM here.  Also, if I wanted to add it to the 

> system, ala AltWDEF, how would I go about this??

Some information is in the IM, developer CDs have the System 6 WDEF,
and TN 298 talks about the System 7 Window colorization.

Also, MacApp has the HyperCard floating window WDEF sources so you could
use those for whatever you want. I guess old MacTutor articles also
talks about WDEF hacking.

Regards,
Kent Sandvik
From: wwg2101@zeus.tamu.edu (GILPIN, W.W.)
Newsgroups: comp.sys.mac.programmer
Subject: I need your opinion
Date: 7 Apr 92 10:03:00 GMT
Organization: Texas A&M University, Academic Computing Services
News-Software: VAX/VMS VNEWS 1.41


I know this probably isn't the best place for this, but so what.

I need answers to the following question:

If you were to buy a computer today, and had to choose between an IBM/PC
or clone and an Apple Macintosh, which would you choose and why? 

Mac and IBM are the only two platforms I'm evaluating in this report, so 
please limit your answers to these two machines.
E-mail only please...I don't want to start a flame war, I want useful opinions.
Thanks for any responses.

Wes Gilpin
WWG2101@ZEUS.TAMU.EDU
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@byse.nada.kth.se (Jon W{tte)
Subject: Re: Large pointer blocks
Originator: d88-jwa@byse.nada.kth.se
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Tue, 7 Apr 1992 20:57:44 GMT

.edu> kamprath@caen.engin.umich.edu (Michael F. Kamprath) writes:

   my programs are stable, I would like to increase the array size 
   but I can't allocate pointers for memory blocks larger than about 
   30K of RAM.  I think I read some where that this is a natural limitation

Only for statically allocated arrays. However, Think C malloc
in version 4 takes an int for argument; you lose for > 32k.
Use calloc instead ! It takes two 16-bit ints, which multiply
correctly. You're probably already including stdlib.h, but
check for that too :-)

NewPtr and NewHandle (built-in memory allocators in the mac)
take long ints as parameters; they can allocate as much memory
as you have RAM (or VM)

   I am using a IIci to do my programing on.  Does the new Quadra have this
   same memory limitation?  If so, how can Apple seriousely try to put it
   off as a "powerful", "number crunching", "Atila the Hun" type of computer?  

As you probably realize, it's a design limitation in the Think C 4
compiler, not in the mac. Even the Mac 128 could allocate > 32k
memory if you had that much free...

If you're going to program the mac seriously, you got to get the
Inside Mac volumes (all six of them except volume III)

   I realize a Mac is slow when compared to DEC stations and the such, so it
   may not be my best choice for heavy number crunching.  But it is accesible
   and overnight runs are not impratical for me. If anybody could help me solve

Hey, a Quadra runs circles around a DecStation 3000s (?) and is
quite comparable to various Sparcs. And even a PowerBook is much
snappier in user response than anything running X windows...

Unless you run MacX on your PB using Remote Access of course :-)

-- 
h+@nada.kth.se; Jon W{tte, the Diplomat - NOT!
From: roy@adeptsln.cts.com
Newsgroups: comp.sys.mac.programmer
Subject: Re: THINK C and UNIX stat() function
Date: 14 Apr 92 03:29:09 GMT
Reply-To: roy@adeptsln.cts.com
Distribution: usa
Organization: Adept Solutions

In article <1992Apr10.160904.14885@ncar.ucar.edu> bill@lhotse.ucar.edu writes:
> Does THINK C have an equivalent to the UNIX system library routine stat()?
> Basically, I need to determine the time a file was modified so I don't
> really need the full functionality of the UNIX stat() routine.  Is there
> anything in the THINK C library, or perhaps the Mac toolbox that will
> provide this capability?
> 
> Thanks in advance,
> --Bill

Look in IM Vol II, under PBGetFInfo (page 115), this call gives you everything  
pertenant about the file, including creation & modification dates.

-- 
Roy Lovejoy      | internet:  roy@adeptsln.cts.com
Head RGB Guy     | AppleLink: adept
Adept Solutions  | CIS:       72447,1447
.................| dual certified developer: NeXT & Apple ;)
Newsgroups: comp.sys.mac.programmer
From: dn5@apix.psu.edu (D. Jay Newman)
Subject: Re: Silly question about determining DirIDs
Organization: Penn State
Distribution: comp
Date: Fri, 10 Apr 92 20:50:15 GMT

In article <D88-JWA.92Apr9214749@hemul.nada.kth.se>, d88-jwa@hemul.nada.kth.se (Jon W{tte) writes:
> 
> .xerox.com> gerson@parc.xerox.com (Dan Gerson) writes:
> 	   HParamBlockRec info;
> 	   CStr255 name = dirspec.name;
> 
> You can't copy strings this way in C...

Sorry, Jon, but while you can't copy strings in C that way, you can copy
them in C++ using the CStr255 class (which is defined in some MacApp headers).

I think that they will eventually be part of the normal MPW C++ distribution.
They certainly make *my* life easier.

()()()()()()()()()()()()() CBEL--Teaching & Learning Technologies ()()()
D. Jay Newman     !            Save the whales
dn5@psuvm.psu.edu !        (Collect the whole set)
dn5@apix.psu.edu  !
Newsgroups: comp.sys.mac.programmer
From: james@ee.uts.edu.au (A. James Boswell)
Subject: Think C & system calls
Organization: University of Technology, Sydney, Australia
Date: Tue, 14 Apr 1992 01:33:35 GMT
Summary: does thinkC generate system calls if only the ANSI library is used ?
Keywords: Think C, ANSI

Will think C 5.0 generate MAC system calls if only the ANSI library is
used ? (how is malloc implemented for e.g.). Does using objects make a
difference (not TCL, just written ones).

James.
From: casgrain@ERE.UMontreal.CA (Casgrain Philippe)
Newsgroups: comp.sys.mac.programmer
Subject: How to turn File Sharing on?
Date: 10 Apr 92 17:58:11 GMT
Organization: Universite de Montreal


	I would like to know how to turn file sharing ON or OFF, not by
using the Control Panel, but from within an application.
	There seems to be no mention of this in IM VI.

	Examples in Pascal would be appreciated, but I have a reading
knowledge of C.

	Thanks in advance,
	Philippe Casgrain
	Casgrain@ERE.UMontreal.CA
From: bill@lhotse.ucar.edu
Newsgroups: comp.sys.mac.programmer
Subject: THINK C and UNIX stat() function
Date: 10 Apr 92 16:09:04 GMT
Reply-To: bill@lhotse.ucar.edu ()
Distribution: usa
Organization: High Altitude Observatory/NCAR, Boulder CO

Does THINK C have an equivalent to the UNIX system library routine stat()?
Basically, I need to determine the time a file was modified so I don't
really need the full functionality of the UNIX stat() routine.  Is there
anything in the THINK C library, or perhaps the Mac toolbox that will
provide this capability?

Thanks in advance,
--Bill
Organization: Senior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
From: sc5h+@andrew.cmu.edu (Shawn James Cokus)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Doing playthru on a Quadra
Date: 11 Apr 92 14:38:38 GMT
Organization: Freshman, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA


>I'm trying to get continuous sound play-thru on my Quadra (a la the Audio
>dialog box in Hypercard 2.1).  Having purused IM VI, it _seems_ that this
>should be possible with just two calls:
> 
>err = SPBOpenDevice(NIL, siWritePermission, &myRefNum);
>SPBSetDeviceInfo(myRefNum, siPlayThruOnOff, daPtr);
> 
>(where the value in daPtr is something between 1 and 7)
> 
>I know there's a little PD program available (actually, it may be
shareware...)
>called PlayThru which is supposed to do just this, but it doesn't work on
>my Quadra (even though the play-thru in Hypercard works fine), so I'm
>suspecting that perhaps the Q requires some extra code or something.  Can
>anyone shed some light on this please?
> 
>Thanks,
>Tob
> 
>bluecow@unix.cis.pitt.edu

I'm the author of "Play-Thru!" and the problem really isn't the Quadra,
but System 7.0.1.  When 7.0 was around, those two calls above would have
set play-through on.  However, something odd happened and now you also
have to turn on meter levelling.  Don't ask why.  Don't ask how long it
took me to figure that out.  ;-)  Anyways, I've been meaning to fix
Play-Thru! 1.0 for a while, but in the process I've also been doing a
massive overhaul into a cdev/INIT thing with new features; I can't
promise it anytime soon...

--Shawn.
Newsgroups: comp.sys.mac.programmer
From: russotto@eng.umd.edu (Matthew T. Russotto)
Subject: Re: Think C & 68k cross compiling
Date: Tue, 14 Apr 92 15:06:27 GMT
Organization: College of Engineering, University of Maryland, College Park
Keywords: cross compile, think C, 68k

In article <james.703208470@ee.uts.EDU.AU> james@ee.uts.edu.au (A. James Boswell) writes:
>
>Hello,
>Can anyone help me with info about compiling for non Mac 68K based
>systems using ThinkC 5.0 or a C++ compiler? I own ThinkC 5.0 and I have
>to write some code for a 68332 based robot.  (68332 is a superset of
>68K with some 020 instructions).
>
>My (many) questions are these :
>
>Is there a utility for stripping CODE resources of JUMP tables, and
>locating code at a specific address (say for moving code to a ROM)?

Under THINK C, compile as a code resource with custom headers-- this
should make pure code, with none of the header stuff.  I'm fairly sure
this will even be loadable to ROM.  THINK C applications are not, as they
use installation code to fix some references.  Don't use any globals--
you will have to handle them yourself.

>Is there a way to ensure that no system (OS, ROM or otherwise) code is
>called when Think C compiles it?

Don't make any trap calls, and don't include any libraries.  Also,
don't use floating point.  I'm 99% sure that will do it.

If you want to use MPW, see Apple tech Note 240-- it has all sorts of
info on the pitfalls of using MPW to make standalone code.
-- 
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
Some news readers expect "Disclaimer:" here.
Just say NO to police searches and seizures.  Make them use force.
(not responsible for bodily harm resulting from following above advice)
Newsgroups: comp.sys.mac.programmer
From: ivanski@world.std.com (Ivan M CaveroBelaunde)
Subject: Re: Writing apps that use plug-ins?
Organization: The World Public Access UNIX, Brookline, MA
Date: Tue, 7 Apr 1992 02:55:16 GMT

Calling plug-ins is pretty straightforward. Pseudocode follows:

typedef pascal OSErr (*PlugInProcPtr)(short selector, long param1, etc);

short refNum;
Handle plugInResource;
PlugInProcPtr plugInProc;

plugInResource = Get1Resource(kPlugInType,kPlugInID);
HLock (plugInResource);
plugInProc = (PlugInProcPtr)StripAddress(*plugInResource);
err = (*plugInProc)(selector, param1, ...);

You should also have error checking code (nil empty handle for the
code resource, resource file not opening, etc) as well. If you're 
designing the plug-in specs, it might be useful to have descriptive
resources in the plug-in as well, which you can then parse.

Hope this helps,

-Ivanski
---
Ivan Cavero Belaunde
DiVA Corporation
#include <std.disclaimer.h>
From: ksand@apple.com (Kent Sandvik)
Newsgroups: comp.sys.mac.programmer
Subject: Re: LISP and DrawString questions
Date: 14 Apr 92 19:24:43 GMT
Organization: MacDTS Mongols

In article <1992Apr6.123523.1@wittenberg.edu>, myers@wittenberg.edu writes:
> 
> I asked both of these questions before but I never received any answers
because
> the newsfeed here went down for 5 days and we missed all those messages.
> 
> First:  I'm looking for a public domain version of LISP.  Does anybody know of
> one (if so, where can I get hold of it)?

Check comp.lang.lisp now and then for their FAQ, it should have a list of 
known PD LISP systems running under MacOS, including ftp addresses.

As for PD stuff, there are few (any?) Common Lisps which are free that I know
of. Our Common Lisp implementation, MCL, costs 495$US, and it's a bargain
compared with what you get, CLOS, Mac libraries, most of the stuff you need
in the LISP world. Similar Windows packages are usually 5000$US upwards
(development environment).

Cheers,
Kent Sandvik
Dynamic Language Believer
From: ksand@apple.com (Kent Sandvik)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How about powerbook's interrupt&reset KEYS
Date: 11 Apr 92 17:06:56 GMT
Organization: MacDTS Mongols

In article <1992Apr02.184353.28030@eng.umd.edu>, russotto@eng.umd.edu (Matthew
T. Russotto) writes:
> 
> In article <michel.702169271@cst02> michel%cst02.segin.fr@relay.prime.com
(Michel Pollet) writes:
> >
> >	Well, nice, all works fine with this pretty PB140, but the
> >	so used int&reset keys are so little that you have to use a pen
> >	to push them..
> >	And no 'power' key, so there no way to uses Programmer's key..
> >
> >	Someone came with a solution ?
> 
> Yes, I modified the code in Programmer's Key which checks for the ROM
> code of the Mac Portable, and changed it to check for the ROM code of
> the PB170.  You could do the same with the PB140 code.

Programmer's Key 1.4.1 works with powerbooks.

Regards,
Kent Sandvik
From: stas@brahms.udel.edu (Stanislaus Pietrucha)
Newsgroups: comp.sys.mac.programmer
Subject: SQL/ORACLE/HYPERCARD
Date: 16 Apr 92 19:59:38 GMT
Distribution: usa
Organization: University of Delaware

I'm going to be developing a hypercard application which interfaces with
ORACLE via SQL.

I would like to get a book or books which would help me understand these
topics better.

Can anyone recommend a book(s) for this purpose?

Please include the author, title, and publisher.

Thanks

Stas Pietrucha
From: francois@welchgate.welch.jhu.edu (Francois Schiettecatte)
Newsgroups: comp.sys.mac.programmer
Subject: MacTCP
Date: 14 Apr 92 13:25:07 GMT
Organization: Johns Hopkins Univ. Welch Medical Library

Hi

I have a quick question about MacTCP and DNR. When the  drivers are
opened do they get loaded into the application's memory space. I am
asking this because I am writting a small application which uses 
them and when I open up the MacTCp driver a chunk of my applications
memory gets allocated, same goes for DNR. I am assuming that this is
due to the drivers getting loaded. The problem with that is that the
space gets allocated as pointers and cannot move, is there a way I 
can cause the drivers to get loaded when I start my application up
with just a couple of function calls so that the space allocated is 
as low in memory as possible.



Francois Schiettecatte
Internet: francois@library.welch.jhu.edu
Phone	: (410) 955-7581
Newsgroups: comp.sys.mac.programmer
From: sje@xylos.ma30.bull.com (Steven J. Edwards)
Subject: Re: COMBINATORIX...math-type programming question?
Reply-To: sje@xylos.ma30.bull.com
Organization: Bull HN, Worldwide Information Systems, Billerica, Mass., USA
Date: 17 Apr 92 15:04:05
	<MHALL.92Apr17143346@occs.cs.oberlin.edu>

In article <MHALL.92Apr17143346@occs.cs.oberlin.edu> mhall@occs.cs.oberlin.edu (Matthew Hall) writes:
# In article <1992Apr16.202704.8111@crash.cts.com> alen@crash.cts.com (Alen Shapiro) writes:
#
#>    ok you budding math-type mac programmers...here's a question...
#> 
#>    I need to figure out how many ways n objects may be picked from a set
#>    of m objects. Order is not relevant (ab = ba). 
#> 
#>    Is the answer (m-n)! (!=factorial)?...this works for the boundary condition
#>    where m=n only if 0! = 1 and my math is too shaky for this.
#> 
#
# well, lets see.  
# First pick - m possible choices
# Second pick - m-1 possible choices
# nth pick m-n+1 choices
#
# algorithm = m*(m-1)*(m-2)*...*(m-n+1)
#
#	     = m!
#	     -----
#	     (m-n)!  = works for boundary condition.  In fact, it just works.

	Nope.  Remember, he said that order was unimportant.  The
correct answer is:

	C = n! / ((n - k)! * k!)

For example, the number of different five card poker hands that can
be dealt from a fifty two card deck is:

	C = 52! / (47! * 5!) = 2598960

For thirteen card bridge hands:

	C = 52! / (39! * 13!) = approx 6.35 * 10 ^ 11

	I guess that there just aren't that many card players among
Mac programmers.

 [The above opinions expressed are my own; not necessarily held by others.]
      == Steven J. Edwards           Bull HN Information Systems Inc. ==
      == (508) 294-3484              300 Concord Road         MS 820A ==
      == sje@xylos.ma30.bull.com     Billerica, MA 01821          USA ==
"That Government which Governs the Least, Governs Best." -- Thomas Jefferson
From: lsr@taligent.com (Larry Rosenstein)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How to turn File Sharing on?
Date: 13 Apr 92 18:32:22 GMT
Organization: Taligent, Inc.

In article <1992Apr10.175811.7669@cc.umontreal.ca>, casgrain@ERE.UMontreal.CA
(Casgrain Philippe) writes:
> 
> 
> 	I would like to know how to turn file sharing ON or OFF, not by
> using the Control Panel, but from within an application.

See Tech Note 305.
--
Larry Rosenstein
Taligent, Inc.
lsr@taligent.com
From: jth@acpub.duke.edu (JASON HOLTZAPPLE)
Newsgroups: comp.sys.mac.programmer
Subject: Symantec FTP Site
Keywords: Symantec, Think C, ftp
Date: 9 Apr 92 23:12:09 GMT
Organization: Duke University; Durham, N.C.

Thanks to all of you who let me know that Symantec's ftp site is at

ics.uci.edu
in the mac/thinkc directory

This info should be useful since I didn't see it in the FAQ.
-Jason Holtz



-- 
| ****  Jason Holtz                      jth@acpub.duke.edu  ***** |
| ****  "And the knowledge that they fear is a weapon to be  ***** |
| ****           used against them" - Rush,  1982            ***** |
Newsgroups: comp.sys.mac.programmer
From: dsb@mbunix.mitre.org
Subject: Problem with PBHGetFInfo
Keywords: PBGetFInfo
Organization: The MITRE Corporation
Date: Mon, 13 Apr 1992 12:46:22 GMT

Can anyone think why this returns -43 (file not found)

	gMultiFiles[index]->parID  is 1610667778
	gMultiFiles[index]->vRefNum is 0
	kFSAsynch is true
----
	HFileParam		fpb;

	/* prepare a hParamBlock */
	fpb.ioCompletion = nil;
	fpb.ioFVersNum = 0;
	fpb.ioFDirIndex = 0;
	fpb.ioNamePtr = CtoPstr(gMultiFiles[index]->name);
	fpb.ioVRefNum = gMultiFiles[index]->vRefNum;
	fpb.ioDirID = gMultiFiles[index]->parID;	
	err = PBGetFInfo(&fpb,!kFSAsynch);

when this get s info on the file.  (I want to use this so I can look at files
in different directories)

	FileParam		fpb;

	fpb.ioCompletion = nil;
	fpb.ioFVersNum = 0;
	fpb.ioFDirIndex = 0;
	fpb.ioNamePtr = CtoPstr(gMultiFiles[index]->name);
	fpb.ioVRefNum = gMultiFiles[index]->vRefNum;
	err = PBGetFInfo(&fpb,!kFSAsynch);