HDTenEightyP/NetNews huggingface dataset:
From: peterbak@microsoft.com (Peter Bako)
Subject: death of a global variable...
Date: 13 Aug 92 19:13:03 GMT
Organization: Microsoft Corp.
Keywords: programming help, weird bug?


I have a really weird bug that has me stumped, and just might do
the same to some of you as well....

First of all a small background.  The program is being written on a
Mac IIci with 8 megs of memory and running system 7.0.  The program
is being written with Think C 5.0.2.

Now the problem.  I have two global variables, one which is an array 
of menu handles, and the other is structure of my own design.  During
an assign of two variables within the structure, the contents (first the
lo order word, then the high) of the MenuHandle array get overwritten.
Now for some code - first the structure:

typedef struct
{
	int    	FileRefNum;
	long    Height, Width;
	int	dataPos;
	WindowPtr	winPtr;
} DrawRec;

Ok then I globally declare the following:

MenuHandle	theMenus[NumOfMenus];
DrawRec		theImage;

During the setup look the MenuHandle array gets filled in with 4 handles
to my four menus.  So far everything is working perfectly.  Now as the
user selects the draw routine we jump to the setup for that which fills
in the values of the struct:

/* get line of data into temp */
StringToNum(temp, &x);
theImage.Height = x;
/* get next line of data */
StringToNum(temp, &x);
theImage.Width = x;

theImage.FileRefNum = refNum;

Now here is the catch!  By watching the value of theMenus[4] (my last menu)
in the debugging window of Think C, I can watch how the contents of that
variable are changed as the the value of theImage.Width and theImage.FileRefNum
are set.  My problem is that I cannot figure out why by setting the these
two variable, it is blowing away the contents of my menuHandle array.  Any
ideas?

Peter

-- 
(*)-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-\/-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+(*)
(   UUCP:         peterbak@microsoft  ||   Is this all that I am?  Is there   )
(   CompuServe:   71170,1426          ||   nothing more?    - V'ger           )
(*)-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-/\-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+(*)
From: orpheus@reed.edu (P. Hawthorne)
Newsgroups: comp.sys.mac.programmer
Subject: GetMenu Call Bombs Under 7, Not Under 6
Date: 23 Aug 92 09:59:01 GMT
Article-I.D.: reed.1992Aug23.095901.11903
Organization: Reed College, Portland OR


	Dear Net Landers,

	A section of code that uses GetMenu runs without fail under System
6.0.5, and yet bombs intermittently under System 7.0.1 Tuneup. Tracing
execution with MacsBug, the failure appears to be caused by a jump to
garbage code, in a call to CalcMenuSize, within the call to GetMenu. The
menu resource looks okay, and uses only the standard MDEF. Replacing the
GetMenu with GetResource makes the bombing less frequent, but does not
eliminate the problem entirely.
	The problem seems to be aggravated by using GetMenu while a command
is being processed and a menu is hilited appropriately.

	Any ideas as to what's going on here?

	Sincerely,
	Stumped In Stumptown (orpheus@reed.edu)
Newsgroups: comp.sys.mac.programmer
From: ibu@fokus.gmd.de (I. Busse)
Subject: Drag and Drop for Documents
Organization: GMD-Fokus
Distribution: comp
Date: Sun, 16 Aug 1992 18:35:52 GMT

Is it possible to create a document which supports drag and drop?

I think this would be a nice feature for scripting languages or hypercard,
which support appleevents. ...or tools like stuffit, so that the archives
can behave exactly like folders.
Frontier can create droplets, but the scripts are changed to standalone
applications. And indeed it seems to be neccessary that the creator is APPL,
otherwise the system don't look at your FREF resource - right?
--
Ingo Busse

GMD-FOKUS        | X.400    : <S=busse;OU=fokus;OU=berlin;P=gmd;A=dbp;C=de>
Hardenbergpl. 2  | Internet : busse@fokus.gmd.de
D-1000 Berlin 12 | Phone    : +49 30 254 99 165     Fax : +49 30 254 99 202
From: chris@benton.prepress.com (christopher m. knox)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Link: Error: PC-relative edit, offset out of range.
Date: 14 Aug 92 16:25:48 GMT
Organization: Pre-Press Technologies, Inc.
X-Useragent: Nuntius v1.1b2

Link: Error: PC-relative edit, offset out of range.

Hi,
only after posting a scream for help for the same error myself did
I find your question. Oh well. But I found a workaround that at least
helps me, maybe it's a solution for you and others as well. Some info
on AppleLink suggested the problem was that 'Runtime.o' could not reach
my MAIN routine. So the next thing to try is to move Runtime.o closer to
the MAIN routine on the link command line. This causes a whole lot of 
other problems. What finally works (for me) is this:

in file :MPW:MacApp 3.0.1:Tools:Build Rules and Dependencies
change

	{MALink} ?
		{ZortechInit} ?
		"{XAppName.p.o}" ?
		"{XUAppName.p.o}" ?
		"{XMAppName.p.o}" ?
		"{XAppName.cp.o}" ?
		"{XUAppName.cp.o}" ?
		"{XMAppName.cp.o}" ?		<= this is too far away from *)
		{OtherLinkFiles} ?				<= because of this (LOTS of files in my case)
		{CPlusLoadObj} ?
		{MacAppLib} ?
		{NeededSysLibs} ?				<= *)
		{SegmentMappings} ?
     ...
