HDTenEightyP/NetNews huggingface dataset:
From: sro@media.mit.edu (Shawn O'Donnell)
Newsgroups: comp.sys.mac.programmer
Subject: Re: A few more suggestions for THINK C
Date: 22 Jul 92 03:19:49 GMT
Distribution: comp
Organization: M.I.T. Media Laboratory

>   4) There should be some kind of autosegmentation option with the
>   project window.  Why should a deveoper fiddle with moving project
>   entries around?  It would be much nicer if THINK C could just generate
>   code segment partitioning without human intervention.  How hard is it
>   to count to 32 KByte?  After all, the compiler already keeps track of
>   this information.

There's more to it than simply counting to 32 kByte, but it is an
interesting suggestion.  The reason they let mere humans move code
from code block to code block is that they were hoping we might come
up with a better-than-random assignment.  In a better-than-random
assignment, your Mac won't be swapping code segments in and out of
memory with each function call.  Functions that frequently call other
particular functions should reside in the same block, if possible.

THINK C might be able to make a reasonable first guess at which
functions should live with which other functions, but you can't tell
ahead of time which functions will be calling which other functions.
(The only way you'd know is if your program is independent of user
input or operates on no more than one data set...)

What would be useful is if THINK C would log code swaps for you 
while you're developing the code.  Then, if you notice that there
is a lot of unrest on the heap, you can consider reassigning 
project entries from one segment to another.  It may already do
this.  

Pardon my ignorance if THINK C already has such a function.  Better
tell me now what it is.  

--Shawn
Newsgroups: comp.sys.mac.programmer
From: peter@cujo.curtin.edu.au (Peter N Lewis)
Subject: Re: how to put indelible serial# in resource fork of app?
Followup-To: comp.sys.mac.programmer
Organization: NCRPDA, Curtin University
Date: Mon, 27 Jul 1992 09:02:36 GMT

