HDTenEightyP/NetNews huggingface dataset:
From: lai@Apple.COM (Ed Lai)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Claris Apple Events
Date: 20 Nov 92 17:42:11 GMT
Organization: Apple Computer Inc., Cupertino, CA

In article <1992Nov19.030657.9662@cs.cornell.edu> dawson@cs.cornell.edu (Dawson Dean) writes:
>
>   I want to send an apple event to several third party programs,
>particularly some of Claris' programs (MacWrite, FileMaker, etc.).
>I looked through the Apple Events Doirectory on ftp.apple.com,
>but all that lists is the core events and the QuickDraw events.
>
>Does Claris publicize these things? I`ve seen demos where their
>programs work closely together, so there is an extensive set of
>Apple Events, but do they tell developers about these?
>

In general applications that supports Apple Events would publish the
event they supported in an aete resource. A number of scripting system
would parse the aete resource to use the information. Look in ftp.apple.com in
/pub/appleevents for ResEdit template for the aete resource (only work
if the resource is small), HyperCard aete editor stack to read the aete
resource, and Apple Event XCMD stack to talk from HyperCard to such
application using the aete information.

/* Disclaimer: All statments and opinions expressed are my own */
/* Edmund K. Lai                                               */
/* Apple Computer, MS37-UP                                     */
/* 20525 Mariani Ave,                                          */
/* Cupertino, CA 95014                                         */
/* (408)974-6272                                               */
zW@h9cOi
From: Chewy@cup.portal.com (Paul Frederick Snively)
Newsgroups: comp.sys.mac.programmer
Subject: Why blat won't work on some machines
Date: Mon, 23 Nov 92 13:00:21 PST
Organization: The Portal System (TM)

re: why Blat won't work on IIci et al...

I suspect, but have not verified this with Bo3b Johnson, that Blat won't work
on any machine that support infernal [sic] video, because the use of infernal
video causes the machine's memory to get remapped such that part of your RAM
becomes `video RAM' that doesn't `belong to the system,' per se.

As someone who has had occassion to try to write PMMU code on the Mac before
in a previous life, let me tell you, I can understand why someone wouldn't
want to try to remain compatible with something else mapping memory out from
under you, and for those of you who don't know him, trust me; Bo3b Johnson is
a brilliant dude (read: if he ain't tackling it, I'm not about to).

Paul Snively
Former DTSoid
Newsgroups: comp.sys.mac.programmer
From: reuven@athena.mit.edu (Reuven M. Lerner)
Subject: Sockets under Think C
Reply-To: reuven@the-tech.mit.edu
Organization: Massachusetts Institute of Technology
Date: Mon, 23 Nov 1992 05:15:19 GMT

Has anyone written a library that implements Unix sockets in Think C
5? I'm trying to port some software to Think C, and it would be much
easier if I didn't have to muck around with MacTCP. I have some glue
routines that might make it easier, but I'd prefer to be able to
#include a file that would just let me use sockets directly.

(I thought that I had posted this before, but it doesn't seem to have
shown up at my site. My apologies if you've seen this before.)

Reuven
Newsgroups: comp.sys.mac.programmer
From: leonardr@netcom.com (Leonard Rosenthol)
Subject: Re: Finder "kind" string
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Thu, 19 Nov 1992 01:01:43 GMT

In article <1992Nov18.213458.20149@netcom.com> mspace@netcom.com (Brian Hall) writes:
>How can you get the string that the finder displays as the file "kind"?
>
>For example, the finder displays "TeachText document" in the kind column
>for a text document with TeachText for a creator.
>
	You basically can't.  You have to build your own list of "common kinds"
and then if it isn't one of those use the DTDB to find the application that
created it and concat (internationally correctly of course!) "document" to it.

	Also note that future Finder's may not display the same "kind" fields
currently displayed or that the "kinds" displayed could be more specific like
"StuffIt archive" or "StuffIt Translator" rather than just "StuffIt document".

-- 
-----------------------------------------------------------------------------
Leonard Rosenthol			Internet: 	leonardr@netcom.com
Director of Advanced Technology		AppleLink:	MACgician
Aladdin Systems, Inc.			GEnie:		MACgician

Newsgroups: comp.sys.mac.programmer
From: russotto@eng.umd.edu (Matthew T. Russotto)
Subject: Re: Volume Type?
Date: Tue, 17 Nov 92 23:34:16 GMT
Organization: Project GLUE, University of Maryland, College Park

In article <keith-171192142009@kip-16.taligent.com> keith@taligent.com (Keith Rollin) writes:
>In article <hassan.722027702@informatics>, hassan@wupost.wustl.edu (Scott
>Hassan) wrote:
>> 
>> Does anyone know how to tell whether a particular volume is a CD-ROM
>> drive?
>
>If I can stick a CD-ROM into it and it can read it, it's a CD-ROM drive.

A little more seriously, check the drive queue, and see if it's
removable and read only. If it is, and it's also BIG, it's probably a
CD-ROM.

-- 
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: creiman@netcom.com
Subject: Re: Whip me, beat me, what to do with DISCIPLINE?
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Date: Fri, 20 Nov 1992 22:55:17 GMT

rla20@duts.ccc.amdahl.com (Roger Allen) writes:

>In article <1992Nov19.180531.4442@netcom.com> creiman@netcom.com writes:
>>   try your app under EvenBetterBusErr, Xap handles, Blat, or heap 
>>   scrambling. Unlike Discipline, these have all proven their worth.
>>   (Leaks is pretty good too).
>>
>>Chao,
>>
>>Charlie.

>What are Xap and Blat?  I haven't heard of these before.

Xap clears handle and pointer blocks to bus error values when
disposed.  It's handy for catching references to freed structures.
Unfortunately, it doesn't pre-clear freshly allocated blocks to bus
error values; which is handy for catching improperly initialized
structures. If you use private glue to call the system's memory
manager, you can write these utilties into your app for development,
then strip them out when release time comes around.

Blat uses protected memory mode of the MMU to protect the low level
vectors.  Basiclly, a fool-proof EBBE. This power has a price: you
can't use VM with it.

Have fun,

Charlie.

-- 
Charlie Reiman
creiman@netcom.com
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.apps,comp.lang.fortran,comp.os.ms-windows.programmer,comp.os.ms-windows.apps
From: garrett@me.udel.edu (Joel J. Garrett; Office 127 CMSL; Phone 831-2332)
Subject: Can you call F77 subroutines from MS Excel?
Followup-To: comp.sys.mac.programmer
Keywords: fortran excel mac ms-windows
Organization: University of Delaware
Date: Mon, 16 Nov 1992 22:55:15 GMT

How difficult would it be to interface a set of existing FORTRAN subroutines
to an Excel Spreadsheet?  Is it possible to somehow include a compiled set of
subroutines and/or functions in an Excel spreadsheet or add-in that could be
called using the regular '=function(arg1,arg2,arg3,...)' convention.  I think
that I recall reading something about being able to call code in DLLs from the
Windows version of Excel (and the MS Fortran compiler now can produce DLLs,
right?), but I mainly need to be able to do this using a Macintosh-based FORTRAN
compiler and Excel.  The reference section of the Excel manuals lists a few
hooks that are supposed to be used for external functions, but they really don't
give any examples or the like, at least not as far as I can see.

Suggestions regarding which FORTRAN compiler would work best for this (on
either platform, Windows or Mac) and how to actually pull it off (if it is even
possible) would be greatly appreciated.  Examples of how to do this in Think C
or Borland C++ would be helpful if it would be possible to extrapolate these
into Fortran solutions.

Please respond via email, I will post a summary if there is interest...

Thanks!
Joel
(garrett@me.udel.edu)
From: jmatthews@desire.wright.edu
Newsgroups: comp.sys.mac.programmer
Subject: Re: THINK Pascal Misconceptions (was Re: Summary: THINK Pascal...)READ/NEW
Date: 20 Nov 92 00:26:22 EST
Organization:  Wright State University 

In article <Bxy4ty.B84@world.std.com>, siegel@world.std.com (Rich Siegel) writes:
> In Kurisoto's summary of responses to his problem (one of which is mine)
> he quotes several of his respondents, some of whom provide advice which
> is half-baked at best.

>>(Person E wrote)
>>> TP does several things for you in the runtime environment: local (stack)
>>> vars are initialized to zero; your explicit stack and memory allocations
>>> get set up; there are lots of subtle differences having to do with TP
>>> sitting between you and the system; your code executes in a heap zone
>>> in TP's heap zone; etc.
 
> Mostly wrong. Local variables are not initialized to zero. Either under the
> environment or standalone, local variables, except for arguments passed
> in, will contain whatever random junk happens to be in the portion of
> memory which corresponds to the link frame that you're using.

As Persons C, E and G, I'll have to claim two outta three ain't bad:-)
Rich is right; local vars are not initialized. I must have eaten some
half-baked space-potatoes or forgotten my heavy boots and floated away:-)

o----------------------------------------------------------------------------o
| John B. Matthews, jmatthews@desire.wright.edu, disclaimer:= myViews <> WSU |
|      "Whom the gods would destroy, they first invite to program in C"      |
o----------------------------------------------------------------------------o
From: lari@chopin.cs.unc.edu (Humayun Lari)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Reading in jpeg compressed PICT files
Date: 19 Nov 92 01:58:15 GMT
Organization: The University of North Carolina at Chapel Hill

In article <1e0t96INN7ac@terminator.rs.itd.umich.edu> krk@oit.itd.umich.edu (Kenneth Knight) writes:
>In article <1992Nov12.192450.17388@husc3.harvard.edu> crevier@husc8.harvard.edu (Daniel Crevier) writes:
>>I tried just loading a picture into 
>>a CWindow using the source from tech note 152, and it crashes when doing the
>>DrawPicture call.  Will this not work with JPEG pictures for some reason?
>>[rest deleted]
>
>I'm not sure this will answer your question,but here goes. You will have to
>work with QuickTime.
>[QuickTime info deleted]

You should not have to use QuickTime routines to simply draw a PICT file of
any kind, even if QuickTime routines have been used to compress the file.
DrawPicture should work fine as long as QuickTime is installed.

It would help if you provided some information about the kind of crash. I
assume you're using the TCL; try calling SetAllocation(kAllocCanFail) before
the DrawPicture call and see if that helps -- CopyBits might be requesting
lots of memory, and that makes the TCL *very* unhappy. You need to restore the
previous allocation setting afterwards, of course.

Humayun Lari
(lari@cs.unc.edu)
From: liran@bimacs.BITNET (Eshel Liran)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How do you make a master disk?
Date: 17 Nov 92 17:11:55 GMT
Organization: Math department, Bar-Ilan University, Ramat-Gan, ISRAEL

I know a few companies which protected their master disk by making a
hole in it, using a laser beam. I think it costs the developer about
1$ per disk, and I don't think it can be copied.

Liran Eshel
Bar-Ilan Univeristy, ISRAEL
liran@bimacs.cs.biu.ac.il



Newsgroups: comp.sys.mac.programmer
From: wolfmc@rtsg.mot.com (Michael Wolf)
Subject: Scrollbars in ModalDialog, how to?
Organization: Motorola Inc., Cellular Infrastructure Group
Date: Thu, 19 Nov 1992 19:20:50 GMT

I have a dialog which I have some scrollbars in.  I have the CNTL
resources as well.  All was done in ResEdit.

I have my own dialog filter proc.  I was wondering, should I handle
all of the scrollbar interaction in my filter proc?  If I don't
the standard filter proc will do the TrackControl when in the thumb and
up/down arrows, but what about the page up/down areas?

So I was wondering what the correct way to handle this is, I want to make
sure I follow all the nice guidelines from Apple (ie:  should I handle
it or let the dialog manager it for me).

Thanks

MJW

-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-
| Michael J. Wolf          | McIntosh Jr:  The power to crush the other kids|
| Software Engineer        |                                                |
| wolfmc@green.rtsg.mot.com|      Disclaimer?  Hell, I don't even know her! |
-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-
From: Scott.M.Silver@dartmouth.edu (Scott M. Silver)
Newsgroups: comp.sys.mac.programmer
Subject: Where is the FAQ?
Date: 21 Nov 92 23:35:58 GMT
Organization: Dartmouth College, Hanover, NH
X-Posted-From: InterNews1.0b1@newshost.dartmouth.edu

Don't flame me for this one....I've looked through all the current
availible articles and cannot find the FAQ.  Thanx.


Scott Silver
Newsgroups: comp.sys.mac.programmer
From: pvl1779@usl.edu (Leach Phuong V)
Subject: Movies.h
Organization: University of Southwestern Louisiana
Date: Tue, 17 Nov 1992 23:53:33 GMT

Can someone tell me where I can get the Movies.h file for use in Think C?
Thanx,
Robb
From: bowman@reed.edu (BoBoRamDos)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Floating Point to String Conversion
Keywords: International, Worldwide
Date: 21 Nov 92 00:16:58 GMT
Article-I.D.: reed.1992Nov21.001658.22424
Organization: Reed College, Portland, OR

In article <357@snll-arpagw.llnl.gov> ejfried@snll-arpagw.llnl.gov (friedman_hil
l ernest j) writes:
>Question: It seems like it is now possible to do floating point number ->
>text string conversion using system software instead of sprintf.

Here's what I use:

void ExtendToText(Str255 *outch,extended realNumber)
{
        short index=0;
        decform theForm;
        decimal theDecimal;

        theForm.digits = fFieldLength;

        switch (fOutputType) {
                case fixed:
                        theForm.style = FIXEDDECIMAL;
                        break;
                case scientific:
                        theForm.style = FLOATDECIMAL;
                        theForm.digits++;
                // FLOATDECIMAL sucks 1 digit to the left of the dec point
                        break;
        }


        num2dec(theForm,realNumber,theDecimal);
        dec2str(theForm,theDecimal,(char *) outch);
        c2pstr((char *) outch);
}

cheers,
bobo              In seeking the unattainable,
bowman@reed.edu            simplicity only gets in the way.
A geek, by any other name...
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: best way to pause in app ?
Organization: Kalamazoo College
Date: Fri, 20 Nov 1992 18:56:55 GMT

weiser@pogo.den.mmc.com (Matt Weiser) writes:
>brownlow@informix.com (Keith Brownlow) writes:
>> 
>> Is there a toolbox command to make the application wait x number of seconds
>> before continuing processing ?
>
>PROCEDURE Delay (numTicks: LONGINT; VAR finalTicks: LONGINT);

Help stamp out _Delay!

Or at least, stamp it out if there's a better way to do things.  _Delay
grabs the CPU and doesn't let any other app have any time.  If you meet
two conditions, you can be much friendlier:  (1) your delay period is
longer than two or three ticks, and (2) it's not absolutely 100%
essential that you make it back right on time.

If those conditions apply--and I think they will, because you implied
you'll be waiting at least one second, and you're probably not writing
for a hospital--try code like the following:

void betterDelay(short nTicksToDelay)
{
   long lastTick = TickCount();
   while (nTicksToDelay > 3) { // the lower this number, the friendlier
         // give time to other apps
      EventRecord myEventRec;
      Boolean needToHandleEvt;
      needToHandleEvt = WaitNextEvent(0, &myEventRec,
         Max(nTicksToDelay - 5, 0),
         NULL);
      nTicksToDelay -= TickCount() - lastTick;
      lastTick += nTicksToDelay;
   }
   while (TickCount()-lastTick < nTicksToDelay) {
      // wait in a tight, unfriendly loop
   }
}

I know some gurus will be able to improve on this.  For example, if your
app is getting update events and you're not responding to them, then
no other app will get time anyway.  Plus, it's not a good idea to lock
out suspend/resume events, because if another process brings itself to
the front, you'll be suspended without your knowledge.  But if you don't
have any update events pending when you call this, you stand a very good
chance of being excellent to your fellow apps.  And a good chance is
better than none.
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 My contribution to urban blues...
Newsgroups: comp.sys.mac.programmer
From: fixer@faxcsl.dcrt.nih.gov (Chris Spiral Catfish Tate)
Subject: Re: SpInsideMacintosh & wierd window
Reply-To: fixer@faxcsl.dcrt.nih.gov
Organization: Computer Systems Laboratory, DCRT, NIH
Distribution: comp.sys.mac.programmer
Date: Tue, 17 Nov 1992 17:04:06 GMT

In article <ALESKINE.92Nov16220557@cardhu.cs.hut.fi>, aleskine@cs.hut.fi (Arto Leskinen) writes:
>Is SpInside Macintosh available on ftp?
>
>I had problems that my srollbars were shorter than window, the line was still
>drawn all the way trough window. I tried to set clip region smaller but still
>( before I use DrawGrow())
>something draws those dam lines. What's worse, if I run my window under
>Think C debugger, the clipping works, but something eases my drawings off.
>If I run separate program, my drawings will stay, but clipping does not work.
>When window is drawn, the lines next to scroll bars are there. If I resize
>the window, sometimes the lines disappear, somethimes the old line parts
>stay on window and new ones will be drawn??

DrawGrowIcon() is what draws those lines.  You need to adjust the clipping
of the window immediately before that call, and then put it back when you've
drawn the grow box.

An alternative is to use a small icon of your own in the shape of the grow
icon, and use CopyBits() to put it on the screen directly, and never call
DrawGrowIcon() at all.  This is a good solution if you have something in
your window that doesn't use scroll bars, but is still resizable (such as a
picture that can be scaled to arbitrary sizes).  If you take this approach,
you'll have to explicitly draw any line segments yourself if you want them.

------------------------------------------------------------------------------
Christopher Tate             | The Leadfoot Collection, Continued:
Management System Designers  |        * Red Barchetta (Rush)
                             |        * Old Time Rock And Roll (Bob Seeger)
fixer@faxcsl.dcrt.nih.gov    | Because driving fast is a cathartic experience.
Newsgroups: comp.sys.mac.programmer
From: frantzen@nosc.mil (Louise E. Frantzen)
Subject: Strange things afoot with SndPlay
Keywords: SndPlay sound THINK C Sound Manager
Organization: Naval Ocean Systems Center, San Diego, CA
Date: Tue, 17 Nov 1992 21:17:57 GMT


Hello everyone, 

I am wondering if someone can explain to me why the following call to SndPlay   is not
working.  I am programming in THINK C 5.0 on a IIci running 7.1.  The following
is a part of my program.

main()
{
SndChannelPtr chan_ptr;
SoundHeader Header;
Handle GaussHndl;
OSErr myErr;
 other generic declarations as needed in program

 GaussHndl = NewHandleClear(442);

 calculations for 400 bytes of sound data

 myErr = SetupSndHeader(GaussHndl, NUM_CHANNELS,SAMPLE_RATE,SAMPLE_SIZE,COMP
	BASE_FREQ,400,HEADER_LEN_PTR);
 
 code to put 400 bytes of sound data starting at *(*GaussHndl + 42) = 1st data
 (which I've checked and everything gets put in its proper place)

 iRsrc = UniqueID( 'snd ');
 AddResource( GaussHndl, 'snd ', iRsrcID, "\pGaussian Noise" );

 MoveHHi (GaussHndl);
 HLock (GaussHndl);
 myErr = SndPlay( nil, GaussHndl, TRUE );  /* program BOMBS right here */
 HUnlock (GaussHndl);

 DisposHandle( GaussHndl);
 } /* end */

 My question is why does SndPlay not behave? According to IM VI p. 22-35, 
 this is all I should have to do to play a sound resource.  I have tried 
 other options which do not make the program bomb directly but don't play
 the sound, either.  Many times the program won't bomb, say if I've allocated
 my own channel instead of passing SndPlay nil, but then I try to run it 
 again and get "Out of memory" error from THINK C or even a system error.  

 I am really getting to the end of my inventiveness, here, even after looking
 at all the sample code I can get my hands on. Please help!

-------------------------------------------------------------------------
-- 
Louise E. Frantzen NRaD, San Diego CA 	"And if you try to cut me down
frantzen@nosc.mil		 	 I know that you'll succeed "
(619) 553-7863					- A. Lennox
From: bredell@tdb.uu.se (Mats Bredell)
Subject: Re: Determining modifier key status without an event record
Reply-To: Mats.Bredell@udac.uu.se
Organization: Uppsala University Computing Center (UDAC)
X-Newsreader: TIN [version 1.1 PL6]
Date: Fri, 20 Nov 1992 09:02:40 GMT

Sean J. Crist (kurisuto@chopin.udel.edu) wrote:
: The orthodox method of determining the status of the modifier keys is
: by looking at an event record.  The modifier bits are even set correctly
: for null events, so within the event loop, it is always possible to
: determine the status of the modifier keys.
: 
: However, I need to find the status of the modifier keys in contexts
: where no reliable event record is available.  Specifically:
: 
: 1.  I want to know what the status of the modifier keys at the earliest
:     possible moment when the application starts up.  I have an optional
:     short-cut which is invoked if the user holds down the command key
:     when starting the application.

I don't know about this one, except for testing the very first event you get.

: 2.  I want to know what modifier keys are down when the user has selected
:     something from a menu.  The original mousedown event in the menu
:     bar is not a reliable source, because the user might have pressed
:     the mod keys after clicking the mouse and while viewing the menus.
:     (I have another shortcut which I want to invoke if the user holds
:     down certain modifier keys while making certain menu selections).

A lot of programs behave differently if you hold down a certain modifier key
while selecting from the menu. However, you should also change the menu item
title when this happens. I've never seen a program that lets you press the
modifier *after* the original menu click. Why not require that the user is
holding the modifier key when he makes the click in the menubar?

: Is there some way to find out the status of the mod keys in these contexts?
: If the answer is something really risky and unsupported, I'd be more
: inclined just to scrap these shortcuts, but I'd like to make them
: available if it's possible.

/Mats
-- 
Mats Bredell                                   Mats.Bredell@udac.uu.se
Uppsala University Computing Center (UDAC)     Ph:  +46 18 187817
Department of medical systems                  Fax: +46 18 187825
Sweden                                         Think straight - be gay!