HDTenEightyP/NetNews huggingface dataset:
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: &StringPtr -vs- StringPtr?
Organization: Kalamazoo College
Date: Fri, 22 Jan 1993 22:09:40 GMT

joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91) writes:
>damurphy@wc.novell.com (Duane Murphy) writes:
>>
>>I have received some code...  The MPW compiler says nothing, but
>>Think C whines about types not matching.  Here is where the problem is:
>>
>>	Str255	msg1, msg2;
>>	GetIndString(&msg1, errResID, errStringIndex);
>>
>>The problem is &msg1.  The prototype for GetIndString is:
>>(from ToolUtils.h)
>>
>>pascal void GetIndString(Str255 theString,short strListID,short index); 
>>
>>I have changed the call to:
>>
>>	GetIndString(msg1, errResID, errStringIndex);

The short explanation:  you're right.  "Str255 msg1" is exactly the same
as "unsigned char msg1[256]", so you're passing an array.  When you want
to do that in C, just put down the array name.

>Try someting like this (it works for me)
>GetIndString((ConstStr255Param) msg1, ......

This shouldn't be necessary...

>Also, note that because msg1 is technically an array of chars, 
>msg1 is the address of the first element, and &msg1 has no real
>meaning (thoug usually is interpreted as just &msg1[0], or msg1).

Well, "&msg1" does have a well-defined meaning.  The expression "msg1"
does have the type "pointer to unsigned char," and is equivalent to
the more-logical-looking "&msg1[0]".  But "&msg1", while it points to
the same place, has the type "pointer to array of 256 unsigned chars."
That's not the same thing.

I would guess that, in this case, ThC had strict pointer type-checking
on and MPW did not.  Or, maybe MPW forgives this particular mismatching
of pointers (pointer to array of T instead of pointer to T), though I
would be surprised if that were the case.

To quote gospel at you:  "If the type of an expression or subexpression
is 'array of T,' for some type T, then the value of the expression is a
pointer to the first object in the array, and the type of the expression
is altered to 'pointer to T.'  This conversion does not take place if
the expression is the operand of the unary & operator, or of ++, --,
sizeof, or as the left operand of an assignment operator or the .
operator."  (K&R, 2nd ed., A7.1, p. 200.)  So, "msg1" by itself is a
pointer to unsigned char;  "&msg1" is a pointer to an array of 256
unsigned chars;  "sizeof(msg1)" returns the size of the array instead of
the size of a pointer;  "++msg1" increments the pointer 256 bytes
instead of one, and so on.  Ain't C grand?

>I would say that if you passed msg1 (not &msg1), it SHOULD accept it.
>I believe I usually must cast in that situation as well, though.

I don't think so.  At least, I don't have to, and I keep ThC on its
strictest type-checking.
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "A degree in Computer Science from Berkeley didn't much qualify me to uphold
  the banner of Chaos against the forces of Order."              - R. Zelazny
From: mgleason@cse.unl.edu (Mike Gleason)
Newsgroups: comp.sys.mac.programmer
Subject: Think C & #pragma parameter (was: help calling assembly from C)
Date: 25 Jan 1993 03:10:51 GMT
Organization: NCEMRSoft
Distribution: usa
NNTP-Posting-Host: cse.unl.edu

keith@taligent.com (Keith Rollin) writes:

|You came really close to answering your own question. You know that there
|are Mac OS functions that work like this, so why don't you declare your
|function the same way they are? For instance:

|#pragma parameter DisposePtr(__A0)
|pascal void DisposePtr(Ptr p); 

|This is an example of a function that simply takes a parameter in A0.
|Here's a more complex example:

|#pragma parameter __D0 HoldMemory(__A0,__A1)
|pascal OSErr HoldMemory(void *address,unsigned long count); 

Well, I found out the hard way awhile back that this doesn't work like one
would expect in Think C 5.  Think C's #pragma parameter only works on "sub-
sequent inline function definitions" (p. 194 of the manual).  So in Think C,
you can't really use this for your own functions unless you bother with crap
like "void foo(void) = { 0x4e71, 0x4e71, etc... };"  I wouldn't mind if Think
C required the whole function to be in gazzembly, but accepting only raw hex
is unacceptable.

--
______________________________________________________________________________
mike gleason                 mgleason@cse.unl.edu             NCEMRSoft, baby!
Newsgroups: comp.sys.mac.programmer
From: aleskine@cs.hut.fi (Arto Leskinen)
Subject: Two byte chars
Organization: Helsinki University of Technology, Finland
Distribution: comp.sys.mac.programmer
Date: Fri, 22 Jan 1993 22:08:32 GMT

I am trying to do text edit package that is fully script manager compatible.
The problem I am having is with double byte chars. Should I get two key down
events when writing with Japan script(alpha) + 7.1. I only get first byte
and then nothing. Also if I write many chars, I only get one key down event.

Is there any example how to handle arrow keys and cursor when there are mixed
scripts with mixed writing directions. Can I trust, that double byte scripts 
left to right?

Any ideas? Thank you!=>
Arto Leskinen
aleskine@cs.hut.fi
Newsgroups: comp.sys.mac.programmer
From: mhall@occs.cs.oberlin.edu (Matthew Hall)
Subject: Re: "GLOBAL System Variables", Help!!!
Organization: Oberlin College Computer Science
Date: Mon, 25 Jan 1993 13:55:13 GMT
X-Posted-From: occs.cs.oberlin.edu
NNTP-Posting-Host: sol.ctr.columbia.edu

In article <C1CAAv.9Hu@news.udel.edu> lecates@bach.udel.edu (Roy LeCates) writes:


>   >Does anyone know how to write/read Global variables in THINK Pascal ?
>   >I have an address of CurActivate ($0A64) and size (4).
>   >Think Reference says that it's a "Global Variable", but
>   >when I tried to use it in Pascal it says "unknown indef.".
>   >" MyWindow := CurActivate; "

First, All lo-mem globals are defined in the Interfaces file SysEqu.p
which should be in your ThinkPascal::Interfaces.  Just dump it in your
project and add it to Uses.  It won't add to your code size (it's all
constants), and once it's built it shouldn't have to be rebuilt, so it
wont add compile time.