to

	{MALink} ?
		{ZortechInit} ?
		"{XAppName.p.o}" ?
		"{XUAppName.p.o}" ?
		"{XMAppName.p.o}" ?
		"{XAppName.cp.o}" ?
		"{XUAppName.cp.o}" ?
		"{XMAppName.cp.o}" ?
		{CPlusLoadObj} ?
		{MacAppLib} ?
		{NeededSysLibs} ?
		{SegmentMappings} ?
	  {OtherLinkFiles} ?				<= 
    ...

I don't know if it's a good idea to change this file, but it got me going
again.

PS: sorry about the blank messages, I'm new at this.
chris knox "Omne animal triste est post (or without) coitum"
From: mcmath@csb1.nlm.nih.gov (Chuck McMath)
Newsgroups: comp.sys.mac.programmer
Subject: Re: My view resource won't load.  Any suggestions?
Date: 13 Aug 92 18:11:00 GMT
Followup-To: comp.sys.mac.programmer
Organization: MSD

In article <james.713664246@syzygy>, james@socs.uts.edu.au (James Ward)
wrote:
> 
> Please help a newbie MacApp`er with a view resource problem...
> 
> I`m trying to make my MacApp 3.0 application display a view with around
> nine buttons, three clusters and a static text list.  My code compiles
> OK, but when it is run no document or window is created, and the 
> message "Not enough memory to create document" appears.  SourceBug shows 
> that the NewTemplateWindow function returns 'nil'.
> 
Well, it's probably NOT really an out of memory error, as you noticed when
nothing changed after you upped the partition size.  What's happening is
that inside your view, when NewTemplateWindow is trying to create it,
something is going wrong, and it's returning NIL instead of your root view.

I get this all the time when I try to use TPictureViews and the associated
PICT resource is not found - that's the kind of error which causes your
view to not get created.  With buttons, clusters and static text items, the
only thing I can think of that might be the cause would be if your
associated STR#'s weren't found (you know, the labels for the buttons,
clusters, etc), or maybe a style wasn't found?

The way I track down such errors is to use SourceBug to trace into the
NewTemplateWindow call deep enough until I can tell what can't be created. 
It's grungy, but necessary.

chuck


|- chuck mcmath - mcmath@csb1.nlm.nih.gov - MSD, Inc. ------------|
|- National Library of Medicine - National Institutes of Health --|
|- Bethesda, MD 20894 -  !aixelsyd evah uoy siht daer nac uoy fI -|
|- "Hey batter, hey batter, hey batter, swing" - Anon. -----------|
Newsgroups: comp.sys.mac.programmer
From: joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91)
Subject: Re: reverse video mode?
Organization: NASA/ARC Information Sciences Division
Date: Fri, 21 Aug 1992 20:04:11 GMT

