TweetFollow Us on Twitter

Dec 89 Mousehole
Volume Number:5
Issue Number:12
Column Tag:Mousehole Report

Mousehole Report

By Rusty Hodge & Larry Nedry, Mousehole BBS

From: Willcox

Re: Print Manager Error

I solved my printing problem, but I do not fully understand why it now works. Maybe someone out their can explain. First, the problem was that sometime when printing (using a Mac IIcx only), the system would sometimes forget that a certain font was a LaserFont, and promptly started creating a bitmap for it. However, the screen font information was also lost, so this process eventually terminated in an error.

I tracked the problem down to a single call to “UseResFile” from which I had to load a specific private resource. I fixed the problem by modifying the code to:

     temp:=CurResFile;
     UseResFile(theFileNumber);
     theResource:=GetResource(asdfjasldf);
     UseResFile(temp);

Now, why does this work??? I have not found a warning in Inside Macintosh, and the error only occurs on my Mac IIcx, not on my Mac Plus.

From: Jmoreno

Re: Print Manager Error

What was happening is the call to UseResFile was removing the System from the list of open files to search for a resource. And that font was no longer found. The system adds each opened resource to the end of a list and then when you try to load a resource it starts at the end and backtracks looking through all of the open resource forks for the requested resource. So when you open a resource it gets a place in line, when you call UseResFile it gets put at the beginning and is set to be the FIRST resource to search (everything else is then gone from the resource list). Hope this helps you understand what is going on. BTW if you haven’t already I STRONGLY recommend that you buy Inside Mac Vol 1 to 5.

From: Inbox

Re: Var declaration

Sheeshh.... Here I go again..

Awright, I’m trying to create an array of the following size after VAR in my globals unit: myarray : array[1..7,1..300] of string[20]; but LSP says that it’s “unable to create blah..blah..blah on this level”. Now what is a body to do if using dynamic memory allocation means changing the whole program?? Is there some kind of a call I can make to perhaps increase the size of the applications stack beforehand?! But the globals’ unit gets compiled first so the instruction won’t get executed at that point...

Thanks for listening, _inBox_ (this should read _inTrouble_)

From: Jmoreno

Re: Var declaration

In the run options part of Think Pascal (formerly LSP) there is an option for setting both the stack (which is what you want) and the heap.

From: Tomt

Re: Var declaration

Dumb question but how in Pascal do I access the stuff in a handle. My problem is that I need to make an array of integers of size, say, 500 by 500. Now I tried array type of that size,without making any instances of it, but LSP wouldn’t let do that. So if I make a handle to the appropriately sized chunk of memory, how do I access the i,j the element. I’m sure its trivial, but I haven’t been able to figure it out. Thanks in advance for any help

From: Inbox

Re: Var declaration

Awright.. Methinks I got it.. Here’s the 500 by 500....

TYPE
 myarray = array[1..500,1..500] of integer;
 myarrayptr = ^myarray;
 myarrayHandle = ^myarrayptr;
VAR
 THEarray : myarrayHandle;
BEGIN
 THEarray := myarrayHandle(NewHandle(SizeOf(myarray)));

That’s it. To access an element, do

myint := THEarray^^[i,j];  where i and j are integers, etc...

Set an element by THEarray^^[i,j] := myint;

Hope this helps. _inBox_

From: Jimm

Re: Var declaration

On page 447 of LSP 2.0 manual it says that data structures cannot exceed 32766 bytes. Your data structure is 22*7*300 or >42K.

From: Dhands

Re: Var declaration

The previous VAR declaration will work as stated, since the data structure allocated at compile time is only a 4 byte handle, not the >40k array. The array is later allocated dynamically at run-time.

For example:

VAR
        good : BigHandle; {4 byte handle to huge, >32k, data}
        bad  : ARRAY[1..40000] char;{>32k data won’t fit here}

The difference is that “good” has it’s data on the heap (via NewHandle) and is only limited in size by the available memory. Where as “bad” is pre-allocated space in global or local areas of the heap which is limited to 32k.

From: Shaper

Re: Printing Samples?

One more question, does anyone have any Pascal (preferably LSP) source code for printing to an ImageWriter - text only, no graphics necessary, I tried to use PrCtlCall() or whatever it’s called, but I don’t know how to set up a ptr to text, and also how do you set the HiWord and LoWord of a longint? I know you can GET it by doing aLongInt:=HiWord(bLongInt) or aLongInt:=LoWord(bLongInt) but you can’t do HiWord(bLongInt):=aLongInt...