Second, I believe that you can just type
MyWindow:= WindowPtr(ptr(CurActivate)^);

You may have to declare a type LongPtr = ^Longint; and substitute that
for the ptr.

Hope this helps,
-matt hall

--
-------------------------------------------------------------------------------
Matt Hall.    mhall@occs.oberlin.edu  OR  SMH9666@OBERLIN.BITNET
              (216)-775-6613 (That's a Cleveland Area code. Lucky Me)

                         F(X)=M*X*(1-X)  

Newsgroups: comp.sys.mac.programmer
From: tom@dtint.uucp (Thomas R. Kimpton)
Subject: Re: MacTCP - getservbyname code, anyone?
Organization: Digital Technology, International
Date: Fri, 22 Jan 93 18:53:07 GMT

I've thought, and I'm sure others have, about writing an "inetd"
program for the mac that would provide services on the mac.  It
would have a services file that had the service name, protocol
(UDP/TCP), port number, and program to launch.  However, I came
across a major snag:  When you create a MacTCP stream you have
to give it a buffer for input buffering.  There is no provision
for replacing the existing buffer with a new one. This means that
if I want to have my program setting on a port, then hand that
port to another program, the memory buffer will come from
my heap, and if I quit, the buffer I handed off with the
stream is no longer valid.  While it's possible to do, it wouldn't
be convenient, as MacTCP's minimum buffer size is 4K (I'm not
sure if this is recommended or mandatory) and some protocols
suck wind if they have such small buffers, but with 64 streams
available, the partition size for this program would really
crank up in size for a program who's sole purpose is to had off
connections to other programs.  Again, it would be possible to
create streams for specific ports, with appropriate buffer sizes,
but it wouldn't be general enough.  The most general approach
involves listening at port 0, host 0.0.0.0 as this catches
incoming connections on any port, from any host.  But with
no provision for resizing the input buffer ....