In article <BtCMHn.4H.2@cs.cmu.edu> pje+@cs.cmu.edu (Paul Erion) writes:
>does anyone know of a way/tool to "force" a mac monitor to operate in
>reverse video mode?
>						thanks,
>							paul

I, too have ben looking for this cure for about a year now.  I would like 
to just have _all_ applications show _white_ text on a _black_ background,
which is more natural for a blackscreen moniter.

I came to the conclusion that it is (practiaclly) impossible -- you can change
the backgournd to black (as I remember), but couldn't get text to show
up white on it.  I decided somewhere the graphic operations must
be hardwired for the colors. BTW, I imagine this whole problem 
disappears on color systems, and that white text/black bkgrnd IS poss.
.  Can anyone concur/disprove?

BTW, CloseView has an inverse op[tion, but I couldn't get it to use it without 
a floating rectangle of where you ijndended to later magnify.

If anyone knows a way of showing white text on black background on
BW mac, pls inform, my eyes will thank you (as will my I's).

joshr

-- 
----------------------------------
#include <std/disclaimer.h>     Josh Rabinowitz, Mac TCL programmer
joshr@kronos.arc.nasa.gov
"Send a salami to your boy in the army" - Katz's delicatessen, NYC
Newsgroups: comp.sys.mac.programmer
Subject: Re: Finder labels
From: Bruce.Hoult@bbs.actrix.gen.nz
Date: Tue, 18 Aug 1992 04:45:48 GMT
Organization: Actrix Information Exchange

In article <318@farallon.farallon.com> neal@farallon.com (Neal Trautman) writes:
> 
> The System 7 call looks like this:
> 
> 	FUNCTION GetLabel(labelNumber: INTEGER; VAR labelColor: RGBColor;
> 							VAR labelString: Str255): OSErr;
> 		INLINE $303C, $050B, $ABC9;


So what's this _IconDispatch, then?

It's listed in my Traps.p, but there aren't any routines anywhere in the
Mac interfaces that use it.  Nothing about it or GetLabel that I can find
in 411 or IM VI either...

-- 
Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
"Cray's producing a 500 MIPS personal computer with 256MB RAM and 8 GB
hard disk that fits in your pocket!"   "Great!  Is it PC compatible?"
From: John_Shepardson.esh@qmail.slac.stanford.edu (John Shepardson)
Newsgroups: comp.sys.mac.programmer
Subject: Re: HELP: how can I ...
Date: 21 Aug 92 17:01:47 GMT
Followup-To: comp.sys.mac.programmer
Organization: slac


> 1. How can I find out what kind of video card is installed through my
>    program?
> 
> 2. How can an application get the document name/path through which the
>    application is invoked?
> 
> THANKS in advance!!
> 

You should get a good sized hard disk and pump all the source code you can
find onto it including all the source from apple's developer CD's and
Mactutor.
Then all you would have to do is search through the files using a text
finder like On Location.  This makes a personal library that is incredibly
valuable!

You'll have to use the slotmanager to get the video board name and very
specific info, although finding out the depth's supported could be as easy
as calling HasDepth using the gdevices found in the DeviceList.

source to return the pathname can be found in MacTutor #05
(Dec85-Jan86):c:hfs source 2-1.  Also there is code in apples developer
disks under Snippets: Parsefullpathname which does the reverse job.


-------------------------------------------
John_Shepardson.esh@qmail.slac.stanford.edu
From: tim@maths.tcd.ie (Timothy Murphy)
Newsgroups: comp.sys.mac.programmer
Subject: Re: TextEdit: Breaking the 32K limit (MPW)
Date: 20 Aug 92 17:46:21 GMT
Organization: Dept. of Maths, Trinity College, Dublin, Ireland.

rrwood@uuisis.isis.org (Roy Wood) writes:

>I know that Chris Wysocki released a Think Class Library replacement that
>allows files larger than 32K to be edited.  The source is available via ftp
>from (I think) ftp.rutgers.edu.  

I couldn't find anything relevant at rutgers.
Could you please check your information.
It would help too if you could give the directory
in which the code can be found,
or else the name of the program, so that one can ask archie.

-- 
Timothy Murphy  
e-mail: tim@maths.tcd.ie
tel: +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
From: rgonzal@gandalf.rutgers.edu (Ralph Gonzalez)
Newsgroups: comp.sys.mac.programmer
Subject: QuickBASIC upgrade
Keywords: basic
Date: 18 Aug 92 20:56:28 GMT
Organization: Rutgers Univ., New Brunswick, N.J.


In case you've been putting off upgrading Macintosh QuickBASIC to the
latest System 7-compatible version, I just called their BASIC
"setup/install answer line": (206) 646-5101.

The Microsoft representative immediately offered to send me the
upgrade, no questions asked.

I haven't gotten it yet, but I hear that other than System 7
compatibility it doesn't have much new. Also, the guy I spoke with
said he didn't know of any future upgrades with new features,
confirming my impression that Microsoft has abandoned QuickBASIC on
the Mac. That's a shame, because if they beefed it up a little and/or
gave it a Visual BASIC metaphor, it could be pretty useful to those of
us who loathe digging around the Toolbox...

-Ralph
-- 
Ralph Gonzalez, Computer Science, Rutgers Univ., Camden, NJ
Phone: (609) 757-6122; Internet: rgonzal@elbereth.rutgers.edu
--
From: jpurlia@qualcomm.com (John Purlia)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Computer Science Programs
Date: 17 Aug 92 19:42:34 GMT
Followup-To: comp.sys.mac.programmer,misc.education,soc.college
Organization: Qualcomm, Inc.

In article <Bt4x5K.9vI@usenet.ucs.indiana.edu>,
mdchaney@fractal.ucs.indiana.edu (M Darrin Chaney) wrote:
> 
> In article <1992Aug15.02132.10817@ms.uky.edu> borders@ms.uky.edu (Johnny Borders) writes:
> >solman@athena.mit.edu (Jason W Solinsky) writes:
> >>Before anybody flames me for extreme opinions in my last post, let me note
> >>that I meant to e-mail it and not post it. I didn't want to have to put up
> >>with flames. That having been said, flame away.
> >
> >Well, I don't have a flame, just an addition:
> >

If you want a lot of bang for the buck, I'd suggest Cal Poly San Luis
Obispo.  I found Cal Poly's undergraduate program to be exceptional, highly
competitive, and comfortably challenging (your mileage may vary).  In
addition, the price (for CA residents anyway) is a bargain!
...........................................................................
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."
...........................................................................
Newsgroups: comp.sys.mac.programmer
From: ak237@cleveland.Freenet.Edu (Alan Toman)
Subject: "Extracting" .o files from a MPW library
Organization: Case Western Reserve University, Cleveland, Ohio, (USA)
Date: Wed, 12 Aug 92 12:06:22 GMT


Does anyone know of a public domain program that will "extract" the 
individual object files from a MPW lib.  I know the Lib tool from MPW
will do the job, but I don't want to purchase MPW just for this.
Thanks.
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Lots of precompiling in ThC (Re: Help!  System error #28)
Organization: Kalamazoo College
Date: Thu, 13 Aug 1992 15:48:21 GMT

d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
>
>	3) Open your "Mac #Includes.c" file in the MacIncludes folder
>	4) Change #define SIMPLIFY_PROTOTYPES to 0
>	5) While you're at it, turn on ALL of the header files,
>	   except for the few mentioned in the comment at the start
>	   of the file.
>	6) Choose "Precompile"
>	7) Save as MacHeaders, overwriting your previous MacHeaders.
>
>This trick will ... reduce the size of
>your project file a lot. If you use the class library, why not include
>those headers as well ? A class library project then becomes < 600K in
>size !