From: Dhands

Re: Printing Samples?

Here’s a quick summary of draft printing using the print manager’s low level calls. The low level calls should not be used for “real” printing, but they are great for quick-n-dirty printing.

{1}

PrDrvrOpen;                          {open print driver}
PrCtlCall(iPrDevCtl,lPrReset,0,0);   {reset/init printer}
PrCtlCall(iPrIOCtl,LONGINT(@textBuf),count,0);{send some text}
PrCtlCall(iPrDevCtl,lPrLFSixth,0,0); {advance printer paper}
PrDrvrClose;                         {close print driver}
VAR
        textBuf : PACKED ARRAY [1..256] OF Char;
        str     :       Str255;

Since you must explicitly advance the paper you have to print one line at a time. To print a Str255 for example:

{2}

count := Length(str) {number of bytes to copy}
FOR i := 1 TO count DO
  textBuf[i] := str[i];{note: don’t copy over str[0] length byte}
PrCtlCall(iPrIOCtl,LONGINT(@textBuf),count,0);
PrCtlCall(iPrDevCtl,lPrLFSixth,0,0);

From: Jmoreno

Re: Printing Samples?

1a) Why don’t you try using the regular printing process, it’s no big deal to open the port then open a page print a page, close the page then open another page if needed....

1b) To get a pointer to the text in a Str255 use

TextPtr:=@YourString[1]; { really need to make sure you have 1+ chars}

2a) to set the Hi&LoWord of a longInt use:

bLongInt:LongInt;
theInt:^Integer;
BEGIN
theInt:=@bLongInt;
theInt^:= 12; { set the HiWord}
theInt:=Ptr(LongInt(theInt) + 2);
theInt^:= 60; { set the LowWord}
END;

or Use a variable RECORD

From: Inbox

Re: Holy #$%^!!

What just happened is too weird to be true. I’ve had a folder with one of the LSP projects I was working on, and I made 2 copies of it by ctl-D (Duplicate). I put the two copies in different folders in other places of the tree. Over a period of a few months, I made changes to the original file, and replaced the old copies with new ones once in a while. But today I discovered that whenever I change a file (LSP project and its files) in one of the folders, they get changed in all of them. So, when I make some changes to the copy, save, and quit, the changes appear in the original source file as soon as I open it. However, when I changed the names of the files in one of the “copy” folders, removed the object code, and recompiled, the changes were gone and the old stuff was there unaltered. So one can assume that whenever the copy was opened, LSP really opened the original, and, when I saved the changes, they were saved to the original, and the copy was never altered. Is this a major access path screw-up on the LSP part or what? I’ve never noticed anything like that before. I rebuilt the Desktop file a sec ago and hope that this won’t happen to all my LSC projects as well. Any comments or ideas or similar experiences???

From: Siegel

Re: Holy #$%^!!

Remember that Pascal remembers files in a project by absolute pathname, and not relatively, as THINK C does. Therefore, all of your duplicate projects are pointing to the same set of source files, until you explicitly change the references with option double-click.

From: Rguerra

Re: Resource Question

How does one read resources into memory at INIT time and have them stay in the System Heap after the INIT has executed and STILL HAVE THEM RECOGNIZABLE AS RESOURCES? DetachResource will make them ordinary handled blocks. Since they would probably have to remain as part of an open resource map, how do you keep your INIT file’s resource fork open, ie. prevent the System’s INIT31 mechanism from closing it after execution? I’d like to leave certain resources in the fork open AS RESOURCES, and I’ll leave the whole file open if I must. Alternatively, is there a way to “graft” a resource onto the System file (or ROM resource map in memory) without actually explicitly AddResource - ing to the System? I’d really rather not modify people’s System files. Any suggestions would be appreciated.

From: Bob Beason

Re: Scrolling Window

I am trying to write an application that takes data from an A/D board (in a Mac II) and plots it in a window as a horizontal graph. I would like for the graph to be about 4 screens wide and as the data are plotted, for the window automatically to shift to the right so that the most recent point is at the right edge of the screen. In some cases there will be only a few msecs between values from the I/O board, so I can’t spend a lot of time redrawing the window. Does anyone have or know of any “C” routines to handle automatic scrolling along the horizontal axis?

From: Noisy

Re: Desktop Bashing

