HDTenEightyP/NetNews huggingface dataset:
From: kurisuto@chopin.udel.edu (Sean J. Crist)
Newsgroups: comp.sys.mac.programmer
Subject: Questions about referring to files
Date: 8 Jan 93 01:59:51 GMT
Organization: University of Delaware

Here's what I want to do:  My application saves all of its data in
resource files.  I want the user to be able to save and open these files
using SFGetFile and SFPutFile, as usual.  Also, I need to be able to open
temporary files in the System Folder when the user chooses 'New'; if the
user doesn't save this document, the temporary file will be deleted, but if
the user does save it, it will be copied into the appropriate directory.

My problem is this:  I've read the file manager chapters in IM I, IV, and
VI thoroughly, and I'm in the dark about which paradigm I should use to refer
to my files.  I want to support System 6.0.4 and higher; if I am not
mistaken, this means I can't use the FSSpec designation from System 7.  I
would have thought that a filename and vRefNum would be good enough, but I
recently saw a posting here on c.s.m.p. which I understood to say that
this way of designating files went out of fashion with System 3.2.
(I'm currently using OpenRFPerm to open my resource files, which seems to
be working fairly well.)

Second question:  System 6.x and System 7.x organize the System
Folder differently (well, System 6.x doesn't organize it at all :-).  Is
the correct way to handle temporary files to use Gestalt to see whether
the Temporary Items folder of System 7.x is available, and to store into
the main System Folder if not?  If anyone has or knows of some source code
in Pascal which stores temporary files in both System 6 and 7, I would
greatly appreciate seeing it.  (I'm not sure exactly how to locate the
System Folder or Temporary Items folder in either case.)

I'm also not certain how to move my temporary file out of the appropriate
directory into the one chosen by the user with SFPutFile.  If it's on
another volume I'll obviously have to copy it myself.  I believe System 7
has some way of easily moving files within one volume, but does System 6?
(If it's something too complicated, I'll just make a copy of the file and then
delete the original, briefly wasting a small amount of disk space.)

One last thing:  my application doesn't support Apple Events yet, but I
plan to add such support.  Does this constrain me to using a particular
file designation scheme, or can I just convert between FSSpec and an older
scheme as I need?  (Also, is there sample code anywhere illustrating how
to handle the core Apple events?)

Thank you very much.  If there is interest I will summarize and post.

--Kurisuto
Newsgroups: comp.sys.mac.programmer
From: wiltz@after (David Wiltz)
Subject: Re: Should we start using an installer?
Organization: University of Illinois at Urbana
Date: Sat, 9 Jan 1993 20:52:15 GMT

I also am looking to begin using an installer for the 
distribution of a keymapping, a few fonts, and many files
related to our courseware.

Can anyone direct me toward the format for creating an installer
script?

Any help, e-mail or post is most appreciated.

-Dave
--
   David Wiltz                                wiltz@after.math.uiuc.edu
   Calculus&Mathematica Development Team
   University of Illinois at Urbana-Champaign  NeXTmail always welcome!
-Doing business with the government is a lot like playing poker with God.-
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: moof?
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Mon, 11 Jan 1993 10:02:19 GMT

In <keith-100193235351@kip-28.taligent.com> keith@taligent.com (Keith Rollin) writes:

>In article <1993Jan10.052126.7014@cronkite.ocis.temple.edu>,

>> doesn't have an "Options" button.  Is that because I have a Personal
>> LaserWriter LS? (Hey I got it for $187 in an educational bundle, I am NOT

>Nope, I was the stupid one. Working in fancy-schmancy companies like Apple
>and Taligent, I forget that not everyone in the world has LaserWriters.

Well, he DID have a LaserWriter; only not a PostScript one.
That's sort of a customer support problem: "My <insert PostScript
program here> document doesn't work" "Well, you gotta print it
on a LaserWriter" "But it says right HERE it's a LaserWriter" ...

>At least everyone has Quadra 950's, right?

Of course. However, my friend the cleaner in that Texas plant
hasn't gotten a R601 to me yet; it's just a matter of time
though.

:-)

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
 Engineering: "How will this work?" Science: "Why will this work?" Management:
 "When will this work?"  Liberal Arts: "Do you want fries with that?"
                     -- Jesse N. Schell
From: danny@martha.utcc.utk.edu (Danny William McCampbell)
Newsgroups: comp.sys.mac.programmer
Subject: THINK C Primer Code Problem...
Date: 4 Jan 93 15:30:17 GMT
Organization: University of Tennessee Computing Center
X-Newsreader: Tin 1.1 PL3

Hi all.  Over the weekend I was typing in some of the programs from
the Macintosh Programming Primer for THINK C.  Well, I got the ones
I type in to work successfully except Mondrian.  If any of you are
familar with this small program, it simply draws a window on the 
screen and draws ovals at random positions within the window and fills
the oval with either black or white depending on what the last oval
was filled with.  Well, I double-checked the program and I know for
sure I typed it in just like the book.  When I try to run it gives me
a Link Error::Undefined Button.  I have never seen this error before.
Could someone give me some insight on this.  I ran precompile on it
and it says that blackColor is undefined in the statement

gFillColor = blackColor 

blackColor occording to IM Vol. 1 is a global all ready defined in the
ROMS.  What is happening here?  I have MacTraps in the project just to
let you know.

I am using a PB160 with System 7.1 with 4 megs of RAM.

Thanks in advance.

--
Danny McCampbell
UT Computing Center
danny@utkux1.utk.edu
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Help with Bitmaps
Date: 9 Jan 93 22:26:26 GMT
Organization: Royal Institute of Technology, Stockholm, Sweden

In <104096@netnews.upenn.edu> patchen@eniac.seas.upenn.edu (Michael Patchen) writes:

>I am programming in Pascal and I have a BITMAP and I need to coerce the bitmap
>into a PICTURE (via a pichandle, etc. ) which can be put in the clipboard and
>then brought into a word processing document, for instance.

You can't just "coerce" it; you have to make a picture
by drawing the bitMap and recording it into a pict handle.
Something like:

long
PutBitmapAsScrap ( BitMap * bitMap )
{
	long ret ;
	Rect r = bitMap -> bounds ;
	PicHandle h = OpenPicture ( & r ) ;

	if ( ! h ) {

		return MemError ( ) ? MemError ( ) : -108 ;
	}
	CopyBits ( bitMap , & ( thePort -> portBits ) , & r , & r ,
		srcCopy , NULL ) ;
	ClosePicture ( ) ;

	SystemEdit ( 1 ) ;	// This is really weird; but if you
				// haven't called SystemEdit already
				// when you get here, MultiFinder won't
				// see your new scrap!

	ret = ZeroScrap ( ) ;
	if ( ret ) {

		KillPicture ( h ) ;
		return ret ;
	}

	HLock ( ( Handle ) h ) ;
	ret = PutScrap ( GetHandleSize ( h ) , 'PICT' , ( void * ) * h ) ;
	KillPicture ( h ) ;

	return ret ;
}
-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --

   NCC-1701
Newsgroups: comp.sys.mac.programmer
From: wbridgm@hubcap.clemson.edu (William T. Bridgman)
Subject: Archiving projects in THINK C.  Any easy way to do it?
Summary: Archiving Projects in THINK C.  Any easy way to do it?
Keywords: THINK C, archive, source code
Organization: Clemson University
Distribution: usa
Date: Wed, 6 Jan 1993 21:10:43 GMT

I am currently working on a project in THINK C using objects.  The
project has become rather large and I find it convenient to archive
the source code before making another round of major enhancements.
This is easy enough when all your source code is in one folder but
gets much more complex when it is scattered among multiple folders
such as libraries of my own routines which are also still
undergoing revisions.  I would like to keep all of my own code that
operated together intact for this archive.  This makes it easier to
track down problems when revision n+1 suddenly doesn't work any
more and you've made major changes in a number of source files.

Does anyone out there know of an archiving program which can read a
THINK C project file and copy files from the folders of your choice
(I'm not really interested in copying the TCL or the standard
libraries) to another folder so they can be archived with something
like Compact Pro or other software?  For some reason I seem to
recall there was a program like this for THINK Pascal.

Thanks for any help you can provide.

Tom
-----------------------------------------------------------------------
|  William T. "Tom" Bridgman, M.S.   | wbridgm@hubcap.clemson.edu     |
|  Department of Physics & Astronomy |                                |
|  Clemson University                |"Black Holes under Construction.|
|  Clemson, SC   29634-1911          |       WATCH YOUR STEP!"        |
-----------------------------------------------------------------------
Newsgroups: comp.sys.mac.programmer
From: jimlynch@netcom.com (Jim Lynch)
Subject: Re: HOpenResFile and HOpenRF supported by glue in System 6?
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
Date: Sun, 10 Jan 1993 06:06:48 GMT

In article <C0Ltw3.FrH@news.udel.edu> kurisuto@chopin.udel.edu (Sean J. Crist) writes:
>Well, the title basically says it all: are all of the various H... calls
>supported by glue when my application is running in System 6.x?  IM VI
>documents these calls (pg. 23-36) but doesn't make it clear when these calls
>began to be supported. (HOpenRF didn't exist in IM IV, where it was a
>low-level call.)  I want to support both System 6 and 7, which means I can't
>use the FS... calls, but I also don't want to use the old calls which don't
>support a dirID.

Question: Is this accurate, the FS... file system calls don't work under system
7? Or, are there other reasons to avoid them in syst. 7?
From: pollansw@cse.fau.edu (Warren Pollans)
Newsgroups: comp.sys.mac.programmer
Subject: thinkPascal question.
Date: 10 Jan 93 23:24:01 GMT
Organization: Florida Atlantic University, Boca Raton, FL, USA


	I just ran thinkPascal for the first time.  I was greeted with
the message that it requires 2.5 M and I only have 1.5 M available
do I want to run it any way - or words to that effect.  The info on
the manual says that it will run in 1M.  My only interest is in
running the "basic" pascal system - ordinary pascal programming, no
mac applications, no objects, etc.  Will I be able to do what I
want?  Do I have to see that message every time I run the compiler?
What am I missing by not having the additional 1 M of ram?

Thanks,

Warren

(pollansw@cse.fau.edu)
From: soc1070
Newsgroups: comp.sys.mac.programmer
Subject: Re: Why the Piracy? Here's why...
Date: 12 Jan 93 15:38:00 GMT
Article-I.D.: vx.12JAN199310382622
Organization: University of Minnesota CIS
News-Software: VAX/VMS VNEWS 1.41

In article <tal691.726832013@huxley>, tal691@huxley.anu.edu.au (Tonio Loewald) writes...
>Software piracy may be wrong, but it's NECESSARY.
> 
>Software piracy is all that stands between us and even higher software
>prices. (The major exception to this is in highly competitive horizontal
>markets, such as word-processors, and even this is debateable.)
> 
>I cite the following evidence:
> 
>The price of SEGA Megadrive/Genesis games vs. Computer Games.
>The cost of Authorware Professional vs. Macromedia Director.
>The cost of AutoCAD vs. MiniCAD.
> 
>In each case, roughly comparable products that are difficult or impossible
>to pirate are much more expensive.

That software piracy is necessary is bogus! All of the 'evidence' you
site can also be explained by another word - COMPETITION. The reason,
for example, that MiniCAD is 1500 dollars cheaper than AutoCAD is:

1- AutoCAD has many, many more features. Examples are a complete devlopment
environment that allows third party devlopers, such as the company I work
for, to add and enhance AutoCAD. Another, that I use all the time, is
that I can add any AutoCAD drawing to another autoCAD drawing. I design
trade show displays (and program as a hobby), and I can draw all small
elements separatly and add them to one final drawing.

2- AutoCAD was the first *real* CAD program that could run on a personal
computer. They had to overcome very large obsitcles in making a DOS 
machine run the program. They need to recoup those devlopment costs. Mac
cad programs will be cheaper because the environment is more conducive
to programming something like a cad package, which equals less devlopment
time, which equals lower overhead, which equals a cheaper product to the
buyer.

3- AutoCAD is the de facto standard. The enormous size of the installed 
user base is an advantage to both the user and AutoDesk. The base means
to the user that support, service, and hardware will be around to keep
the investment in tact; AutoDesk can 'sell' this security as a benefit 
to paying a higher price for their program.

By the same tokin, if MiniCAD were the same price, everyone would buy
autoCAD because it's familiar and respected. So, if MiniCAD wants to
stay in business, it has to present another reason to buy it product-
hence the low cost.

Good marketing and quality programming will keep the cost of software
down, not the ability to pirate it.
------
Tim Harincar				A skunk is better company than
soc1070@vx.cis.umn.edu			someone who prides themselves on
 					being frank. -Lazerus Long
From: jderyck@engn.uwindsor.ca (John De Ryckere)
Newsgroups: comp.sys.mac.programmer
Subject: Re: MPW stuff on ftp.apple.com
Date: 13 Jan 1993 00:43:52 GMT
Reply-To: jderyck@engn.uwindsor.ca
Organization: VLSI Research Group - University of Windsor

Download something from ftp.apple.com and read the .hqx file.  There are actually
restrictions listed in their.
From: stepan@natinst.com (Stepan Riha)
Newsgroups: comp.sys.mac.programmer
Subject: Re: (Q) Need bit manipulation algorithm
Date: 6 Jan 1993 10:57:45 -0600
Organization: National Instruments, Austin, TX
NNTP-Posting-Host: falcon.natinst.com

In article <20751@ucdavis.ucdavis.edu> lim@toadflax.cs.ucdavis.edu (Lloyd Lim) writes:
>In article <1993Jan6.032113.597@planets.risc.rockwell.com> sho@risc.rockwell.com (Sho Kuwamoto) writes:
>>
>>Maybe not the fastest method, but a simple one:
>>   1) come up with an algorithm which counts the number of
>>      1's in a given bit pattern.  You'll either use a loop
>>      with shifts and increments in it, or you'll use masks.
>>[...]
>
>There is a neat trick for counting the number of bits in a word that
>a Microsoft geek showed me one time.  If there are k bits with 1's,
>it runs in O(k) time.
>...  Anyone remember this algorithm?