Two reasons not to do this:

(1) Option-clicking on the title bar won't display header files that are
also in a precompiled header.  This makes bouncing around source code a
lot slower.

(2) Last I knew (ThC4, I think), the compiler took quite a while to chew
through a huge precompiled header file.  While I'm sure it's faster to
read a precompiled symbol than to parse it, huge precompiled files mean
you prepend, to each file, a lot of code you don't need.  When I removed
all the TCL files from my precompiled header, my compile speed doubled.

>If you don't do this, you're just stupid and ignorant and deserve to
>be bitten by all the bugs that find you :-)

Maybe I should redirect the followup to alt.religion.computers?
(I agree that not using strict prototyping is a little daffy, tho'.)
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 "Oh shut up."                         - Dan "Maynard" Gannon, 28 July 1992
Newsgroups: comp.sys.mac.programmer
From: merrick@aic.lockheed.com (Darrell Merrick)
Subject: Help: printing without dialogs
Organization: Lockheed Artificial Intelligence Center
Date: Mon, 17 Aug 92 23:43:11 GMT

Is there a way to directly set print options, making toolbox calls via 
Think C, rather than calling PrStlDialog and PrJobDialog and having the 
user make the selections?  We want to print a document with a given 
combination of settings, without prompting the user.  If there is no way 
to do this, is there a way to at least change the default settings?

Thanks in advance,

Darrell Merrick
From: csandy@cybaswan.UUCP (ap.parkman)
Newsgroups: comp.sys.mac.programmer
Subject: Re: ***BASIC PROGRAMMING***
Date: 19 Aug 92 10:48:14 GMT
Reply-To: csandy@cybaswan.UUCP (ap.parkman)

In article <817.2A903FFC@fidogate.FIDONET.ORG> Mary.Hicks@p0.f222.n125.z1.FIDONET.ORG (Mary Hicks) writes:
>
>Also, can someone send me some basic code that will let my mac turn on 
>automatically everyday at a certain time?
>--  
>Mary Hicks - via FidoNet node 1:125/555
>    UUCP: ...!uunet!hoptoad!kumr!fidogate!222.0!Mary.Hicks
>INTERNET: Mary.Hicks@p0.f222.n125.z1.FIDONET.ORG

I checked my calendar, to be sure, and it says we're nowhere near April
but this has got to be a wind up, right???

I'm not religous, but it's going to take more than we earthly programmers
can manage to get code to run BEFORE there is any power to the machine!
( or can this be done in Assembly!!! ). Anyway I'll have a crack at it:

10 PRINT "Why not get a timed switch to power your Mac on at a said time"
20 PRINT "and put your desired applications in the startup items folder"
30 PRINT "This resides within the system folder"
40 PRINT "When the timed power switch kicks in the Mac will boot"
50 PRINT "and execute these programs, which it would seem will work"
60 PRINT "in the background unattended."
70 END

All joking asside, hope this helps.

AndyP

csandy@uk.ac.swan.pyr
Newsgroups: comp.sys.mac.programmer
From: riskit@x400gate.bnr.ca (Reg Foulkes)
Subject: How to think CS (was Re: Computer Science Programs
Followup-To: comp.sys.mac.programmer,misc.education,soc.college
Organization: Bell-Northern Research
Date: Mon, 17 Aug 1992 10:43:44 GMT

In article <1992Aug16.230658.9890@src.umd.edu>, clin@eng.umd.edu (Charles
C. Lin) wrote:

>   Essentially, you need to
> learn how to think computer science.  How to reason
> about concepts.   I think few people are introspective
> enough (even profs.) at being able to describe why
> they are so good at the topic, which means that they
> are sometimes unable to use that experience and pass it
> on to the students.

   No truer words have been spoken.
   Not being able to describe CS concepts is a paradox  that 
I just don't understand. How can someone know something 
such as, CS and not be able to describe it to others? If one 
cannot explain it it probably was not understood. 

Every time I open a new CS book I get the feeling  the author
is trying to hide concepts, rather than trying to explain concepts. 
It is probably because the author writes only for others who are 
as adept as he in the area of discussion. 



***********************************
riskit@x400gate.bnr.ca (Reg Foulkes)

No passion on earth, no love or hate
Is equal to the passion 
to change someone else's code
Newsgroups: comp.sys.mac.programmer
From: keith@taligent.com (Keith Rollin)
Subject: Re: Checksumming MemErr global variable (Tech Note 7) problem
Organization: Taligent
Date: Tue, 18 Aug 1992 20:28:20 GMT

In article <1992Aug18.181714.12276@midway.uchicago.edu>, chh9@quads.uchicago.edu
(Conrad Halton Halling) writes:
> 
> Tech Note 7 says:
> 
> "If you are having strange, memory-related problems, one thing that
> you can do to help find them is to checksum on MemErr (the low memory
> global word at $220).  In MacsBug, type "SS 220 221"....  When MemErr
> changes, the debugger will appear, and you can check your code to make
> sure that you are checking MemErr.  If not, you might have found a problem
> that could cause your program to crash!"
> 
> I tried this, but apparently StripAddress() is using MemErr because it
> is stuffing strange numbers into this global variable, so this technique
> doesn't seem to work any more.  Does anyone know why StripAddress()
> is using MemErr??

What StripAddress are you looking at? I've got a Quadra 900 with 7.0.1, Tune-Up
1.1.1, and a bunch of skanky INITs. If anyone is going to have a goofy version
of StripAddress, I would. However, StripAddress is still run from ROM on my
machine, and it looks like this:

     +0000  4080D764   BTST       #$00,$1EFC
     +0006  4080D76A   BNE.S      _StripAddress+000C         ; 4080D770
     +0008  4080D76C   AND.L      MaskBC,D0
     +000C  4080D770   RTS

No muss, no fuss. An no accesses to MemErr.

--
Keith Rollin
Phantom Programmer
Taligent, Inc.

Newsgroups: comp.sys.mac.programmer
From: wirehead@cheshire.oxy.edu (David J. Harr)
Subject: Re: Changing the ascent in a dialog edit text item.
Followup-To: comp.sys.mac.programmer
Summary: OK, I fixed it now.
Keywords: dialog, edit text item, changing font
Organization: The Programmers who say NEE!
Date: Tue, 18 Aug 1992 04:17:39 GMT

In article <1992Aug17.054527.18105@cheshire.oxy.edu> I write:
>OK, I have an edit text item that I need to display in 9 pt
>Geneva instead of 12 point Chicago. I have an 'ictb' resource
>that has all the proper information, but it only partially works.
>The text is indeed drawn in Geneva9, but the spacing between the
>lines seems more appropriate to Chicago12 than Geneva9. Also, the
>blinking cursor appears way out to the side of where it should be,
>as if the width of the string were being computed with the 12 point
>font agin, instead of the nine point font. There is a nonblinking
>cursor that is at the proper position, but the blinking cursor is
>blinking at a different place than the actual insertion point,
>which is very confusing. If anyone has any ideas as to what I am
>doing wrong, I would appreciate hearing about them.
>

I finally got the silly thing to work by calling TextFont and TextSize,
and then manually stuffing the values for the line height, the ascent,
the point size, and the font into the text edit record. It's pretty
sorry that there isn't an Toolbox call that will do all this for you.

David J Harr
wirehead@cheshire.oxy.edu

"Everybody is quoting everybody else in their .sigs, I don't
see why I shouldn't be able to quote myself."
                    -- David J Harr in comp.sys.mac.programmer
From: de19@umail.umd.edu (Dana S Emery)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Map (was: Australian Mac systems)
Date: 20 Aug 92 10:04:57 GMT
Followup-To: comp.sys.mac.programmer
Organization: Personal

The correct time of day is significant to programs which post/read messages
on networks.

Daylight savings time is, unfortunatly, a legal concept which is subject to
frequent re-definition in some localities. The dates affected and the
offset vary from state/state and country/country all over the world, which
effectivly makes it impossible for the OS handle it.  

It would be nice to have an interface for the user to declare a DST
off-set, and on/off dates. How about it Apple?

--

Dana S Emery <de19@umail.umd.edu>
Newsgroups: comp.sys.mac.programmer