Tom.


-- 
---
Tom Kimpton                            tom@dtint.dtint.com
Digital Technology Int.                (801)226-2984	
500 W. 1200 South, Orem UT, 84057      FAX (801) 226-8438
From: mike.kopp@gtri.gatech.edu (Mike Kopp)
Newsgroups: comp.sys.mac.programmer
Subject: serial port Q
Date: 21 Jan 93 20:56:32 GMT
Followup-To: comp.sys.mac.programmer
Organization: Georgia Tech Research Institute

I am looking at writing a program that will do some simple serial
communications through the modem port.  Can anyone recommend any sample
code?

-----------
Mike Kopp                                    
Electronic Support Measures Laboratory   	       
Georgia Tech Research Institute 	       	       	mike.kopp@gtri.gatech.edu
From: gjw2824@hertz.njit.edu (Greg Weston)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Serial Drivers -- Please Help
Date: 22 Jan 93 18:20:40 GMT
Organization: New Jersey Institute of Technology, Newark, N.J.

According to an issue of Symantec's newszine, Apple is officially no
longer supporting the 64K ROMs (this is old-ish, btw) and the proper
way to get at the Serial Driver now is with an OpenDriver call, using
the name of the driver you want to open. If you really want to use
RAMSDOpen, THINK C 5 still has the routine, but doesn't have the
prototypes. You basically need something like: OSErr
RAMSDOpen(SPortSel); if you;re requiring prototypes. Otherwise, it
should infer if you try to use it. I know I've used it without the pt.
	Greg
Newsgroups: comp.sys.mac.programmer
From: kendall@sound.music.mcgill.ca (Craig Kendall)
Subject: Clickless sound
Organization: McGill Research Centre for Intelligent Machines
Date: Wed, 27 Jan 93 21:53:36 GMT


Hi 

Can someone please send me a code example and/or an explanation of why I  
am getting an extremely audible click at the beginning of a sound when I  
try and play the sampled .snd resource.

I am using the standard synchronous SNDPLAY toolbox call with code copied  
directly from inside mac vol VI.

I seem to remember following a similar discussion on this topic here some  
months back.  If anyone can give me a point in the right direction it  
would be greatly appreciated.
--

Richard Parncutt
McGill University
Graduate Computer Music Lab
parncutt@music.mcgill.ca
From: eaeu209@orion.oac.uci.edu (Rodney G. Ramos)
Subject: Question on purchasing MPW
Newsgroups: comp.sys.mac.programmer
Organization: University of California, Irvine
Date: 23 Jan 93 08:32:18 GMT
Followup-To: comp.sys.mac.programmer

I've seen THINK C and Pascal for sale at educational
prices.

Does apple sell MPW at an educational price also?
Newsgroups: comp.sys.mac.programmer
From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
Subject: Re: Subverting the Think C Editor
Organization: NASA/ARC Information Sciences Division
Date: Wed, 27 Jan 1993 18:19:24 GMT

In article <1993Jan27.175926.18109@fcom.cc.utah.edu> Eric C. Kofoid <kofoid@bioscience.utah.edu> writes:
>> neath@brazil.psych.purdue.edu (Ian Neath) says:
>>> lind@ils.nwu.edu (Jeff Lind) asks:
>>> 
>in
>>> playing with THINK C lately I've been consistently dissapointed off by
>the
>>> weak editor.  It doesn't know anything about coding, really. I mean, it
>>> 
>>      Use CMaster from Jersey Scientific.  Excellent, robust, and
>>      Jersey Scientific
>>      545 Eighth Avenue 9th Floor
>>      New York, NY 10018
>>       Ian Neath        | There are four kinds of people in this world:
>
>Two other possibilities, the first $25, the second lots more:
>
>1. Alpha, by Pete Kehleher, available at your local archive. Pete
>2. ObjectMaster, from Acius. This is a commercial product costing in the 