I've come up with another algorithm that's O(log(n)) where n is the number
of bits.  For a 32 bit integer it takes 5 iterations.  It works by counting
the number of ones in 2 adjacent bits, then 4 adjacent bits, then 8, etc.

long NumOnes(register unsigned long x)
{
	register int	i;
	unsigned long masks[5] = {	0x55555555, 0x33333333, 0x0F0F0F0F,
					0x00FF00FF, 0x0000FFFF };
	register unsigned long *mask = masks;
	for (i=0; i<5; i++, mask++)
		x = (x&*mask) + ((x>>(1<<i))&*mask);
	return (long)x;
}

	- Stepan
-- 
   Stepan Riha -- stepan@natinst.com

Newsgroups: comp.sys.mac.programmer
From: Norbert Mueller <K360171@alijku11.edvz.uni-linz.ac.at>
Subject: Re: Best Mac value of all time
X-Xxmessage-Id: <A76F2AD17A016205@nmueller.chemie.uni-linz.ac.at>
X-Xxdate: Tue, 5 Jan 93 11:08:49 GMT
Organization: Johannes Kepler Univ., Inst. of Chemistry
X-Useragent: Nuntius v1.1.1d12
Date: Tue, 5 Jan 1993 11:12:53 GMT

Re: Best Mac value of all time

