[comp.sys.mac.digest] Delphi Mac Digest V3 #42

SHULMAN@sdr.slb.COM (Jeffrey Shulman) (10/14/87)

Date: Sun 6 Sep 87 15:20:11-GMT
From: Jeff Shulman <SHULMAN@SDR>
Subject: Delphi Mac Digest V3 #42
To: Delphi-List: ;
Message-ID: <557936412.0.SHULMAN@SDR>
Mail-System-Version: <VAX-MM(218)+TOPSLIB(129)@SDR>
ReSent-date: Wed 14 Oct 87 13:36:17-EDT
ReSent-from: Jeff Shulman <SHULMAN@SDR>
ReSent-to: post-info-mac@ucbvax.berkeley.edu

Delphi Mac Digest     Sunday, September 6, 1987      Volume 3 : Issue 42 

Today's Topics:
     HyperCard logic problem (6 messages)
     Warning about HyperCard Stacks
     Field glitches
     2000 and Mac II (3 messages)
     RE: SIZE resource
     RE: object-oriented c (4 messages)
     re: SE Internal Hard Disks (2 messages)
     Re: Hard Disks
     HyperCard Linking and Scripts
     function pointers in C (3 messages)
     HyperCard modification date contaminatio
     OCR Scanner (3 messages)
     HyperCard overlapping buttons
     Importing, sorting, and compacting (2 messages)
     HyperCard Fields
     RE: Usenet Mac Digest V3 #64
     SIMM RAM for the MacII
     RE: Calculating a new Menu on the spot
     A C formatter (2 messages)

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

From: MACWEEKBOS
Subject: HyperCard logic problem
Date: 28-AUG 10:17 Programming

I ran into a weird problem with HyperCard that seems like a programmer
error at first, but is so simple, I can't see a problem. I've got a
button (background) that is to go to the recent card unless it's the
first card in the stack where it should do nothing. I can get it to work
by putting in an IF statement on Card Number = 1. However, if I use the
Card ID (found via Card Info menu) as a test, it doesn't work! It seems
as if the card id has been screwed up somehow, and displays in all cases
differently from what it is. (I "Put" into Message and it looks right). 
Guess I'll try cutting and pasting the card, but that's a hassle.

Ric

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

From: PEABO
Subject: RE: HyperCard logic problem (Re: Msg 22111)
Date: 28-AUG 13:57 Programming

If you want it to work on the first card of a stack, then you don't want
to use the card ID (because the card could be moved but its ID would not
change). So, using card number = 1 is the right thing to do.

I think there is also a distinction between short name of the card and
long name of the card which might have something to do with this.

peter

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

From: STEVEMALLER
Subject: RE: HyperCard logic problem (Re: Msg 22111)
Date: 28-AUG 10:20 Programming

Ric,

Can you post the script in a message so we (I) can see what you're
trying to do?


    Steve Maller
    Apple Computer

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

From: MACWEEKBOS
Subject: RE: HyperCard logic problem (Re: Msg 22115)
Date: 28-AUG 14:20 Programming

Argh... it's kind of proprietary, otherwise I would've posted it (the
info in the stack is proprietary). I did try cutting and pasting the
card to get a new ID, and that didn't help. I'll see if I can dig up the
long/short stuff.

Actually, though "number = 1" is right for now, I envision this becoming
subservient to something else in the stack, so I want to use the card
id, rather than the card number.

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

[from memory...]

On MouseUp
  Get the id of this card
  if it <> 3042 then go to recent card
End MouseUp