In article <D88-JWA.92Jul23232829@dront.nada.kth.se>,
d88-jwa@dront.nada.kth.se (Jon W{tte) wrote:

>    A good way to keep users from running software from servers is to disable
>    the capability completely.  When an application is started, doing a
>    GetVol(  volumeName, &fVRefNum); when the app launches retrieves the
>    volume reference.  Use the following routine to determine if a vol ref is
>    a network volume.
> 
> Do you think users with System 7 file sharing would
> ever consider buying your program ?

I hate to inject some actual technical information in here, especially when
you are refuting an argument that actually suggests programs should
disallow themselves to be run from a server (the stupidest thing I've heard
in a long while, practically every program we have hear we have a single
user license and a single copy on the server with the shared bit off so
only one user can use it at a time), BUT, even under System 7 with file
sharing turned on, the local volumes still have a 0 in the server address
field.  It's most annoying really - does anyone know how to get the
FileSharing port number for the local machine, the only way I've found to
do it is either an PConfirmName('=:AFPServer@*') to this machine (which I
think should actually fail because meta chars are not allowed in
PConfirmName, but seems to work anyway), or NBPLookup('=:AFPServer@*') and
then search thru for the local machine's net/node number.

Have fun all, and don't expect me to pay for (and hence use) any app I
can't use from my server - it'll go straight back for a refund.
   Peter.

_______________________________________________________________________
Peter N Lewis, NCRPDA, Curtin University       peter@cujo.curtin.edu.au
GPO Box U1987, Perth WA 6001, AUSTRALIA             FAX: +61 9 367 8141
From: mlanett@Apple.COM (Mark Lanett)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Q: Checking for modif keys on app startup
Date: 28 Jul 92 17:59:48 GMT
Organization: Apple Computer Inc., Cupertino, CA

felciano@summit.stanford.edu (Ramon M. Felciano) writes:

>I'm writing a 7.0 drag-and-drop application, and would like a "power
>user" mode that does some automatic stuff if the user drops files on
>the application while holding a particular key down (most likely
>command or control). While I know how to check the modifier flags in an
>event record, I'm not quite sure how to forcibly read the keyboard. Any
>suggestions?

pascal void GetKeys(KeyMap theKeys)
        = 0xA976; File {CIncludes}Events.h Inside Macintosh reference:
I-259 Trap number: A976 Moves or purges memory.  GetKeys reads the
current state of the keyboard (and keypad, if any) and returns it in
the form of a keyMap:

TYPE KeyMap = PACKED ARRAY[0..127] OF BOOLEAN;

Each key on the keyboard or keypad corresponds to an element in the
keyMap. The index into the keyMap for a particular key is the same as
the key code for that key. (The key codes are shown in Figure 3 above.)
The keyMap element is TRUE if the corresponding key is down and FALSE
if it isn't. The maximum number of keys that can be down simultaneously
is two character keys plus any combination of the four modifier keys.

You owe the Oracle the text from Inside Macintosh.
-- 
Have a bajillion brilliant Jobsian lithium licks.
Mark Lanett, NOT speaking for anyone. Personal opinion only.
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: how to put indelible serial# in resource fork of app?
Keywords: serial#
Organization: Kalamazoo College
Date: Wed, 22 Jul 1992 20:20:36 GMT

rgonzal@gandalf.rutgers.edu (Ralph Gonzalez) writes:
>
>Also, it appears to be a good idea to have the user enter their name
>the first time they run the program, and display it in the startup
>screen after that.  This helps "shame" non-registered users.
>
>QUESTION 1:  Is it ok to store this name in the application's own
>resource fork?

Try the data fork.  When your app starts, check the data fork to see if
name/company info is there.  If not, try opening your data fork with
fsRdWrPerm.  If you can, request the name/company from the user and
write it in.  If you get a wPrErr or an accessDenied error, you may be
on a CD-ROM, a locked floppy, or a server with read-only access;
no sweat, don't do anything.  If you get an fLckdErr, the file
is locked--tell the user to unlock the app for registration purposes and
ExitToShell.  That way, users can't defeat annoying registration notices
by just locking your app.  If they want to run off a locked floppy or a
read-only folder on a server, then they're obviously quite dedicated to
not seeing that annoying registration, and you won't stop them anyway.
:-)

Don't sweat this too much.  If people want to steal your program, they
will, and there's nothing you can do about it.  Don't spend too much
time worrying about it, and don't annoy legitimate users with whatever
scheme you do implement.

By the way, a good scheme mentioned in AppleDirect once is:  make a menu
item that creates a demo copy of your app.  Then when someone asks a
customer for a copy, s/he can say "sure" and quickly make a sample.
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 He let the contents of the bottle do the thinking
 Can't shake the devil's hand and say you're only kidding            - TMBG
Newsgroups: comp.sys.mac.programmer
From: jverdega@cae.wisc.edu (Jeffrey Verdegan)
Subject: Re: A few more suggestions for THINK C
Organization: U of Wisconsin-Madison College of Engineering
Distribution: comp
Date: 22 Jul 92 10:31:52 CDT

In the discussion of having Think C auto-sement, Shawn O'Donnell writes:
>
>THINK C might be able to make a reasonable first guess at which
>functions should live with which other functions, but you can't tell
>ahead of time which functions will be calling which other functions.
>(The only way you'd know is if your program is independent of user
>input or operates on no more than one data set...)
>
>What would be useful is if THINK C would log code swaps for you 
>while you're developing the code.  Then, if you notice that there
>is a lot of unrest on the heap, you can consider reassigning 
>project entries from one segment to another.  It may already do
>this.  
>

This may be a rather naive suggestion, but would it be possible to include
this sort of functionality in the profiler?  Perhaps in conjunction with
MacsBug?  As you can see, I don't have any idea of how all this gobbledygook
works, but I have this vague sense that it should be conceivable that someone
who does would be able to create a profiler kludge to track cross-segment 
calls.