I vote for a IIci - not so much because of its price (I got it at 50% dev
discount) but because it is the most long lived and most upward
compatible 
(32 bit QD, 32 bit clean ROMS) expandable Mac II class machine.

I also would like to start another opinion poll for the

WORST MAC VALUE OF ALL TIME (including peripherals)

my number one for this list is definitely the 8.24GC card 


Norbert MUller
Institute of Chemistry
Johannes Kepler University
A-4040 Linz
Austria 
e-mail K360171@ALIJKU11.bitnet
       K360171@EDVZ.uni-linz.ac.at
       Norbert@soft.uni-linz.ac.at
Newsgroups: comp.sys.mac.programmer
From: peter@cujo.curtin.edu.au (Peter N Lewis)
Subject: Re: AFP, Files, and Byte Range Locking
Followup-To: comp.sys.mac.programmer
Organization: NCRPDA, Curtin University
Date: Tue, 12 Jan 1993 04:21:46 GMT

In article <cshotton-110193134404@oac2.hsc.uth.tmc.edu>,
cshotton@oac.hsc.uth.tmc.edu (Chuck Shotton) wrote:
> 
> I know that byte range locking on files is possible on the Mac when using
> AppleShare. Is it possible to do it on a stand-alone Mac so that 2
> applications on the one Mac can read/write the same data file? Is there a
> high-level API for doing this? All I've been able to find are the control
> codes and arguments to be sent to the AFP driver, and I'd really rather
> not... :)