[the above doesn't work, what does is the below]

On MouseUp
  Get the number of this card
  if it <> 1 then go to recent card
End MouseUp

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

Ric

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

From: PEABO
Subject: RE: HyperCard logic problem (Re: Msg 22117)
Date: 28-AUG 17:02 Programming

What do you get in "it" when you say "get the id of this card"?  Chesley
recommends using the message box as a handy place to display debugging
information.  ("show msg" and "put it in msg" does that, I think.)

peter

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

From: MACWEEKBOS
Subject: RE: HyperCard logic problem (Re: Msg 22120)
Date: 28-AUG 18:10 Programming

Yeah, I did exactly that to make sure I had the id correct. What showed
in the message box was the same that showed in Card Info.

Ric

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

From: PEABO
Subject: Warning about HyperCard Stacks
Date: 28-AUG 14:03 Creative Pursuits

HyperCard stacks are opened in read-write mode, and updates are near-
instantaneous (that is, there is no separate step of saving changes like
there is in many other Mac documents).

What this means is that if you are downloading and uploading stacks, you
should ALWAYS make a copy of the stack before clicking on it, and upload
the original rather than the copy!  Most stacks will probably not modify
themselves just because you ran them, but I saw an example of a stack
which had some stuff erased out of it by the time it got to me.  I guess
someone was experimenting with it and didn't realize they were making a
permanent change!

Please post this message on BBS systems so the word will get out about
this hazard.

peter

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

From: MACWEEKBOS
Subject: Field glitches
Date: 28-AUG 18:13 Bugs & Features

Here's another weirdo problem. I've got a field defined to "show lines"
and it doesn't. Changing fonts and sizes doesn't seem to matter and I
don't think I'm doing anything unusual.  (It's a scrolling field.)

Ric

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

From: INTECO
Subject: 2000 and Mac II
Date: 28-AUG 13:49 Programming Techniques

Well I hit the 2000... but nevertheless:

Hierachical menus are very nice but how can I find out the position in a
hierachical menu (e.g. font names) if I want to open another h.menu
related to it (font sizes). ??? Further we had a funny observation under
finder 6.0 that we had to lock the menus to run ...

Uwe

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

From: SOCCERKING
Subject: RE: 2000 and Mac II (Re: Msg 2000)
Date: 30-AUG 23:26 Programming Techniques

I assume the following about the structure of the hierarchial menus you
are talking about. If i am sounding redundent or if I am way off track
please forgive me.

Any menu item that has a submenu has the postfix "'|'ID num" where ID
num is a resource id for a independant menu. The MDEF creates an
illusion of hierarchracy. MenuSelect returns the MenuID of the submenu
in which the item was selected. The Item number is just like any other
menu item number.

Therefor to get an individual menu item you simply use the menu manager
in the usual way.

brent.

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

From: PEABO
Subject: RE: 2000 and Mac II (Re: Msg 2017)
Date: 31-AUG 21:14 Programming Techniques

Say you have a menu with items A, B, C, and D on it, which are font
names.  You would want to create 4 different submenus, each with a list
of font sizes for the corresponding item on the main menu (call them 1,
2, 3, and 4).  Then you set up the main menu so that 1 is attached to A
only, 2 to B, and so on.

Does this make sense? peter

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

From: PEABO
Subject: RE: SIZE resource (Re: Msg 22130)
Date: 29-AUG 21:17 Network Digests

>From: tomc@mntgfx.MENTOR.COM (Tom Carstensen)
>Subject: SIZE resource
>Date: 24 Aug 87 18:25:14 GMT
>Organization: Mentor Graphics, Beaverton OR

>Can anybody either explain, or point me in a direction about what
>exactly the SIZE (ID = -1) resource is supposed to contain, in terms of
>min/max size, and the other fields?

ResEdit knows the format of this resource, so you can either just use
ResEdit or you can look in the TMPL for SIZE.  It is also documented in
the Switcher programmer's guide somewhere:  a word containing the flags
for suspend/resume events and automatic screen save (and more things
now, under MultiFinder) and two longwords giving the minimum and maximum
memory size values.

peter                          "In any context, half of all references
PEABO @ DELPHI                  are local and half are global."

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

From: JIMH
Subject: RE: object-oriented c (Re: Msg 2005)
Date: 30-AUG 02:10 Programming Techniques

Peter, oh and by the by do you (or anyone else) know any slick tricks to
clip white space off the edge of a macpaint file?  best jim

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

From: PEABO
Subject: RE: object-oriented c (Re: Msg 2007)
Date: 30-AUG 10:58 Programming Techniques

The 128K ROMs have a trap in them that does the lasso function, don't
they?

However, for your application, just getting the smallest bounding
rectangle may be enough (or maybbe make it a bit larger).  I'd just do
it by slavishly examining the top and bottom for blank scan lines and
then working in from the two sides.

peter

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

From: JIMH
Subject: RE: object-oriented c (Re: Msg 2008)
Date: 30-AUG 15:54 Programming Techniques

Peter, thats what i did but it is a little slow on a mac II cant guess
what it would be line on a +.  best jim

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

From: ASMCOR
Subject: RE: object-oriented c (Re: Msg 2007)
Date: 31-AUG 19:53 Programming Techniques

  Jim - take a look at CalcMask, I think that's what you want. Page 24
of volume 4 of IM.
  Jan

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

From: MACWEEKBOS
Subject: re: SE Internal Hard Disks (Re: Msg 22130)
Date: 30-AUG 12:14 Network Digests

To: kiyun@prism.UUCP 
Subject: SE Internal Hard Disks

A review of internal hard disks for the Mac SE (which I wrote) appears
in the July 20 issue of MacWEEK. You might want to ask them for a copy
(415-882.7370). I had no way of evaluating reliability, except for minor
notes about problems experienced in the few weeks I had (assumed to be
software and cabling problems), although I'd assume that Rodimes and
Conners are reliable from experience with these drives in the past
(Conners being used in HyperDrive FX/40s and ProApp 40s). There were
substantial speed differences between the products, even those using the
same hard disk (due, no doubt, to the driver code). In the end, my
experience in the review convinced me I didn't want an internal hard
disk at all.

Ric Ford "MacWEEK" Boston bureau

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

From: JIMH
Subject: RE: re: SE Internal Hard Disks (Re: Msg 22144)
Date: 30-AUG 15:52 Network Digests

Ric, by the by the last issue of macweek quotes someone from adobe as
saying they get $250 per laserwriter.  Scott Knaster told me it was
$1500.  best jim

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

From: MACWEEKBOS
Subject: Re: Hard Disks
Date: 30-AUG 12:36 Network Digests

>to: raifer@net1.ucsd.edu (Dan Graifer)
>Subject: Re: Hard Disks

1) I'd suggest using 1 field/line format rather than tab-delimited
format, because of all the different ways tabs get treated along the
line and because it's hard to tell sometimes when a field is
accidentally dropped. (probably each field should be of the form
<label>/<data> like this: "mfg/SuperMac Technology")

2) Noise is *so* subjective, I don't know how you can rate it
consistently when every reporter is different.

