HDTenEightyP/NetNews huggingface dataset:
From: mark@bilpin.co.uk (Mark Allerton)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Tech-note 31
Keywords: Desperation
Date: 5 Oct 92 12:44:18 GMT
Reply-To: mark@bilpin.co.uk (Mark Allerton)
Organization: UK Mac DTS

So you're desperate now? Don't say I didn't warn you...

Mark Allerton
UK Mac DTS


Mark Allerton
UK Mac DTS - mark@bilpin.co.uk
From: David Johnston <davidj@daveland.demon.co.uk>
Subject: Re: MacTCPCommonTypes & typedef unsigned char b_8.
Organization: Daveland Developments
Date: Tue, 29 Sep 1992 17:25:22 GMT
X-Xxmessage-Id: <A6EE4FFCF70108B8@daveland.demon.co.uk>
X-Useragent: Nuntius v1.1.1d7
X-Xxdate: Tue, 29 Sep 92 23:25:00 GMT

In article <de19-280992115841@mac19-pg2.umd.edu> Dana S Emery,
de19@umail.umd.edu writes:
>Oh, BTW, the symptom was a spurious link failure, referencing an
>(undefined) external symbol which n'exist pas, either in my code or in
>symantec's.
>

 Yep, the problem seems to be related to trying to compile stuff
 from other versions of Think (I'm on 5.02). It falls over at
 the first typedef in rather ill-defined circumstances. The header
 file certainly wasn't included twice since I added conditionals
 to prevent that.
 
-----------------------------------------------------------------
David Johnston:  davidj@daveland.demon.co.uk (Home IP connection)
-----------------------------------------------------------------
From: beard@toadflax.UCDavis.EDU (Patrick C. Beard)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Parsing text files
Date: 30 Sep 92 19:40:29 GMT
Reply-To: beard@toadflax.UCDavis.EDU (Patrick C. Beard)
Organization: UC Davis, EECS Division of Computer Science

In article <1992Sep30.140336.3663@ucsvc.ucs.unimelb.edu.au>,
u2005681@ucsvc.ucs.unimelb.edu.au writes:
> Hi folks,
> 
> I wonder if any of you people out there can give me some advice?
> I've been programming for quite a while but I havn't had much to do
> with the Mac file system and related toolbox calls.
> 
> As part of a new application, I am trying to read a text file of numbers
> and strings into a series of variables. The idea is to use the numbers as
> co-efficients for a simulation and the strings as labels for various graphs.
> 
> As I understand it, the Mac OS deals with text files as UNIX-C does with
> binary files ie you specify how many bytes to read and what buffer to read
> them into. But in the absence of a standard library, how is it possible to 
> read numbers and strings of differing lengths?

If you are programming in THINK C, use the ANSI library and save
yourself a lot of work.
With this library, you can open up files with fopen("filename", "r") and
use fgets or fscanf
to parse your input. Here's a fragment. Say your file has some numbers,
all floats:

1.23 0.345 100.2
[as many lines of this form as you like]

A small program to read this would be:

main()
{
  float a, b, c; // numbers we'll be reading in.
  FILE* f;       // stdio file pointer.

  f = fopen("file", "r"); // open the file for reading.
  while (fscanf(f, "%f %f %f", &a, &b, &c) != EOF) { // read the numbers.
    printf("a = %f, b = %f, c = %f\n", a, b, c);
  }
  fclose(f);
}

Reading strings is a matter of using %s rather than %f, unless of course
your strings
have embedded white space, which makes it more complicated. This should
get you started.

Good luck!

// Patrick C. Beard
// Department of Computer Science, U. C. Davis
// pcbeard@ucdavis.edu
From: jpugh@apple.com (Jon Pugh)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Restart @interrupt time with VN
Date: 30 Sep 92 03:38:17 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple Computer, Inc.

In article <1992Sep28.125124@cc4.kuleuven.ac.be>, stud08@cc4.kuleuven.ac.be
(Karl Pottie) wrote:
> 
> Hi,
> 
> I'm writing an init which reboots the mac after a system error. For this
> purpose, I call the toolbox routine Restart() at interrupt time. This
> works fine except when VM is running. When VM is running the mac simply
> blanks its screen and locks up. I tried using DeferUserFN(), but it didn't
> help.
> 
> How do I reboot (restart) a macintosh at interrupt time ? Any quick
> and dirty methods ? Any clean method ?

We spent a good half an hour laughing about this one in DTS today.  It even
got posted to the unofficial "Wall of Shame".

I think Baumwell's suggestion was best.  Stuff the MrBusError number into
the bus error exception vector, then execute that same bus error number. 
That way you get a double exception and the machine reboots.

Jon
Newsgroups: comp.sys.mac.programmer
From: jbush@magnus.acs.ohio-state.edu (J Eric Bush)
Subject: Re: What does DrawPicture() want?
Organization: The Ohio State University
Date: Sun, 4 Oct 1992 15:47:52 GMT

I have used DrawPicture quite a bit, and I admit that I am starting to read
this strand late in the discussion, but here is some pascal code that I
use with DrawPicture to draw PICT resources:

procedure DrawPict(whichPicture:integer);

var
     thePicture : PicHandle;
     myRect, pictureRect : Rect;

begin
     thePicture:=GetPicture(whichPicture);
     pictureRect:=thePicture^^.picFrame;
     SetRect(myRect,0,0,pictureRect.right-pictureRect.left,
          pictureRect.bottom-pictureRect.top);
     DrawPicture(thePicture, myRect);
end;

Note: if you want to display only part of a picture on the screen, then
      add another RECT variable and set that rectangle to the part of
      the screen you want it to display in (also works with regions),
      then call SetClip or ClipRect procedure followed by DrawPicture.

Hope this is what you wanted, if not, then disregard as 1's and 0's.
-- 
------------------------------------------------------------------------------
J. Eric Bush
Internet: jbush@magnus.acs.ohio-state.edu
Newsgroups: comp.sys.mac.programmer
From: niko@iastate.edu (Nikolaus E Schuessler)
Subject: Communication Toolbox
Organization: Iowa State University, Ames, IA
Date: Sun, 27 Sep 1992 15:46:15 GMT

I was just considering using the communication toolbox for a project,
but was wondering what part of the installed mac base do you exclude
by assuming the presence of CTB facilities.. all those before
system 6.05? 6.07? How many people are there still using systems that
don't support CTB? Enough to justify writing two sets of code?
Can you check at runtime if it is available? If so, how?

Thanks for any info..
-- 
Niko Schuessler               
Project Vincent Systems Manager              email: niko@iastate.edu
Iowa State University Computation Center     voice: (515) 294-1672
Ames IA 50010                                snail: 272 Durham
From: jpugh@apple.com (Jon Pugh)
Newsgroups: comp.sys.mac.programmer
Subject: Re: new icon suite calls slow?
Date: 30 Sep 92 04:00:27 GMT
Followup-To: comp.sys.mac.programmer
Organization: Apple Computer, Inc.

In article <keith-160992172244@kip-58.taligent.com>, keith@taligent.com
(Keith Rollin) wrote:
> 
> In article <7345@lib.tmc.edu>, draper@odin.mda.uth.tmc.edu (E.J. Draper)
> wrote:
> 
> > In article <REEKES-150992134346@90.10.20.67> Jim Reekes,
> > REEKES@applelink.apple.com writes:
> > >Now there's a bit of a delay in getting the icon out of the
> > >file's resource fork, but once it has it you can see that the window is
> > >quick to update and scroll around in.  This would lead me to believe that
> > >you can use the Icon Utility routines to draw icon efficiently.
> > 
> > I was under the impression that the Finder retrieved the icons from the
> > desktop database using one of the PBDTGetIcon() calls.
> >
> 
> It does, but:
> 
> o The desktop database isn't resource based under 7.0, and
> o The Finder caches the icons it finds

I think it still uses the resource manager to get custom icons from files
and folder's invisible files.  These aren't added to the desktop db but
they are cached.  You can see the delays when you open a folder full of
custom icons.

Jon
Newsgroups: comp.sys.mac.programmer
From: keith@taligent.com (Keith Rollin)
Subject: Re: Routines With Glue
Followup-To: comp.sys.mac.programmer
Organization: Taligent
Date: Sat, 3 Oct 1992 10:14:43 GMT

In article <scott.718061808@mcl>, scott@mcl.ucsb.edu (Scott Bronson) wrote:
> 
> In <winer.717955333@husc8> winer@husc8.harvard.edu (Adam Winer) writes:
> 
> >This brings up another point: what is the complete list of functions
> >with glue:  I know for a fact that HOpenResFile() and the high-level
> >hierarchical functions like HOpen() have glue.  Does anyone have a
> >full list?

Well, _you_ do. Just check your header files. Anything that doesn't have an
equals sign after it ends up calling a library/glue routine.

> 
> Here's an odd one that I ran across the other day.  GetHandleSize has
> glue that checks to see if the returned value is negative, and if so
> it returns nil.  How can one have a handle with *negative* handle
> size??  Sounds like fun.

The deal here (and with GetPtrSize) is that register D0 is used for a dual
purpose. Normally, it holds the result code from the call, which is a
negative number or zero. In the case of GetHandleSize, D0 is also used to
return the size of the handle. Therefore, the glue checks to see if the
return value is negative. If it is, then an error occured and zero is
returned as the handle size.

The Inside Macs indicate this in their discussions of the GetHandleSize and
GetPtrSize.

-----
Keith Rollin
Phantom Programmer
Taligent, Inc.
Newsgroups: comp.sys.mac.programmer
From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: Re: Q: How to tell the depth of screen?
Organization: Kalamazoo College
Date: Wed, 30 Sep 1992 18:56:10 GMT

tbl@rock.concert.net (Ted Lowery) writes:
>
>What is the best way to tell the depth of the default screen when
>your application starts up?  The way I am currently doing is to check
>SysEnvirons.hasColorQD, and if so, I create a color port...
>seems to me, there is probably a lot of overhead involved here, and there
>should to be a simpler way.

Yep.  Try (**(**GetMainDevice()).gdPMap).pixelSize.

>Also, what is the screen size of the 12" bw and color monitors like the 
>LC use?

Both mono and color 12" are 512x384.
-- 
 Jamie McCarthy      Internet: k044477@kzoo.edu      AppleLink: j.mccarthy
 I suppose ya don't think I was run over by a streetcar!
From: mkelly@mystix.cs.uoregon.edu (Michael A. Kelly)
Newsgroups: comp.sys.mac.programmer
Subject: CSMP Digest Moderator Retiring
Date: 28 Sep 92 06:32:38 GMT
Article-I.D.: cs.1992Sep28.063238.22491
Organization: University of Oregon Computer and Information Sciences Dept.


Due to a lack of time and motivation, I do hereby retire as keeper of the
Comp.Sys.Mac.Programmer Digest.  I hope someone will offer to take over this
most prestigous and rewarding position (ahem).  All persons volunteering for
this position should write to me - the first such person will receive
everything needed to continue the digest, and all subsequent persons' messages
to me will be forwarded to the first person, so that they can fight amongst
themselves to decide who gets the honor of continuing this monumental effort.

Later,

Mike.
-- 
_____________________________________________________________________________
Michael A. Kelly                                         University of Oregon
mkelly@cs.uoregon.edu                             Computer Science Department
_____________________________________________________________________________
Newsgroups: comp.sys.mac.programmer
From: keith@taligent.com (Keith Rollin)
Subject: Re: Disassembly with source in MPW?
Followup-To: comp.sys.mac.programmer
Organization: Taligent
Date: Wed, 30 Sep 1992 20:45:13 GMT

In article <1992Sep30.170119.412@col.hp.com>, chrism@col.hp.com (Chris
Magnuson) wrote:
> 
>   I must be overlooking something here...how do you get dissassembled output
> with source code interleaved in between?  I used DumpObj to get something
> of the form:
> 
>  00000000:   4E56 0000     LINK A6,#$0000
>    more assembly follows...
> 
> and the source lines are located later in the file.  Is there a way to
> get the source lines in the same listing as the assembly code with MPW?

There's a guy at Apple who wrote a tool to do this. The System 7.0 guys
used it to figure out what high-level code generated the best object code.
I'd send the tool to you, but the one I have is old and doesn't work with
MPW 3.2. Perhaps someone at Apple can make available the most recent
version, or you can try to duplicate what he did. I recall that the tool
was pretty small (10K or so) and worked from .o files created with -sym on.

-----
Keith Rollin
Phantom Programmer
Taligent, Inc.
From: Hank.Woods@p0.f222.n125.z1.FIDONET.ORG (Hank Woods)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Help re: hiding the menu bar
Date: 27 Sep 92 03:30:51 GMT
Organization: FidoNet node 1:125/222.0 - Macademe/Emma, San Francisco CA

> > I'm programming in Microsoft Quickbasic and would like to > make a

> routine that hidesthe menu bar so that the current window > covers

> the entire screen. Microsoft Quickbasic supports > traps to the

> toolbox; I suspect that I'll have to do it that way, > but I don't

> know which traps to use. > Can anyone suggest anything? 

> 

> GetMBarHeight() = 0; 

> 

> will do the trick in C. Thanks to "Mac Programming Secrets, 2ed" for

> this. I suggest you pick up the book since it's full of goodies like

> this.

 

What other goodies, soes the "Mac Programming Secrets, 2nd edition" have 
to offer, besides hiding the menu bar? Can you name another few goodies, 
that are mentioned in the book.



--  
Hank Woods - via FidoNet node 1:125/555
    UUCP: ...!uunet!hoptoad!kumr!fidogate!222.0!Hank.Woods
INTERNET: Hank.Woods@p0.f222.n125.z1.FIDONET.ORG
From: d91-jkl@nada.kth.se (Johan Klintholm)
Newsgroups: comp.sys.mac.programmer
Subject: Thinkpascal and vRefNum
Date: 29 Sep 92 15:57:18 GMT
Reply-To: d91-jkl@nada.kth.se (Johan Klintholm)
Organization: Royal Institute of Technology, Stockholm, Sweden
Originator: d91-jkl@hemul.nada.kth.se

Hi all experts!

I'm using Thinkpascal for Macintosh. (Not gladly but anyway...)

In Thinkpascal you have the eminent function OldFileName which opens a 
Open File... - dialog. Now this function only lists files with the type TEXT.
In order to keep track of my different datafiles I have implemented a file-
type called KRYS. This I did because I wanted to list in the dialog only 
the right kind of files. I can't see any way to tell OldFileName to filter
for KRYS-files only, and this leads to the conclusion that I must use the
procedure SFGetFile which has the capability to filter for different types.

I don't think that it's any idea to recode all filehandling routines to be the
ones in the system just to get this extra feature, so I want to use the 
Thinkpascal routines as far as possible.

Here comes the problem:

In Thinkpascal the filename contains the information of where the file is
situated on the disk. For example, the file  TEST.P is actually
HD:MY FOLDER:TEST.P  
However SFGetFile only returns the string TEST.P and the vRefNum.
Is there a way to (easily) convert the vRefNum into the ...:...:.. - standard?
In that case I could make an OldFileName of my own with filtering and then 
go on as if nothig had ever happened, using pascal routines as before.
OR... is there actually a way to tell OldFileName to filter for KRYS-files?

Any, and I mean ANY suggestions would be GREATLY appreciated.

----------------------------------------------------------------------------

Email: d91-jkl@nada.kth.se
Name : Johan Klintholm

---------------------------------------------------------------------------
From: WIS@LIVERPOOL.AC.UK
Newsgroups: comp.sys.mac.programmer
Subject: HELP - device drivers for tape drives
Date: 3 Oct 92 13:11:40 GMT
Organization: University of Liverpool

I have inherited a 150MB tape streamer (ARCHIVE VIPER mechanism) and have
played around writing some software to talk to it using the SCSI manager
calls. However, I get the feeling that I aught to be accessing it through a
device driver, and since this wasn't originally a Mac drive, it didn't come
with any software.

So, I'd better write one... This shouldn't be too difficult given the code
that I've already got, but what I need to know is whether there is a standard
name or DRVR resource number for tape devices, so that software written by
other people has a decent chance of finding it.

I suppose my best bet would be to try and imitate the Apple 40MB tape unit.

So:
    Does the Apple 40MB (or any other) actually use a device driver?
    If so, where can I find out some technical details for it
    (such as name, number, what status messages it returns, and what
     control messages it responds to) ?

Oh, and any general device driver help would be appreciated since I haven't
actually written one before - they look pretty straightforward, but is there
a standard method for installing them other than just copying them over via
ResEdit? A CDEV that actually performs some of the tape maintainance functions
would seem the neatest option to me...

Thanks!

Bill Sellers (wis@uxb.liv.ac.uk)
From: Andrew Gilmartin <Andrew_Gilmartin@Brown.Edu>
Newsgroups: comp.sys.mac.programmer
Subject: INIT/Startup App for deleting temp files
Date: 5 Oct 1992 20:14:39 GMT
Organization: Brown University
Distribution: world
NNTP-Posting-Host: cis_staff-kntx31.cis.brown.edu
X-UserAgent: Nuntius v1.1.1d7
X-XXMessage-ID: <A6F61B7BF101B075@cis_staff-kntx31.cis.brown.edu>
X-XXDate: Mon, 5 Oct 92 21:19:07 GMT

Does there exist a small utility, either as an extension or
startup application, that deletes all files in one or more
folders? Thanks.

-- Andrew
From: peirce@outpost.SF-Bay.org (Michael Peirce)
Newsgroups: comp.sys.mac.programmer
Subject: Re: JPartialResources.{c,h}
Date: 29 Sep 92 00:06:43 GMT
Article-I.D.: outpost.D2150035.epngja
Reply-To: peirce@outpost.SF-Bay.org (Michael Peirce)
Organization: Peirce Software
X-Mailer: uAccess - Macintosh Release: 1.6v1


In article <sdorner-270992111026@dorner.slip.uiuc.edu> (comp.sys.mac.programmer), sdorner@qualcomm.com (Steven Dorner) writes:
> k044477@hobbes.kzoo.edu (Jamie R. McCarthy) wrote:
> > ...and then how many users would upgrade to 6.1?  We'd still end up
> > having to write the dual-system code for the next n years, until a
> > sufficiently small number of 6.0 users remained.
> 
> System 7 will be two years old this coming spring.  1M SIMM's are $25. 
> Enough is enough; I'm making one more system 6 compatible release, and then
> I'm simply going to forget that System 6 ever existed.

My product Smoothie doesn't support System 6. It came out after System
7 had been around a while and it takes advantage of a number of System 7
features.

I've yet to have anyone complain about not supporting System 6...
(no doubt I'll get a complain about 15 minutes after I post this,
but so far so good!)

--  Michael Peirce      --   peirce@outpost.SF-Bay.org
--  Peirce Software     --   Suite 301, 719 Hibiscus Place
--                      --   San Jose, California USA 95117
--  Makers of...        --   voice: (408) 244-6554 fax: (408) 244-6882
--            SMOOTHIE  --   AppleLink: peirce & America Online: AFC Peirce
From: mgeorgy@vmsclst1.sc.csupomona.edu
Newsgroups: comp.sys.mac.programmer
Subject: Screen Capture prob.  Please HELP!!!!!!
Date: 30 Sep 92 08:34:21 GMT
Organization: Computer Science Computational Systems
Nntp-Posting-User: mgeorgy

Hello I am just starting to program the Mac, because I want to, and because I
need to for a class.  Anyways the program I have just finished is very simple,
it has no menu's nothing just a single window with my junk in there, to quit
you simple hit the mouse button and voila...  Anyways my instructor would like
a print out of what I have on the screen, easy.... or so I thought, I figured I
could just hit the ol CMD-SHIFT-3 and get a great picture that I could print
out..... WRONGGGGGG.  When I try the combo nothing happens, in frustration I
hit it about ten times.  Well most of you will know what happens next.  I click
the mouse button get back to the finder (system 7.0) and I have 10 great
pictures of the finder.  Because my program does not deal with this event it
simple keeps it in the EVEN QUEUE until the program quits and the finder takes
care of them.  Finally, here is the question, what do I need to add to my
program so that I can capture the screen image or is there and easier way of
just printing the screen (but, I don't own an ImageWriter II)....

Someone Please Help,
Matt Georgy
California State Polytechnic State University, Pomona  -- Computer Science
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+When It Absolutely, Positively, Has To Be Taken Out Overnight!!!+
+                                                                +
+                                           -- Team Stealth      +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
From: yjc@po.cwru.edu (Jerome Chan)
Newsgroups: comp.sys.mac.programmer
Subject: CTB Questions and Answers
Date: 5 Oct 92 04:11:22 GMT
Followup-To: comp.sys.mac.programmer
Organization: The Tofu Society of Singapore
NNTP-Posting-Host: b61539.student.cwru.edu

I've had several questions about the Communications Tool Box and now I have
some muddled Answers.

1) How do I set the size of the Window Before Calling TMNew?
   Call TMNew with an invisible Window. Then call TMGetTermEnvirons,
calculate the actual size of the window from textRows,textCols,cellSize or
graphicSize, resize the window and make it visible. Do I have to worry
about changing the termRect, viewRect and visRect values?

2) Can anyone explain what a MyClickLoop is supposed to do?
   Someone replied that all it did was to return true if the click was in