Ok...so Apple says that directly drawing into the Desktop is a BAD THING, probably because it will abuse and confuse MultiFinder. No bets. Anyone have any brilliant (or at least moderately bright) ideas on how to display icons in the Desktop (like the Trashcan) without violating wMgrPort? The infamous ‘make a window bigger than the desktop and never let the User select it’ is great under the Finder, but fails miserably under MultiFinder, ‘cause it hides all the other application windows. Displaying icons inside 32x32 windows is a cheap solution, but then you get ugly frames around them (a custom WDEF maybe?). If you’ve got the idea...I’ve got the beer.

From: Dhands

Re: Edittext items & MacApp

I noticed something odd about putting controls (i.e., Radio buttons, Check boxes, Edittext etc...) into windows. MacApp will accept most of the standard controls in a TWindow or TView except for Edittext items. Edittext items require a superview of type TDialogView, where as the other controls will work with superviews of just TWindow or TView. The problem appears to be the fTEView field of TEditText remains nil if there is no TDialogView superview. It would be nice to be able to put an Edittext into a TWindow or TView, is this possible? and what might be the reason for not allowing it?

From: Rastamon

Re: Edittext items & MacApp

TEditText depends upon TDialogView to handle things like tabbing and dismissing modal dialogs. You can use “TTEView” objects in TViews and TWindows, but you’ll have to handle the tabbing between fields yourself.

From: Jaff

Re: Need Partitioning SW

Help, anyone! I want to do a partition on a Rodime 100MB drive we have. The drive was purchased from TallGrass as a raw device; we’ve formatted it with their utility which does not support partitions. We’ve also been able to format it with CMS Utility v4.0 which does not support partitions either. We would like to be able to run A/UX and Mac OS on this drive. Both utilities which can create the partitioning we desire do not recognize the device; Apple HD SC Setup wants a SONY, and Jasmine’s DriveWare, although the Rodime “RO3000T 1.26” string appears within their resources, does not work either.

Can anyone help?

From: Gwdavis

Re: Need Partitioning SW

Rodime formatting software is available on CIS or Genie, I think. I used it to format my CMS Pro102, and it’s the same drive I think.

From: Andgroup

Re: Flushing the cache

Does anyone out there know how to flush the read disk cache? I am not referring to the file system write cache, but the caching mechanism described in tech note #81. I need to flush cache of all blocks as specified, flushing the whole cache would be a bit gauche, but I would settle with that if that is all I had..

From: Malam

Re: LocalTalk xones

Liaison can create two zones on a non-dedicated Macintosh. It’s pretty cheap, compared to the Apple Internet Router, which costs $399. As far as hardware is concerned, the AST ICP for the MacII does implement extra AppleTalk ports, especially useful under A/UX. Something to that effect...

From: Jaff

Re: Scrolling INIT

Does anyone know of an INIT that will slow up scrolling (through lists or menus) on fast machines? We have SE/30s, IIx & IIcx (soon to have IIci) and find it hard to maneuver a menu when it scrolls real fast! Please upload!

From: Mrteague

Re: Scrolling INIT

I will upload the INIT someone else mentioned - call Scroll/Limit. On standard machines (SE, II), I found the “top speed” to be TOO slow - it seems to add a lot of processing overhead as an INIT. Good luck with it.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Whitethorn Games combines two completely...
If you have ever gone fishing then you know that it is a lesson in patience, sitting around waiting for a bite that may never come. Well, that's because you have been doing it wrong, since as Whitehorn Games now demonstrates in new release Skate... | Read more »
Call of Duty Warzone is a Waiting Simula...
It's always fun when a splashy multiplayer game comes to mobile because they are few and far between, so I was excited to see the notification about Call of Duty: Warzone Mobile (finally) launching last week and wanted to try it out. As someone who... | Read more »
Albion Online introduces some massive ne...
Sandbox Interactive has announced an upcoming update to its flagship MMORPG Albion Online, containing massive updates to its existing guild Vs guild systems. Someone clearly rewatched the Helms Deep battle in Lord of the Rings and spent the next... | Read more »
Chucklefish announces launch date of the...
Chucklefish, the indie London-based team we probably all know from developing Terraria or their stint publishing Stardew Valley, has revealed the mobile release date for roguelike deck-builder Wildfrost. Developed by Gaziter and Deadpan Games, the... | Read more »
Netmarble opens pre-registration for act...
It has been close to three years since Netmarble announced they would be adapting the smash series Solo Leveling into a video game, and at last, they have announced the opening of pre-orders for Solo Leveling: Arise. [Read more] | Read more »
PUBG Mobile celebrates sixth anniversary...
For the past six years, PUBG Mobile has been one of the most popular shooters you can play in the palm of your hand, and Krafton is celebrating this milestone and many years of ups by teaming up with hit music man JVKE to create a special song for... | Read more »
ASTRA: Knights of Veda refuse to pump th...
In perhaps the most recent example of being incredibly eager, ASTRA: Knights of Veda has dropped its second collaboration with South Korean boyband Seventeen, named so as it consists of exactly thirteen members and a video collaboration with Lee... | Read more »
Collect all your cats and caterpillars a...
If you are growing tired of trying to build a town with your phone by using it as a tiny, ineffectual shover then fear no longer, as Independent Arts Software has announced the upcoming release of Construction Simulator 4, from the critically... | Read more »
Backbone complete its lineup of 2nd Gene...
With all the ports of big AAA games that have been coming to mobile, it is becoming more convenient than ever to own a good controller, and to help with this Backbone has announced the completion of their 2nd generation product lineup with their... | Read more »
Zenless Zone Zero opens entries for its...
miHoYo, aka HoYoverse, has become such a big name in mobile gaming that it's hard to believe that arguably their flagship title, Genshin Impact, is only three and a half years old. Now, they continue the road to the next title in their world, with... | Read more »