3) Capacity should be *formatted* capacity as reported by the Finder
(3.2 and greater).

4) Termination should be listed (Internal/external)

5) SCSI addressing should be listed (VARIABLE/FIXED,
button/jumper/other, range: 0-6, 2-5, etc.)

6) Port should be listed as SCSI or DB25

7) Should DiskTimer II results be MIN() or AVERAGE(). The results are
not constant from run to run.

8) Reliability, I'd suggest, should be made more quantifiable: number of
failure/number of months in use

9) Responsiveness the same: number of answers/number of calls; and
average length of call

10) Software is a big category, but there's only one important item, not
spoolers, not backup (because they're available separately), but
*formatting*.  That is, what does the formatter do? Can it update
without reinitializing? Can it test the disk? (with/without destroying
data). Can it set the SCSI ID? Does it give low-level info (bad
blocks,etc.); low-level editing of data?  Can it mount a disk that
doesn't want to mount? Does it *work*?

11) I'd add a second, "real world" disk performance test. I've used one
in a number of different reviews and it has proven to be a good
indicator: copy a large file (766K was used, an HFS Backup floppy file)
in the Finder and see how long it takes (avoid fragmentation, make 5
trials). Do it by selecting the file and saying "Duplicate."

Ric Ford Technical Editor, MacWEEK Boston bureau

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

From: MACWEEKBOS
Subject: HyperCard Linking and Scripts
Date: 30-AUG 15:20 Programming

Well, I tried using the link checkbox on a card that had a fairly
extensive script. The result was that HyperCard automatically went into
the script, found the Go To command, and changed it to reflect the new
destination without deleting or changing other parts of the script! I
don't know what happens if you have two or more GO To's in your script.
Maybe it takes the first one, or maybe the one outside an IF.  Dunno.

Ric

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

From: JOSEF
Subject: function pointers in C
Date: 30-AUG 19:55 Programming Techniques

Could one of you C experts straighten me out on something?  I've always
been a little hazy when it comes to using function pointers in C. If I
want to declare the variable 'ptf' to be a pointer to a function I
presume I do this with

        int (*ptf)();   /* pointer to function returning an integer */

Now I believe the correct way to invoke the function pointed to by ptf
is:

        (*ptf)();

What's causing my confusion is that MPW apparently allows one to invoke
this function with the statement:

        ptf();

as well as in the previous style.  However LSC forces you to include the
asterisk. In my opinion MPW is dead wrong.

Joe

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

From: PEABO
Subject: RE: function pointers in C (Re: Msg 2012)
Date: 30-AUG 21:38 Programming Techniques

The rule in C is that when you declare an identifier, you use the same
synactic form you use when referencing it later.  So, it does look like
MPW is wrong. However, maybe it is just the compiler not complaining
about something which will produce crazy results at runtime.  Have you
tried executing the funny function call?  Is there any kind of strong
checking of pointer-integer conversions you can do during the compile
using a switch?  IF so, you might find that there is an illegal
conversion going on that the compiler isn't telling you about.