I am seriously considering getting CMaster or ObjectMaster.
It seems to me that their functions overlap.  Which is better (in your
opinions?) - btw, I'm programming in TCL, if that effects the decision.

I would be very interested in user's experiences with the two products.
It seems objectmaster and CMaster are both heavily recommended.

If you prefer, you may email me, and I will summarize to the net.
thanks.

joshr@kronos.arc.nasa.gov
-- 
----------------------------------
#include <std/disclaimer.h>     Josh Rabinowitz, Mac TCL programmer
joshr@kronos.arc.nasa.gov
"Me lost my cookie at the disco." -- Cookie Monster
Newsgroups: comp.sys.mac.programmer
From: rmaag@iiic.ethz.ch (Rolf Maag)
Subject: setwindowpic
Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
Date: Thu, 21 Jan 1993 14:59:25 GMT

Hi there...

i have some questions about getwindowpic and setwindowpic.

so far, i have done all my updating the 'old fashioned' way,
using update events...
now, with my latest application redrawing would be awfully complicated...

does the system all the updating when a window picture is set?

and when i draw into the window, is the window picture updated automatically?

if anybody could send me some sample code showing me how to use
getwindowpic and setwindowpic, i'd be very happy.

thanx and regards Rolf
From: davidp@stealth.usc.edu (David Peterson)
Newsgroups: comp.sys.mac.programmer
Subject: SetDItem and control panels...
Date: 25 Jan 1993 13:37:24 -0800
Organization: University of Southern California, Los Angeles, CA
Distribution: world
Reply-To: davidp@usc.edu
NNTP-Posting-Host: stealth.usc.edu


Is it a no-no to use SetDItem on the user items you have in a control
panel to set them to a routine that draws them?

I was trying to do this so that my user items would get updated automagically,
but the Finder would crash about half the time when my control panel was
being updated.

Using the same code, but calling it myself in response to an update event,
seems to work. Whats the deal? I didn't see anything about this in any of
the technotes (or did I just miss it). 

Does cdev code not stay locked while the control panel is open? The Finder
only seemed to crash when I had done something else like open another app
or switch to a screen saver, just moving Finder windows on and off the control
panel worked okay.

I can draw the stuff myself if need be, I was just wondering if this behavior
is known, or if my code is screwed up.

Any hints?

-dave.
Newsgroups: comp.sys.mac.programmer
From: Les Aker
Subject: Re: Think Pascal & AppleEvents... ARGGGHHH!!!!!!
Organization: NRL Computer Security
Distribution: World
Date: Thu, 21 Jan 1993 19:55:20 GMT

In article <9302014.14929@mulga.cs.mu.OZ.AU> mtc@mundil.cs.mu.OZ.AU (Michael
Trevor CUTTER) writes:
>Gudday netters,
>
>I am trying to learn how to use Apple Events. I wrote my code dutifully, it
>compiled politely, and I added all the interface files and the AppleEvents.lib
>file to the project.
>
>But no matter what I do, I keep getting a link error :
>undefined: 'AEDF' (AppleEvents.lib)
>
>This is driving me nuts!!!!

I had this problem several months ago.  It was driving me crazy too.  I called
Symantic about it, & they told me to just remove the AppleEvents.Lib file from
the project.  It isn't needed!

I never have figured out why it was even included if it can't be used.

Les Aker
aker@hightop.nrl.navy.mil
From: delphi@media-lab.media.mit.edu (Andrew J. Kass)
Newsgroups: comp.sys.mac.programmer
Subject: Closing files at interrupt time
Date: 25 Jan 93 20:48:08 GMT
Article-I.D.: news.1993Jan25.204808.11120
Organization: M.I.T. Media Laboratory

I am writing a library of sound routines, but have recently run into a major
problem. I am playing files using SndStartFilePlay asynchronously. In the 
completion routine, I set my A5 to access my globals, get the fRefNum of the 
file I was playing, and then call FSClose to close the file. The problem is, 
every now and then, not at repeatable intervals, the machine will hang during that
call to FSClose. I can get into MacsBug and look at the stack to verify that it
is hanging during FSClose, but any attempt to exit to shell fails and I have
to reboot the machine. 

