Feb 87 Mousehole
Volume Number: | | 3
|
Issue Number: | | 2
|
Column Tag: | | Mousehole Report
|
Mousehole Report
By Rusty Hodge, Contributing Editor, Mousehole BBS
Were taking bets: What is Apple going to introduce at the MacWorld Expo in San Fransisco? Some people think Apple will introduce the next progression of the MacPlus. Some people think Apple will wait. IBM has bought a bunch of time during the Super Bowl, so Apple may not have a terrific advertisement waiting for us. Oh well, the world will be in better focus after the Expo.
ShareWare -- it works!!!
From: Go
Well, whaddya know? The shareware system of software distribution actually works! A mere 13 months after I finished the first version of my program (the FONT-FKEY-DA Sampler), I finally received a check for $10 from a satisfied user! Its good to know that there are people out there in MacLand who appreciate the value of good programs, and make us programmers actually feel good about writing them. Thanks people, your contributions will certainly go to a good cause (like renewing my MacTutor subscription!). [This guy could use some money! How about sending in those shareware fees folks? -Ed]
Job Security
From: Macowaco
A way to keep your job no matter what....write in Forth. Pro3D is all in Forth.... AND ONLY ONE GUY KNOWS THE CODE! Something to consider when thinking about which 3D drawing app to go with. [I used to write PDP-8 asm test programs at Hughes for the same reason! -Ed]
Microphone Patch
From: Katz
I came up with a patch for Microphone to skip the opening dialog box.
Search for: 4EAD 0582
Replace: 600A 0582
FEdit on big disks
From: Bob Denny
For those interested, I had FEdit 1.0.1 using it on the PROApp 40MB disk Im testing. It acted pretty funny, with Unknown node type in catalog... alerts, etc. I had just done something I wasnt confident in anyway, so I went to reconstruct the disk. Turned out to be FEdit. Get the later version (1.0.7). The bug is fixed since version 1.05. PS: The bug seems only to show on 40MB disks, not 20MB, etc. [Note: MacTutor is now shipping 1.07 of FEdit, which is the latest as of 1/5/87. The bug affects only drives over 32MB. A new version 2.0 is due to ship sometime in February. Registered owners will receive update information in the mail. -Ed]
EXCEL bug
From: Macowaco
We got a bug in 1.03. When trying to cut and paste between two linked worksheets up came the bomb. It was very replicable but also due to the contents of the worksheets.
[Then there is the bug that makes the row labels dissappear, and re-calc bug, and so on... A lot of people think the original version is less buggy! Just watch out for the exploding print command when using old MFS-saved documents. - Rusty]
Backing Up with MacBack
From: Rick Boarman
Anyone out there use a MacBack Plus scsi tape unit? We sold one to a customer last week and when I went to set it up I ran into problem after problem. The unit itself is pretty well made, clean looking, quiet.... Reading through the several page preliminary manual I found no reference to hooking it up to a Mac+. Not one word. They did write several paragraphs about using it with their 512k SCSI port adapter. Lot of help that does Mac+ users! Being the hacker I am I tried it anyways (What Mac user needs instructions!). I hooked the 50 to 50 SCSI cable to my DataFrame and to the MacBack. When I tried to boot -- nothing. Being that the Macback is silent and it has no power light I tried several times with the power switch in each position. Still nothing. It was time to call tech support. Looking in the manual I couldnt find their phone number nor their address. Not even what city they are in! After a number of calls and some research I finally found that they are in Santa Clara. When I called I got a recording saying that the number was disconnected. Some more calls later I found that they moved to a new location. The tech person I eventually got through to was friendly enough but didnt even know what a mouse is. After each question he put me on hold to ask someone else the answer. Finally I asked to speak to his boss and was able to get some help. They suggested I change the ID# of the tape drive. Still no go. They also had me try different cable configurations with no success. The verdict was DOA. Send it back.
That was yesterday. Ill keep you posted on how things go. So far, a terrible manual, no power light, awful support and a dead on arrival unit leaves me unimpressed. Are there ANY good tape backups out there? [Try the new 40meg tape backup unit from SuperMac Technologies. Should work great with DataFrames, since both are by the same company. New at the SF Mac Expo this week. -Ed]
Hard DIsks: This is getting silly
From: The Psuedohacker
Hey guys, this is getting silly. The continuing debate between the Proapp 40S and the Dataframe is kind of pointless now. Everyone should be convinced that both drives are excellent products. Im not just saying this because Jim is a friend of mine. I recently bought a ProApp 40S for a client and it is hot stuff. I did do some testing with it on my own before I delivered it to the client, and yes, its true its not as fast as my Micah AT20. But then again, Proapp is still in business! Im having my doubts about Micah.
Jim is right. The 40S is incredibly quiet, DURABLE, and fast. Keep in mind when youre discussing differences of 55ms versus 162 ms, lets be real. The average person will NEVER notice it. Youre talking 1000ths of a second.
Obviously Scott is sold on his Dataframe. Im glad for you. Now why dont you guys go on to other topics like setting up a user defined bench test, i.e. how fast can Excel load a predetermined file, of a predetermined size. How fast can it save?, etc. Get down to some criteria that really mean something to the user.
From: Macowaco
I love the debate. I also love both drives. There is another couple of factors that must be considered. One is the nifty factor. How nifty do the users think the thing looks or acts....Both win. A more important factor though is how easy is it to communicate with the HDs producers. Iomega is about to get nailed by actions taken by me and others at my co. due to their incredible stupidity. The story will leak to the press too. Tuff noogies on them! ProApp has been very cooperative, while DataFrame is a no show. I just wish I could have one at home..., but Id rather wait three months so that the only speed factor will be the HDs performance and not the ext SCSI throughput.
Disk Drive Dementia
From: Bob Denny, Editorial Board Member
Well, here I am in the middle of the great disk war. I am testing a PROApp 40 and (hopefully soon) a DataFrame 20XP. After bumping into Mac Scotty and finding out what the XP is ... Im AGAHST! If I understand him, the XP upgrade is essentially a re-written SCSI manager (done the right way, I presume). They put the additional code in a ROM in the disk drive, then their boot driver reads it in and replaces the Apple SCSI manager with their own (or at least part of it). Uh ... at least that is my best guess. In any case, Im aghast because DataFrame folks had to throw out the Apple SCSI manager to get the performance.
[Im using the Dataframe 20XP and love it! Fast, no problems. Ive ordered the 40XP. They also work fine daisy chained with Apple SCSI drives as Ive tried that too. -Ed]
Speaking of sector interleave, I beg to differ with opinions expressed here before. The ONLY reason to interleave sectors on a disk is to compensate for an interface that cant handle the full data transfer rate of the disk. A given disk drive has a native transfer rate that depends on the bit density, data coding and spindle speed of the drive. If the interface to the computer is too slow for the drives data rate, then the controller chokes on reads (from disk) and starves the disk on writes (to disk). When this happens, the transfer must be suspended until the interface catches up. This kind of error is called a data late error.
Normally, when a disk is formatted, the sectors on a given cylinder are numbered sequentially. However, the controller looks for the sectors header when told to read a given sector. It does not transfer the data until it sees the header (with the sector number) sector it is looking for. Therefore, you could write a disk formatting program that numbered the sectors in any order you want. If they are numbered in other than physically sequential order, they are usually interleaved. For example, instead of 1,2,3,4,5,6,7 you might number them 1,5,2,6,3,7,4 (the example shows 2 to 1 interleaving).
Interleaving the sectors on a disk effectively reduces the drives transfer rate by inserting dead time between sequentially numbered sectors. Take the above 2:1 interleaved format for example. Lets say were transferring 4 sectors starting at sector 1. We see 1 (go) then 5 (oops, wait) then 2 (ok, go) then 6 (wait) then 3 (go) then 7 (wait), then 4 (go). The 2:1 cut the average transfer rate in half.
Why interleave? Suppose the interface was almost as fast as the disk. After the first sector comes off the disk (were reading) the controller is a bit behind getting the data into the host memory. But come hell or high water, here comes the second sector. Well, the controller just isnt ready yet ... DATA LATE ... and now we have to wait for the disk to spin clear around until the second sector is again under the head, at which time the controller is (surely) ready and the second sector may be read. Well... if there are 32 sectors on a track, this could cause a slow down of a factor of 32!!! So the 2:1 interleave is the lesser of 2 evils, since it only causes a 2 for 1 slowdown.
Now THIS IS IMPORTANT!!! The sector interleave is NOT a measure of performance! Just because the Micah and Dataframe XP use 1:1 interleave and the PROApp uses 5:1 does NOT mean the PROApp is 5 times slower to transfer. My guess is that the native data transfer rate of the drive in the PROApp is a lot faster than that for the other drives. The PROApp would be using 2:1 interleave or maybe 3:1 even if it could transfer at the XP rate.
In other words, the drive in the PROApp is probably capable of the highest performance of the bunch, but it is relegated to the substandard performance of the Apple SCSI interface. Only the DataFrame guys have figgered out how to replace the Apple junk. So, for the time being, the benchmarks look good for the DataFrame. But what will happen on the Aladdin or the Paris? Do you think Apple fixed the SCSI manager? [We invite SuperMac Technologies to respond to this challenge and explain how their ROM patch works or will work on the new Macs. -Ed]
List manager
From: The Atom
Im trying to get a list of text items (1 col, about 50 rows) to work using the List Manager- but Im having a terrible time dechipering IM on the subject.
First, it says you can have the LM define cellSize itself if you dont pass it a CSize when you define the list. HOW do you not pass a parameter? I tried setting it to 0 (strange results) and anything else I could think of, but no dice.
And how do I set it so only one cell can be selected at a time? I tried MyList^^.SelFlags:=lOnlyOne; but you can still select multiple cells with the shift.
Also, do I need to create my own scroll bar along with the window? I need only the vertical one, but setting ScrollVErt to true in the Lnew call doesnt do much. No scroll bar appears.
Also having some problems with the window not redrawing properly, but I need to find out how to fix the above bugs first before I look at that .
From: Chief Wizard
I dont know how old of a devlopment system youre using, but for a long while the code that Apple sent out with the List Manager had a bad bug.
If you look in the declared record for the list, youll see two fields declared as BYTE. You need to change this to SignedByte. You see, a Byte actually takes up two bytes, and a SignedByte takes only one.
If you had the wrong interface, you wouldnt be able to access the record correctly.
From: The Atom
Is there any simple way of including a small icon at the beginning of each line in a list manager window? (to make a list of names with doc. or folder icon before like SFGetFile (HFS)) Or do I have to make my own List definition?
From: Don
Yes, you have to write your own list definition to put little icons next to your text. You can get the source code to the standard (LDEF0) list definition on most BBSs ... including the MouseHole DL... if that helps. Actually it shouldnt be that hard, but still its definitely NOT one more thing you wanted to do. Presently (tonight in fact) Im working on a DA in Pascal that uses the LM. Ill post any clever insights (HAH!), and would appreciate you sharing yours. It never hurts.
From: The Atom
Can you tell the list manager what font to display text in? I was just thinking, if space was less problem than development time, you could just include your own font that has a couple characters re-defined as the small folder and Doc icons.. Then just include those before the name of the cell.
Ive finally gotten everything to work, sort of. The only problem seems to be with my handling of Activate events. I have multiple windows, each with its own List.. Everything seems to go right until I bring one of the windows to the front (by clicking on it) - the vertical scroll bar will not work! It acts like I need to activate the scroll bar or something. Any ideas? I do the LActivate but nothing else.
From: Don
The List Manager will use whatever font the current grafPort is set to. Just make sure you set them before you call LNew. As for the activate problem, are you sure youre passing the handle to the correct list? A silly question, but I made this kind of mistake with TextEdit recently. You might try a few Control Manager calls just for the heck of it, like DrawControls or HiliteControl. Remember, you can get the ControlHandle to your scroll bar from the list record. The only other problem I think it might be is youre not processing the MouseDown event properly. Where do you store the rectangle that the scroll bars are in? You might check the variable and see if its still valid after an activate event. By the way, are you writing this in LightSpeed, TML, Turbo or MPW?
From: The Atom
Im using Lightspeed- I checked the handle, its the same handle as when I created the window so that seems ok.. I tried a HiliteControl (ODD(Event.modifiers,List^^.VScroll) but it didnt make much difference.
I have now noticed that its not just the scroll bar that doesnt work- if you try to double click an item from the new window, it doesnt catch it.. Just thinks you clicked once.
Also, it seems like if I re-size the window, sometimes it becomes active and both the scroll bar and double click work.
What is this about a scroll bar rect? I havent done anything with the controls other than make sure to set the view rect -15 to allow room for it. Do I need to keep track of the scroll bar also? [See the January issue for a working example of scroll bars, windows and re-sizing events. Apply that code to your list manager task. -Ed]
TML Source Library
From: John S. Lee
I did purchase it about 3 mos ago. I found them useful in SOME aspects! It really does shine on the code to generate fancy menus,windows,controls, which I guess is good for some applications. My programs are not window intensive so they had less use for me that they might for others. You can expect the following form them:
PopUpMenu, SFGetFile, SplitBars, Speech, Print, Dumbterm, RegMdef, GrafMdef, RegWDef, FancyWdef, NiftyWdef, RegCdef, FancyCDef, Fkey Example, DescAcc Example, RegLDef, FancyLdef.
With all of this you would have thought that :
1.) They would have included additional documentation to change the include files to just USES MacIntf; (Maybe I have an old version [it is 1.0], but I have TML 2.0).
2.) They would have had at least several graphics demos, both 3d,2d etc.
3.) The manual does a mediocre job of explaining how the program works.
4.) If you are NOT well versed in pascal or are a beginner with a high frustation level, wait awhile, become better versed and buy it!
I think that for the pascal hacker who really needs no documentation and loves guesswork or rather is well informed and likes new ideas this library is heaven. I think that for the price there is no better value, especially since there seems to be a big code hogging thing going on right now with all of the programmers.
Most of the library you will be able to use in some way, the concepts are well represented in the actual source. Whether or not you should buy it is up to you, but one thing is for sure. It would take you quite awhile to find a selection of source so well tailored for a specific development system.
P.S. If you really want to do some fun stuff try MacExpress by ALsoft,Inc. I received mine about 2 weeks ago and the results are well past amazing! This thing handles all of your event proocessing for you it also handles all of the panel events etc. The time that you spend coding is reduced to writing your OWN procedures instead of worrying about how it will actually get(pass) the event for said procedure. The window extensions are great, and if you ever wondered about how the wiz bang guys get all of the neat status displays and the like, MacExpress has the answer. It is difficult to learn at first, but after a few hours it is well worth the money and effort. No MPW for me. Id rather have MacExpress.
MPW Pascal
From: Jack Howarth
Does anyone know if MPW supports some form of string to real number conversion analogous to the ReadFrom in TML and LS Pascals. I had a routine to do this for version 1.0 of TML, but its a lot of code to do in a high level language. I really would like to put a call to ReadFrom and StringOf in a TML Unit and somehow link in the paslib functions that do these calls. Would it be possible to sucessively port this into MPW as these are really pascal library functions that must be linked in at some point?
From: Rick Boarman
I dont know anything about ReadForm but MPW supports all the SANE Str255 to Real (Single, Double, Comp & Extended) conversions. It even has a slick parser which can be used for interactive input of numeric values.
TE TextBox routine
From: Beaker
My MIDI Patch Editor, ProEdit, uses the TextEdit routine TextBox to draw the titles of the sounds in a patchblock window. Theres 32 calls per window, and up to four windows. It was taking a full two seconds to draw (update) the window, so I decided to take a look at TextBox with MacsBug. You wouldnt believe it.
Instead of _really_ writing a TextBox routine to simply draw text, they create a TERec for the text, set up all the rectangles, call TECalText, then TEUpdate. No wonder its so darn slow.
Has anyone out there rewritten (i.e. written their own) TextBox routine? If its PD, Id love a copy, in whatever language.
Printing Problems
From: The Corsair
I am having a bit of a problem printing a specified range of pages. Here is what I am doing:
firstpage = (**printh).prJob.iFstPage;
lastpage = (**printh).prJob.iLstPage; (**printh).prJob.iFstPage = 1;
(**printh).prJob.iLstPage = 999;
for(j=firstpage;j<lastpage+1;j++)
{
my printing code
}
Now what happens is when I type in a small number into the print dialog like from page 2 to 4 it works fine, but if I type in like from 8 to 10, it doesnt print anything. Now, it is going through the loop just fine and it is not getting any print errors. Another thing I did was to plug for(j=8;j<9... into the loop and in the print dialog I typed in the range of 8 to 10 and it still didnt print, but when I hit all pages it printed pages 8 to 10 just fine...
for(j=1;j<17;j++)
{ if(PrError() == noErr)
{
incprt((j*3)-2);
HLock(printhand);
ptr = p1 = (*printhand);
PrOpenPage( printPort, 0L );
if(PrError() == noErr)
{
MoveTo( printRect.left+leftMargin,
(lineBase = printRect.top+lineHeight) );
do
{
/* PrintLine: */
while ((ptr<=(*printhand)+count) &&
(*ptr++ != (char)\r)) ;
if ((length=(int)(ptr-p1)-1)>0) MyDrawText(p1, length);
MoveTo( printRect.left+leftMargin,
(lineBase += lineHeight));
p1 = ptr;
}
while (ptr<(*printhand)+count);
PrClosePage( printPort );
}
}
}
Now, the problem is that if I specify a page range or print high quality or standard quality on the imagewriter it goes through the loop, gets no prerrors and does not print anything... the incprt routine setts up the printhand with the next page to be printed - 5300 chars - 81 X 66 lines...
Theorbo Crwth
Are you sure your problem is not in the printing code itself?
If the loop is travelling fine and the numbers are correct, maybe its the printing function you have devised. Also, its better to have your loop structured as:
for( ... ; j <= lastpage; ... rather than: for( ... ;j < lastpage
+ 1; ...
Since you are using a complicated set of structures and members make sure the datum isnt getting munged somewhere. Almost sounds like an allocated array isnt large enough.
If its running through the loop and printing out in draft mode, but the same loop in imagewriter mode prints nothing then it seems to me that the instructions for the imagewriter are not correct. Im not up on that particular printer, but maybe the program is not sending the correct information that the imagewriter needs.
Another question I have is does it print out on the screen? If you can redirect the I/O so the printed file goes to the screen rather than the printer you might see your problem. It sounds like the program isnt sending the printer what it needs know. On the other hand, perhaps it is sending codes that are screwing up the printer.
LS C 2.0
From: Mcohen
I just received my Lightspeed C 2.0 upgrade yesterday and its great! In addition to the new features you may have heard about (HFS support, etc.) it has a much better stdio library. A generic Unix program will automatically get a real movable window and will automatically support the desk, file, and edit menus (which will be automatically provided if you use the automatic stdio initialization). all console I/O functions allow desk accessories & FKEYs to be used. The compiled code is a bit smaller - a 122K application with 1.0 is now 112K. Oh yes, LS C 2.0 supports function prototypes and INLINE ASSEMBLY LANGUAGE!
Quark
From: Mike Steiner
We saw a demo of the new page layout program from Quark (I forget the programs name.) a few weeks ago. It is really impressive! Among other things it does, it automatically wraps text around graphics or borders, even if you move the graphic (it re-wraps). It will even handle irregularly shaped graphics. [Hmmm, like SOLO! -Ed] It allows father-son boxing. If you place a box or oval inside another one (to constrain a graphic or text), it will remain inside it and not be allowed to be move outside of it. Theres a lot more that I dont have time for now. No word as to release date, though.
New Macs???
From: Go
I was visiting someone at Apple today (Cupertino), and at somebodys cubicle I saw:
A Mac in a funny-looking Slitted case with an IBM/DEC keyboard, and a //gs monitor and keyboard attached to a board with 8 expansion slots, 4 circular connectors, and lots of RAM chips. (//gs mouse, too; you know, the kind that plugs right into the side of the keyboard).
When I asked the guy what the machines were, he replied in an angry dead-pan just some machines...