peter

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

From: JOSEF
Subject: RE: function pointers in C (Re: Msg 2014)
Date: 30-AUG 22:40 Programming Techniques

The 2 forms generate identical code in MPW.  LSC will not even compile
the "incorrect" form.

Joe

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

From: PEABO
Subject: HyperCard modification date contaminatio
Date: 31-AUG 00:39 Programming

I did some experiments and determined that if you open any HyperCard
stack, the Home stack does get opened for update and gets its
modification date restamped but nothing else happens to it.  If you open
the Home stack directly, the stack gets modified because of the timer
hack that displays "Card field ID 65" as hours and minutes.  This could
be fixed by disabling the timer hack in the Home stack script (where
ever it is, I didn't look for it).

You're right though, this is a real PITA for automatic backup programs. 
I hate to suggest it, but maybe we need an "untouch" program that runs
around and resets the modification dates of stacks you know have not
actually been modified.

:-( peter

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

From: MEUSE
Subject: OCR Scanner
Date: 31-AUG 21:35 Hardware & Peripherals


A rep from IOC recently brought their OCR Scanner to our store to demo
it for us.  It was pretty impressive.  It will take a typed page and
convert it to a MacWrite or Microsoft Word doc. It did pretty well on a
not-so-good Xerox of the same page. It can scan and convert the doc in
about a minute. As I understand, Olduvai's Read-It software, which works
with any 300dpi scanner, is slower and only creates an ASCII file, not a
formatted document. At present, IOC's scanner has 8 built-in fonts and 2
selectable. Unfortunately, they don't support Apple's LaserWriter fonts
at present, but I was told they were in the works.  I was also told that
it will have the ability to learn fonts in the near future. We will be
getting one for a 2 week review, I'll let you know how it goes.

Steve

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

From: MACWEEKBOS
Subject: RE: OCR Scanner (Re: Msg 22159)
Date: 31-AUG 23:55 Hardware & Peripherals

Steve,

It sounds great. I look forward to hearing the results of your own,
hands-on testing.  What's the cost?

Ric

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

From: MEUSE
Subject: RE: OCR Scanner (Re: Msg 22163)
Date: 1-SEP-18:11: Hardware & Peripherals


The retail price is $3495.  It should arrive tomorrow.

Steve

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

From: MACWEEKBOS
Subject: HyperCard overlapping buttons
Date: 1-SEP-21:02: Business Mac

I tried to do some semi-tricky things with overlapping buttons and the
send-farther/bring-closer commands. The whole thing seemed to get pretty
screwed up. Does anyone know how overlapping buttons are supposed to
perform? Is there any way to create some sort of non-rectangular
buttons?

Ric

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

From: PEABO
Subject: Importing, sorting, and compacting
Date: 2-SEP-17:39: Programming

I have written a small HyperCard stack that imports a file of
comma-delimited items (look for it in the Database as "File Catalog
Example" later this evening).  I discovered a few things about HyperCard
performance.

Importing a 480K text file with 7500 records took a couple hours (sorry,
I didn't time it!) and produced a file nearly 2 megabytes long.  This
file claims to have only 7K free, but see below.

I then sorted the file on one of the fields ... this took 35 minutes.  I
tell you, it is easy to get hypnotized by that beachball!  I was
watching it sort and the beachball rotates at different rates depending
on the proportion of disk I/O vs. CPU crunching, so it has the most
interesting patterns of activity during the sort.  However, I failed to
discern the algorithm Bill uses from my examination of the pattern :-)

The sort is evidently a tag sort, which changes pointers to cards but
doesn't move the data.  I should probably do some more research on this
to verify what I'm saying by dumping out some smaller examples, but I'm
concluding this based on the fact that it took 49 minutes to do a stack
Compaction after the sort, and it seemed to be doing a lot of I/O.  I'm
running a Compaction on the unsorted stack now to see if it takes as
long!  (If anyone has any hard evidence of what HyperCard actually does
during sort and compaction, please let me know.)

The interesting thing is that after compaction, the stack was only
1250K, not 2 megs minus 7K free space!  Evidently the cards must get
overallocated to allow for expansion of the fields, and since this
allocation is not included in the free objects, it doesn't get shown in
the stack statistics.  Once again, some research into this would
probably produce some interesting results.

The moral of the story is that you should compact your stacks after
doing any kind of serious messing around with them, because they may
shrink more than you expect!  But beware:  compaction could take a while
on a big stack. Also, I'd treat compaction with the same care that you
give to a disk compactor!  Make a backup first, in case of trouble in
the middle of compaction!

(hmmm ... the compaction of the unsorted stack is still going after
nearly 10 minutes ... this definitely bears investigation)

 peter
 a/k/a Stackware Detective 2nd Class

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

From: PEABO
Subject: RE: Importing, sorting, and compacting (Re: Msg 22186)
Date: 2-SEP-17:54: Programming

OK, I take it back ... that compaction is still running!  Maybe it
doesn't make any difference at all whether the stack is sorted or not in
how long it takes to compact.  I'll get the X-Ray out tonight.

 peter
 a/k/a Stackware Detective 3rd Class

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

From: LAMD
Subject: HyperCard Fields
Date: 5-SEP-02:02: Programming

I've written a Script that reads a text file into a card field -
sometimes, the text appears properly in the field; at other times, I
have to click somewhere in the field (or select some test and scroll
upwards) to get the text to appear.

Anyone know why this is happening?    -Franklin

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

From: DSACHS
Subject: RE: Usenet Mac Digest V3 #64 (Re: Msg 22207)
Date: 5-SEP-15:10: Network Digests

>To: korn@cory.Berkeley.EDU (Peter "Arrgh" Korn) 
>Re: SIMM RAM for the MacII

 150 NS SIMMs are NOT guaranteed to FAIL if used in circuits requiring a
faster access time.  They just aren't guaranteed to work.  You were
probably lucky. Some of the 150ns parts contain chips that FAILED at a
faster access time, though many were just not tested.

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

From: PEABO
Subject: SIMM RAM for the MacII (Re: Msg 22207)
Date: 5-SEP-19:10: Network Digests

>From: korn@cory.Berkeley.EDU (Peter "Arrgh" Korn)
>Subject: SIMM RAM for the MacII
>Date: 1 Sep 87 05:09:35 GMT
>Organization: What, me organized???

All RAMs fall into a region of performance (sometimes called a "schmoo"
by testing engineers because of its resemblance to the shape of the Al
Capp cartoon characters) which delineates their access time vs.
temperature, or supply voltage, or maybe phase of the moon (i.e., age of
the chip).

The schmoos of 120 ns chips and 150ns chips probably overlap.  It sounds
like your Mac II with 150 ns chips is running in the overlap, but it
would be difficult to say how close to the edge you are, and what will
happen to your hard disk if you get too close.  Personally, I wouldn't
take a chance with it.  There is probably a good reason for Apple to
have specified 120ns.

peter                          "In any context, half of all references
PEABO @ DELPHI                  are local and half are global."

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

From: PEABO
Subject: RE: Calculating a new Menu on the spot (Re: Msg 22208)
Date: 5-SEP-19:24: Network Digests

>From: larryh@tekgvs.TEK.COM (Larry Hutchinson)
>Subject: Calculating a new Menu on the spot.
>Date: 3 Sep 87 18:26:21 GMT
>Organization: Tektronix Inc., Beaverton, Or.

>What is the proper way to calculate and install a revised menu when the
>user presses the mouse button in a specific menu title in the menu bar?

Do what MacApp does -- use your technique of deferring the changes you
want done and make sure they are done (for the whole menu) before
allowing a menu selection, but also use the spare time in your idle loop
to catch up with pending changes one at a time.  In many cases, the
catchup will be complete before you try to pull down a menu.

peter                          "In any context, half of all references
PEABO @ DELPHI                  are local and half are global."

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

From: SOCCERKING
Subject: A C formatter
Date: 5-SEP-16:49: Tools for Developers

I am considering writting a C formatter for MPW C. I am currently
gathering ideas for it, if you have any ideas, suggestions, ect. I would
appreciate them. brent.

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

From: PEABO
Subject: RE: A C formatter (Re: Msg 2037)
Date: 5-SEP-18:35: Tools for Developers

(1) take a look at Shebanow's Print program for bolding ideas.

(2) whatever you do, don't get involved in the religious wars about the
following:

     if (boolean) {
         blah blah
     }

     if (boolean)
         {
         bla blah
         }

Take a look at my program Prototype Maker.  In the Setup dialog there is
a PrettyPrint button that takes you to a dialog that lets you select
your preferred indentation style (even to some styles nobody on Earth
has even been seen using :-)  The resulting preference can be saved as
part of the 'Cnfg' resource the program reads from a startup-document,
and from there can be ResEdit copied into the application if the user
wants.

Shebanow's program is either here in Tools or in MacSIG topic
Programming.  My program is in MacSIG Programming.

peter


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

End of Delphi Mac Digest
************************
-------
-------