TN186 M.FL.LockRange describes PBLockRange and PBUnlocakRange, and how they
work on shared and local volumes.

OSErr:=PBLockRange(paramBlock_ParmBlkPtr,async_BOOLEAN);
OSErr:=PBUnlockRange(paramBlock_ParmBlkPtr,async_BOOLEAN);

Have fun,
   Peter.

_______________________________________________________________________
Peter N Lewis <peter@cujo.curtin.edu.au>             Ph: +61 9 368 2055
Newsgroups: comp.sys.mac.programmer
From: ematias@dgp.toronto.edu (Edgar Matias)
Subject: Re: protection == !piracy
Organization: CSRI, University of Toronto
Date: 7 Jan 93 22:43:01 GMT


I like your idea of having a semi-functional demo as a "tease" to 
buy the real product.  That's how I market my Half-QWERTY one-handed
keyboard software and it works *very* well, i.e., no complaints yet.
The customer knows what their getting before they shell out the cash
and as you say, the demo's spread like a virus :-).  It's great 
advertising!

As far as Canada Post is concerned (sorry to wander off topic), it
takes about a week to send stuff to the U.S.  If the customer wants
it "now", send it FEDEX and charge them more for shipping.  BTW,
within Canada taxes (PST+GST, or GST only) apply to the shipping 
charge as well.  If you have any doubts, send me mail and we can
exchange information.