the cached region. If I'm not implementing a cache reqion, I can put a 0L
for the myClickProc parameter in TMNew? I don't have to worry about
highlighting and such?

---
 The Evil Tofu
Newsgroups: comp.sys.mac.programmer
From: resnick@cogsci.uiuc.edu (Pete Resnick)
Subject: Re: popup menus in non-system font
Organization: University of Illinois at Urbana
Date: Mon, 28 Sep 1992 18:36:19 GMT

jeremyr@dcs.qmw.ac.uk (Jeremy Roussak) writes:

>The answer to your question, though, depends on what you mean
>by "permanently". Unless you can guarantee that no-one else
>will change it to 12 (typically) during the execution of your
>program, you can't change the value to 0 "permanently", since
>(as I understand it) the WMgr(C)Port is a system-wide
>structure, not one of the ones of which each app has its own
>copy.

I was thinking of changing it to 0 on initialization and on every
activate event, which should be permanent enough for me because...

>Why is it so difficult for you to change it before each call?
>Can't you just write a sort of "glue"?

The problem is that I wanted to use the popupMenuCDEF in my control
panel. Because this is a control panel, I don't get mouse-down events
when the popup menu control has been hit. All I get is a hitDev
message after the mouse has been released. That means that I can't
pre-set txSize to 0 and then unset it after the menu has popped up. So
if I reset it at initialization and whenever I get an activate event,
I figured I would be safe. I may not do it anyway, just so I can say
how horrible MS and Claris are in my "Known problems" section of the
documentation. :-)

Control panels are such a pain.

pr
-- 
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet: resnick@cogsci.uiuc.edu
Newsgroups: comp.sys.mac.programmer