Price Scanner via MacPrices.net

B&H has Apple’s 13-inch M2 MacBook Airs o...
B&H Photo has 13″ MacBook Airs with M2 CPUs and 256GB of storage in stock and on sale for up to $150 off Apple’s new MSRP, starting at only $849. Free 1-2 day delivery is available to most US... Read more
M2 Mac minis on sale for $100-$200 off MSRP,...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100-$200 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $... Read more
Mac Studios with M2 Max and M2 Ultra CPUs on...
B&H Photo has standard-configuration Mac Studios with Apple’s M2 Max & Ultra CPUs in stock today and on Easter sale for $200 off MSRP. Their prices are the lowest available for these models... Read more
Deal Alert! B&H Photo has Apple’s 14-inch...
B&H Photo has new Gray and Black 14″ M3, M3 Pro, and M3 Max MacBook Pros on sale for $200-$300 off MSRP, starting at only $1399. B&H offers free 1-2 day delivery to most US addresses: – 14″ 8... Read more
Department Of Justice Sets Sights On Apple In...
NEWS – The ball has finally dropped on the big Apple. The ball (metaphorically speaking) — an antitrust lawsuit filed in the U.S. on March 21 by the Department of Justice (DOJ) — came down following... Read more
New 13-inch M3 MacBook Air on sale for $999,...
Amazon has Apple’s new 13″ M3 MacBook Air on sale for $100 off MSRP for the first time, now just $999 shipped. Shipping is free: – 13″ MacBook Air (8GB RAM/256GB SSD/Space Gray): $999 $100 off MSRP... Read more
Amazon has Apple’s 9th-generation WiFi iPads...
Amazon has Apple’s 9th generation 10.2″ WiFi iPads on sale for $80-$100 off MSRP, starting only $249. Their prices are the lowest available for new iPads anywhere: – 10″ 64GB WiFi iPad (Space Gray or... Read more
Discounted 14-inch M3 MacBook Pros with 16GB...
Apple retailer Expercom has 14″ MacBook Pros with M3 CPUs and 16GB of standard memory discounted by up to $120 off Apple’s MSRP: – 14″ M3 MacBook Pro (16GB RAM/256GB SSD): $1691.06 $108 off MSRP – 14... Read more
Clearance 15-inch M2 MacBook Airs on sale for...
B&H Photo has Apple’s 15″ MacBook Airs with M2 CPUs (8GB RAM/256GB SSD) in stock today and on clearance sale for $999 in all four colors. Free 1-2 delivery is available to most US addresses.... Read more
Clearance 13-inch M1 MacBook Airs drop to onl...
B&H has Apple’s base 13″ M1 MacBook Air (Space Gray, Silver, & Gold) in stock and on clearance sale today for $300 off MSRP, only $699. Free 1-2 day shipping is available to most addresses in... Read more

Jobs Board

Medical Assistant - Surgical Oncology- *Apple...
Medical Assistant - Surgical Oncology- Apple Hill Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Business Analyst | *Apple* Pay - Banco Popu...
Business Analyst | Apple PayApply now " Apply now + Apply Now + Start applying with LinkedIn Start + Please wait Date:Mar 19, 2024 Location: San Juan-Cupey, PR Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.