As far as what to do if you find a pirated copy, the short answer
is "Call the RCMP"; the longer answer is "I don't know".

Edgar
-- 
Edgar Matias
Input Research Group
University of Toronto
--
I speak for no one...
From: eaeu209@orion.oac.uci.edu (Rodney G. Ramos)
Subject: Books to learn C: Suggestions needed
Newsgroups: comp.sys.mac.programmer
Organization: University of California, Irvine
Distribution: usa
Date: 8 Jan 93 02:01:51 GMT
Followup-To: comp.sys.mac.programmer

I've recently been interested in learning C. Can anyone suggest a good book
to get me started?

I already know Pascal, so it's important that I find a book that does not
assume the reader has no knowledge or experience with programming.

Please e-mail suggestions if possible.

Thanks in advance.
Rodney
Newsgroups: comp.sys.mac.programmer
From: ray@netcom.com (Ray Fischer)
Subject: Re: Address/phone number of MacTutor and status?
Organization: Netcom. San Jose, California
Distribution: usa
Date: Tue, 5 Jan 1993 21:22:28 GMT

ekstrom@oce.usc.edu writes ...
>Could someone please send me the address/phone number of MacTutor?
>I tried ordering a subscription last summer but the magazine never
>showed up and I have since misplaced their phone number. Does
>MacTutor still exist? or did they just screw up my order?

Yes, they still exist, but as of the 1/93 issue it's known as MacTech
Magazine.  Addresses/phone numbers are ...

Xplain Corp
P.O.Box 250055
Los Angeles, CA 90025-9555

mactutor@applelink.apple.com

voice: 310-575-4343
fax:   310-575-0925