This would be enormously useful.  The app I'm developing has around 40 source
files and 10 libraries.  I have a general idea of where the boudaries are that
separate one block of functions that mostly call each other from another, but
I'm willing to bet that, were I to see some numbers, I'd be more than a little
surprised.

Jeff

----------

Jeff Verdegan
University of Wisconsin-Madison
Computer-Aided Engineering Center
jjv@caestaff.engr.wisc.edu
(608) 263-1875
From: bitting-douglas@CS.YALE.EDU (Pondscum Czar)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Think C is (notso) Great
Date: 22 Jul 92 13:37:30 GMT
	<de19-220792055815@mac41-pg2.umd.edu>
Followup-To: comp.sys.mac.programmer
Organization: Organization?  It's around here somewhere...


In article <de19-220792055815@mac41-pg2.umd.edu> de19@umail.umd.edu (Dana S Emery) writes:

> Again, I like both products, but wouldnt they be better if..

..supported 3rd party editors via apple events?  Really, I would like to
use THINK C primarily as a compilation engine, and use other editors,
such as Alpha, to do my coding...  I like some of the features in the
THINK editor, but I like the feature set of Alpha much better.

> Dana S Emery <de19@umail.umd.edu>

Of course, it would be nice if things like McCLint also supported Apple
Events...

And, while I'm at it, it would be nice if THINK would publish the format
of the project file so all these 3rd party products could use a project
file to gather info, instead of making us input it all twice...

I love THINK C, but that doesn't mean I don't think it could be better.

--Doug
Random Schwee: You know you've been hacking for too long when: You are
watching a commercial on TV which flashes the words "THINK Smart" on the
screen and you instinctively read it as "THINK C" or "THINK Pascal."  I
mean, after all, they *are* the same font... :-)
--
 ...Doug Bitting... || "But the wisdom that comes from heaven is first
                    ||  of all pure; then peace loving, considerate,
bitting@cs.yale.edu ||  submissive, full of mercy, and good fruit,
doug@yalevm.bitnet  ||  impartial and sincere."  -- James 3:17
-- 
--
Murphy's Statement on the Power of Negative Thinking:
   It is impossible for an optimist to be pleasantly surprised.  
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon W{tte)
Subject: Re: Arrow keys & modifiers (was: Think C is (notso) Great)
Originator: d88-jwa@dront.nada.kth.se
Organization: Royal Institute of Technology, Stockholm, Sweden
	<de19-220792055815@mac41-pg2.umd.edu>
	<1992Jul22.141021.20135@hobbes.kzoo.edu>
	<hammett.711843216@sbsu1.aukuni.ac.nz>
Date: Thu, 23 Jul 1992 01:20:40 GMT

> hammett@sbsu1.aukuni.ac.nz (Tim Hammett) writes:

   >I'd like ThC to join with the rest of the Mac world, in which
   >cmd-arrowkey means "go this way for one word/paragraph/page" and
   >option-arrowkey means "go this way to the end of the line/document."
   >ThC has this backwards.  (And BBEdit has it backwards vertically but not
   >horizontally.  Turns my brain to scrambled cheese.)

   I don't use Think C (I use MPW), but it sounds from your description
   like Think C has it right.


NO ! NO ! NO !

Almost ALL programs now have option as go-as-far-as-possible and
command as go-next-neighbour. This includes popular word processors
as well :-)

How about assignable keys ?

   Inside Mac says:
   ------

Volume, Page ?

   Of course, under MPW, the key bindings can be reconfigured to whatever you
   like (plug, plug). :-)

Yes, a very good feature. As they can in Alpha, by the way ;-)

-- 
         Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden

### You have the Easy Access virus. This virus may cause strange sounds.
### You have the 24-bit virus. This virus eats system memory like CRAZY.
From: jeremyr@dcs.qmw.ac.uk (Jeremy Roussak)
Newsgroups: comp.sys.mac.programmer
Subject: The sysz resource
Date: 22 Jul 92 20:31:52 GMT
Organization: Computer Science Dept, QMW, University of London