If you have any idea what is going on, I'd appreciate it!

Thanks

Andrew Kass
Speech Research Group
MIT Media Lab
delphi@media-lab.media.mit.edu
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@feffe.nada.kth.se (Jon Wtte)
Subject: Re: CPU load
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Thu, 28 Jan 1993 17:15:27 GMT

In <1993Jan28.081721.4191@netcom.com> cokenias@netcom.com (Damon Cokenias) writes:

>>foreground application. Currently, I just check to see how many null
>>events I get in 1 second (60 max right?) and then use the proportion  

>It makes sense when you think about it.  You wouldn't want your Quadra 950
>just passing time before letting an application receive a null event.  And
>you'd have a hard time getting 60 events per second on a plus.

However, the number of context switches is limited to 60/second,
which is a hindrance for fast responses to AppleEvent queries for
servers :-(

Cheers,

						/ h+
-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --

 -- I don't fear death, it's dying that scares me.
Newsgroups: comp.sys.mac.programmer
From: blob@gallant.apple.com (Brian Bechtel)
Subject: Re: WWDC 93
Date: Sat, 23 Jan 1993 04:11:22 GMT
Organization: Apple Computer Inc.

umdenbo0@ccu.umanitoba.ca (David A. Denboer) writes:

>Hi.  I was wondering when the World Wide Developers Conference was going to
>be.  I am going to be in SF for the NeXTWorld Expo in May, and if they were 
>around the same time, that would be HEAVEN!

May 10-14, at the San Jose Convention Center.  And yes, they are aware
that this start is the day after Mother's Day.  They are locked into
that date for the next two years... it's hard to schedule a room for
almost 5000 people...

--Brian Bechtel     blob@apple.com     "My opinion, not Apple's"
From: bezanson@vixvax.mgi.com
Newsgroups: comp.sys.mac.programmer
Subject: Re: Latest ObjectMaster Version?
Date: 28 Jan 93 09:03:08 CDT
Distribution: world
Organization: Management Graphics, Inc.

In article <1k3u5kINNr33@urmel.informatik.rwth-aachen.de>, Josef Goettgens <jg@techmech.itme.rwth-aachen.de> writes:
> Does anybody know what the latest version of ObjectMaster is?
> Or is this program already dead?  (I haven't heard anything 
> for about a year from the German distributor ACI.)
> 
> jg
> 
> --------------------------------------------------------------------------
> Josef Goettgens
> Institut fuer Technische Mechanik   Phone:  +49-241-804626
> RWTH Aachen                         Fax:    +49-241-20911
> Templergraben 64                    Email:  jg@techmech.itm.rwth-aachen.de
> W-5100 Aachen, Germany

I have Object Master 1.0.2, which was sent after I reported some bugs I had
found - this version is very stable and only has a few pre-compile error
messages that I'd like to see fixed. Version 2.0 has been announced and
talked about. It should come out in early spring/summer (when some other
cool tools also come out).

Brian R Bezanson
Management Graphics                   Phone: +1-612-854-1220
1401 E 79th Street                    Fax:   +1-612-851-6159
Minneapolis, MN 55425-1129            Email: bezanson@mgi.com

Newsgroups: comp.sys.mac.programmer,comp.sys.mac.system
From: kjt001@dunix.drake.edu (Devil Bunny!)
Subject: Think C 4.0.5 - Sys 7 Compatible?
Organization: Drake University, Des Moines, Iowa, USA
Date: Thu, 21 Jan 1993 19:26:06 GMT

Is Think C 4.0.5 system 7 compatible?  Whenever I go into it and run my
project (that ran fine in 6.0.7), it bombs...

Do I need to upgrade to 5.0? (more money I don't have...)


Please respond via email if possible...

Thanks!

-- 
|   Kevin Tieskoetter    kjt001@acad.drake.edu  kjt001@dunix.drake.edu    |
|                               Drake University
|          Des Moines, IA...Where men are men, women are scarce,          |
|                       And sheep are nervous!                            |
Newsgroups: comp.sys.mac.programmer
From: Michael Hecht <Michael_Hecht@mac.sas.com>
Subject: Re: ATTN Apple employees who can help: Threads 2.0d17 does not work!
X-Useragent: Nuntius v1.1.1d17
Date: Sat, 23 Jan 1993 16:05:52 GMT
X-Xxdate: Sat, 23 Jan 93 16:07:08 GMT
X-Xxmessage-Id: <A786D75C1402050A@studly.mac.sas.com>
Organization: SAS Institute Inc.

In article <1993Jan22.014547.1@fnalo.fnal.gov> , gwatts@fnalo.fnal.gov
writes:
>There is also a free ware/share ware (I don't recal) out there that 
>provides the same functionality.  Unfortunately, I don't remember the 
>name of the damm package.  Perhaps someone will read this news and post 
>it.  You get the source with this package.  It doesn't support futures, 
>however.

That would be the Task Manager, which I wrote. It's free, and you can get
it from the umich or info-mac archives, among other places.

--Michael

=======================================================================
Michael P. Hecht                 | Internet:  Michael_Hecht@mac.sas.com
SAS Institute Inc.; Cary, NC USA | AppleLink: SAS.HECHT
Newsgroups: comp.sys.mac.programmer,comp.sys.mac.misc,comp.sys.mac.system
From: janee@world.std.com (Jane Eisenstein)
Subject: Re: APDA Mac Tech Notes subscriptions...
Organization: The World Public Access UNIX, Brookline, MA
X-Newsreader: Tin 1.1 PL3
Distribution: usa
Date: Tue, 26 Jan 1993 14:47:11 GMT

I haven't gotten any tech notes since the July 1992 ship either.  I
paid for a subscription good through January of this year.  Maybe
we're supposed to call APDA for a refund.

janee@world.std.com

Newsgroups: comp.sys.mac.programmer
From: walkerj@math.scarolina.edu (Jim Walker)
Subject: Is the Finder's name always "Finder"?
Organization: USC  Department of Computer Science
Date: 21 Jan 93 19:20:25 GMT


I see that Finder's name is locked (under System 7), but is that always the
name, even under foreign system software?  If not, what is the best way to
get the name?  (I know how to read it from the boot blocks, and I know that
there is a low-memory global FinderName, but I wonder if there is a better
way.)

--

 -- Jim Walker  USC Dept. of Math.  walkerj@math.scarolina.edu
From: pcw@access.digex.com (Peter Wayner)
Newsgroups: comp.sys.mac.programmer
Subject: Macintosh Doggles...
Date: 22 Jan 93 18:12:05 GMT
Organization: Express Access Online Communications, Greenbelt MD USA
NNTP-Posting-Host: access.digex.com

Does anyone know the location of a Macintosh Doggle 
Manufacturer? (Doggles are the little do-hickeys that
you connect to the computer to prevent piracy. The 
software polls the do-hickeys every once and a bit
to see if it is still there.) ADB bus doggles would
be better.

-Peter
From: edw@distant.uucp (Ed Watkeys)
Newsgroups: comp.sys.mac.programmer
Subject: how to launch anything, like the Finder does...
Date: Sat, 23 Jan 93 16:54:55 EST
Organization: Distant Software
Reply-To: edw@distant.uucp
X-Mailer: uAccess - Macintosh Release: 1.6v2

I would like to have a program I'm working on launch everything inside of
a folder, exactly the way the Finder does when it starts up. Is there a
way to do this that doesn't involve hundreds of lines of code? Can I use a
Finder Apple event to do somthing like this? BTW, when I say "everything,"
I mean everything, including sounds, etc. This seems to be a job for Finder
events, the more that I think about it...

Ed

--
Edwin H. Watkeys III                                   edw@distant.uucp
Distant Software                               dsinc!jabber!distant!edw
+1 215 387 7971                                     edw%distant@bts.com