-- 
Ray Fischer                   "Convictions are more dangerous enemies of truth
ray@netcom.com                 than lies."  -- Friedrich Nietszsche
From: dstrout@sun.rest.tasc.com. (Dave Strout)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Newbie TCL question on mouse clicks
Date: 11 Jan 1993 18:20:34 GMT
Organization: TASC
Distribution: usa
Reply-To: dstrout@sun.rest.tasc.com
NNTP-Posting-Host: uranus.aitc.rest.tasc.com

In article <1isahqINN6ie@jumbo.read.tasc.com> dstrout@sun.rest.tasc.com.  
(Dave Strout) writes:
> 
> Beginner question on mouse clicks.  I made a copy of the TCL starter  
app,  
> and put these lines in the Draw method in CStarterPane()
> 
> TextFont(1);
> MoveTo(50,50);
> DrawString("\pHello World");
> 
> That works fine.  Every new doc has "Hello world" in it.  But when I  
move  
> those same lines to the DoClick method, (Idea being draw it only after I  
> click in the window) nothing happens.  In fact, if I put SysBeep(1) in  
the  
> DoClick(), It doesn't beep.  What else do I need to do?
> 
> Thanks,
> 
> dave.
> 
> --

Heh Heh.  Sorry.  Should have read the docs SLOWLY.  Call  
SetWantsClicks(true) in the init method.  <embarrassed grin>

dave.
--
Dave Strout	dstrout@sun.rest.tasc.com
Thompson's Rule for First Time Telescope Makers:
It's easier to make a 4 inch mirror then a 6 inch mirror
than it is to make a 6 inch mirror.
/* Opinions expressed are not the official position of TASC. */
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon Wtte)
Subject: Re: What to do if I can't honor an Apple event?
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Sat, 9 Jan 1993 22:40:19 GMT

In <C0LtEq.FpM@news.udel.edu> kurisuto@chopin.udel.edu (Sean J. Crist) writes:

>I know I'm supposed to send back an error string as illustrated on IM VI
>6-49, but I'm not sure what integer to send back as the result of the
>handler function, since the cause of a failure wasn't an operating system

You should send back "aeEventNotHandled" which I believe is
-600-something.

>don't have any other error to send back?  Also, is it my responsibility to
>dispose of the event parameters by calling AEDisposDesc, or is that the
>responsibility of the caller if I send back an error code?

This is a source of some confusion. AppleEvents are just
really a type code and a handle of data. Descriptors are
the same. If you "add" a descriptor to an AppleEvent, the
data is COPIED into the event, so you have to dispose the
descriptor as well as the event.

usually you do something like:

	ProcessSerialNumber psn ...
	AEDesc address , event , ...

	AECreateDesc ( & address , .... typeProcessSerialNumber , & psn , ... ) ;
	AECreateAppleEvent ( & event , ... & address ... ) ;
	AEDisposeDesc ( & address ) ;

	AEPutParamPtr ( ... ) ;

	AESend ( ... & event ... ) ;

	AEDisposeDesc ( & event ) ;

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

   NCC-1701
From: noah@apple.com (Noah Price)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Locating someone on AppleLink (from the Internet)
Date: 5 Jan 93 18:25:33 GMT
Followup-To: comp.sys.mac.programmer
Organization: (not the opinions of) Apple Computer, Inc.

In article <1993Jan4.205307.667@cs.uoregon.edu>,
mkelly@mystix.cs.uoregon.edu (Michael A. Kelly) wrote:
> In article <1993Jan4.155352.28308@zip.eecs.umich.edu> positron@quip.eecs.umich.edu (Jonathan Haas) writes:
> >Is there a way to find out someone's AppleLink address?
> 
> Anyways, I would like the answer to this also.  I suspect it isn't possible.

You're correct.  You can only search for people's AppleLink addresses from
within AppleLink.

noah

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noah@apple.com                                 Macintosh Hardware Design
...!{sun,decwrl}!apple!noah   (not the opinions of) Apple Computer, Inc.
Newsgroups: comp.sys.mac.programmer