"The sysz resource is obsolete under system 7"

Discuss.

Thanks.

Jeremy
Newsgroups: comp.sys.mac.programmer
From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
Subject: thinkc5 DIRECT classes
Summary: making CObject DIRECT
Keywords: thinkc CObject direct
Organization: NASA/ARC Information Sciences Division
Distribution: comp.sys.mac.programmer
Date: Tue, 28 Jul 1992 21:53:21 GMT

Hey fellow netters:

this may be a FAQ, but I doubt it. Iv'e seen little reference to the subject
anywhere.

What I'm looking into is re-writing the CObject class as a direct, that
is, not a handle but a reference.  My original thinking is that
if I rewrote new() and delete() to call NewPtr() and DisposPtr(), and
recompiled, all the objects would then be direct.

This should speed up some operations, because the constant double-
dereferencing would be eliminated.  Of course it presents
mem. fragmentation problems, but this may not be a problem.

When I tried it once, CopyObject was the problem:
you cannot tkae sizeof(this), so one way to figure out the size of
the object to be copied is GetPtr/HandleSize().

When I implemented this, the starter project crashed, and hard.  Complete
lockup.

Has anyone tried this? aAre there other reasons to avoid it?

Your thoughts and comments are welcome.

joshr@kronos.arc.nasa.gov



-- 
----------------------------------
#include <std/disclaimer.h>     Josh Rabinowitz, Mac TCL programmer
joshr@kronos.arc.nasa.gov
"'I see', said the blind carpenter, as he picked up his hammer and saw".
From: lust@reed.edu!lust.reed.edu!pcalahan (Patrick John Calahan)
Newsgroups: comp.sys.mac.programmer
Subject: CopyMask vs. ClipRgns
Date: 23 Jul 92 19:40:35 GMT
Article-I.D.: lust.m0mB91U-00000fC
Organization: Reed College, Portland, OR

Which is faster, CopyMask or CopyBits with a clipping region?

Essentially, I have a game in which objects move around a playfield,  
moving behind some objects in the foreground.  Currently the foreground  
objects are clipped with rectangles and the game pieces are animated with  
copybits. Would it be faster to define a large
bitmap mask of all of the foreground objects and use copymask for the game  
pieces?  Thanks...
From: moyman@ecn.purdue.edu (Mike Moya)
Newsgroups: comp.sys.mac.programmer
Subject: PAP and LW IIf/g help
Date: 27 Jul 92 22:01:26 GMT
Followup-To: comp.sys.mac.programmer
Organization: Engineering Computer Network

Any reason I can do the following. It won't work for me and I don't
understand why (I tend to look at things a bit simplistically). Don't
worry about error codes for this example:

initlizia, etc...
err = PAPOpen(&cno, LWtr, rflowq, &status, &ocomp));
sprintf(chstr, "serverdict begin 0 exitserver\n (%%LocalTalk%%) <</L
ocalTalkType (%s:LWtr)>> setdevparams\n", prname);
err = PAPWrite(cno, chgstr, sizeof(chgstr), 1, &wcomp);
PAPClose(cno);

As you can see I am trying to start up a spooler by renameing/type the LW
first off (and not having much luck)... The real code goes through without
any errors in the PAP calls but the name and type of the LWIIf does not
change. Any ideas? Any code floating around out there that shows an
example?
--moya

--Mike Moya
--Macintosh Systems and Networking
--Engineering Computer Network
--Purdue University 
--
From: ll1n+@andrew.cmu.edu (Lian-Keng Lim)
Newsgroups: comp.sys.mac.programmer
Subject: MIDI Manager and Think C
Date: 21 Jul 92 11:39:54 GMT
Article-I.D.: andrew.geP6U_S00VouIB10wH
	<1992Jul21.174631.20664@cs.cornell.edu>
Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA

I am trying to write an application that uses both Think C and Apple's
MIDI Manager.  
In my source code thus far, I have only made 1 call to MIDI Manager
which is SndDispVersion, unfourtunately, I keep getting link error when
I tried to run my program, and the error says that SndDispVersion is
undefined.
1.  my program has an include for MIDI.h
2.  I have also installed MIDI Manager in the system folder.

what's the problem?

I would appreciate any help,
thanks in advance.

Keng,
Newsgroups: comp.sys.mac.programmer
From: lecates@bach.udel.edu (Roy LeCates)
Subject: Think C:  Call by reference?
Organization: University of Delaware
Distribution: na
Date: Wed, 29 Jul 1992 14:21:09 GMT

On the UNIX C++ compilers, there is an option called "call by reference."
It is a very useful way of passing variables to functions.
I would like to know if it exists in Think C.

For those who don't know about "call by reference" here's a description:
It performs a function similar to "VAR" variables in Pascal.  That is,
it passes a pointer to the actual variable instead of a copy of the
variable.  This allows the function to modify the actual variable which
was passed, not just a copy.

With "call by reference" the compiler automatically handles dereferencing
the pointer, so the programmer only sees the variable -- not the pointer.

This is an example of "call by reference" syntax (i.e. the '&' between
the type and variable name):

void Do_Something ( int first, int & second );

In this example, 'first' would be passed by a COPY of the actual variable.
On the other hand, 'second' would be passed by a POINTER to the actual
variable.  However, since the compiler handles the dereferencing, the
statement "second = first;" is valid in this function.

Please e-mail any replies.  Thanks!

-- 
------------------------------------------------------------------
Roy M. LeCates       EE Undergraduate        lecates@bach.udel.edu
University of Delaware Electrical Engineering and Computer Science
------------------------------------------------------------------
From: fsmah1@acad3.alaska.edu (Mike Hageland)
Newsgroups: comp.sys.mac.programmer
Subject: PBGetEOF problem.
Date: 24 Jul 92 22:05:04 GMT
Organization: University of Alaska Fairbanks

I have been using PBRead, PBWrite, etc for a few weeks now without noticing a
problem, however just today I tried to use PBGetEOF.  For some reason no matter
what it returns a 64 in .ioMisc.  I first had the file 128 bytes large, so I
thought perhaps it was counting words instead of bytes, but when I went too 200
bytes writen, it still returned 64 on the GetEOF part.  Anybody have any ideas
as to why?  Am I mistaking that you don't need to actually SetEOF, but PBWrite
will do this for you?  Any help would be apreciated.

						-Mike
From: andyp@treehouse.UUCP (Andy Peterman)
Newsgroups: comp.sys.mac.programmer
Subject: Re: File type sorting in MPW
Date: 29 Jul 92 16:30:50 GMT
Followup-To: treehouse!andyp@gvgpsa.gvg.tek.com
Organization: The Treehouse

In article <45814@shamash.cdc.com> ldh@svl.cdc.com (Lawrence D. Hare)
writes:
> ...
> ...
>In short - I want to be able to group TEXT files and OBJ files for
>selection by lasso, or selection box, or whatever it is called.
>
>Any suggestions?

Yes, put all your OBJ files into a separate folder.  This is also useful for
other reasons, not the least of which is to keep down the clutter in the
source folder.

See the example in Chapter 9 of the MPW manual if you're not sure how to do
this.
-- 
Andy Peterman                       
treehouse!andyp@gvgpsa.gvg.tek.com  
(916) 273-4569                      
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@dront.nada.kth.se (Jon W{tte)
Subject: Re: Moving to the foreground after receiving an 'odoc' from the Finder
Originator: d88-jwa@dront.nada.kth.se
Organization: Royal Institute of Technology, Stockholm, Sweden
	<mxmora-200792113832@css-mac1.sri.com>
	<1992Jul20.195334.19197@newstand.syr.edu>
	<1992Jul21.174631.20664@cs.cornell.edu>
Date: Tue, 21 Jul 1992 22:06:42 GMT

> csuley@cs.cornell.edu (Christopher Suley) writes:

   In _Macintosh Programming Secrets, 2e_, they call EventAvail 3 times when
   the program starts up to bring it to the front.  They say that this is the
   "standard" way to bring a program to the front under MultiFinder.


No, it's the standard way of bringing the app to the
front WHEN BEING LAUNCHED under MultiFinder. Big difference !
Calling EventAvail will NOT switch layers by itself.

-- 
         Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden

### You have the Easy Access virus. This virus may cause strange sounds
### and weird keyboard behaviour when you press the shift key repeatedly.
From: gbs@panix.com (Eric Braun)
Newsgroups: comp.sys.mac.programmer
Subject: HOT KEY trouble
Date: 30 Jul 92 18:56:18 GMT
Organization: PANIX Public Access Unix, NYC

Hi,

I'm implementing a hot key by patching JGNEFilter and looking for the
appropriate key as the events flow by.  This works fine and dandy.
The problem is that the hot key is supposed to open up my DA and the
way it works now is that it'll open up the DA on top of almost
anything!

This is bad new cus you don't want a DA poping up on top of, say, a
file selection box, or any other modal dialog for that matter.

THE QUESTIONS: how can I tell if a modal dialog box is open so as to
temporarily disable the hotkey?  Are there any other situations that
might cause problems where I should also disable it?

Perhaps a hot-key would better be implemented in some other way?

thanks in advance  -eeb

___________________________________________________________
Eric Braun				Glass Bead Software
gbs@panix.com				803 President St.
(718)230-8010	       			Brooklyn, NY 11215
-- 
___________________________________________________________
Eric Braun				Glass Bead Software
gbs@panix.com				803 President St.
From: wombat@claris.com (Scott Lindsey)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Think C 5.0 under sys7, help!!!
Date: 27 Jul 92 21:39:10 GMT
Organization: Claris Corporation, Vancouver WA
Wombat: yes
Number: 32373

In article <1992Jul25.053648.12278@midway.uchicago.edu>, hd12@ellis.uchicago.edu (hui  dong) writes:
> 
> I am trying to use Think C 5.0 under sys7 to recompile a C code I wrote
> using 4.0 under sys6. I get lots of errors, drive me crazy! It even complains
> about GetNewCWindow(WINDOW_ID,0L,-1L), saying the last argument isn't valid.

You basically have two choices.  If you turn prototype enforcement off, you
should get fewer, if any, errors.  The "correct" thing to do is to fix your
code so it correctly observes the prototypes.  In your example, the last arg
to GetNewCWindow is of type WindowPtr.  -1L isn't a windowptr (it's a long --
yes, 0 is a special case when it comes to constants).  If you cast it, it
should work "GetNewCWindow(WINDOW_ID, 0L, (WindowPtr) -1L);"

--
Scott Lindsey <wombat@claris.com>
Newsgroups: comp.sys.mac.programmer
From: jpurlia@qualcomm.com (John Purlia)
Subject: AppleTalk Filing Protocol Finder Info
Followup-To: comp.sys.mac.programmer
Organization: Qualcomm, Inc.
Date: Thu, 30 Jul 1992 17:58:34 GMT

Can anyone tell me what, exactly, appears in the last 16 bytes of the
Finder Information parameter returned by AFP?  AFP defines the finder
information parameter to be 32 bytes, but the FInfo structure we're all
used to is only 16 bytes, like so:

        struct FInfo {
            OSType fdType;
            OSType fdCreator;
            unsigned short fdFlags;
            Point fdLocation;
            short fdFldr;
        };

So what is being returned in the extra 16 bytes?

...........................................................................
John Purlia          : My brain; not my company's brain.  My brain says...
jpurlia@qualcomm.com :      "Just about any movie could be made better
AppleLink:  AM0470   :       if one of the characters were a vampire."
...........................................................................