[comp.sys.mac] need help to print screen using Lightspeed Pascal

) (03/10/88)

I'm stuck.
Could someone please offer me some info on how I could 
in Lightspeed Pascal dump the screen to the
printer (using the Print Manager?) ? 
Maybe with an example or something?

I would really appreciate it.
thanks,

Gerald 

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Gerald T. Ngui

ARPA: geraldn@puff.cs.wisc.edu 
      ngui@gumby.cs.wisc.edu
      ngui@daffy.cs.wisc.edu
UUCP: ...!{harvard,ihnp4,seismo,topaz}!uwvax!puff!gerald
      ...!{harvard,ihnp4,seismo,topaz}!uwvax!{gumby,daffy}!ngui
ICBM: 70 82 51 N    88 23 12 W  
CompuServe: 71620, 605
USnail: 2302 University Avenue, Apt# 311
	Madison, WI 53705
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

ephraim@think.COM (ephraim vishniac) (03/10/88)

In article <1460@puff.cs.wisc.edu> geraldn@puff.WISC.EDU (Gerald Ngui ...Burp!) writes:
>I'm stuck.
>Could someone please offer me some info on how I could 
>in Lightspeed Pascal dump the screen to the
>printer (using the Print Manager?) ? 
>Maybe with an example or something?

Here's one way to tackle the problem, though it's a bit sleazy.

There's code for dumping/printing the screen in FKEY 3 and FKEY 4. So,
the easy way to dump/print the screen is to GetResource('FKEY', 3) or
GetResource('FKEY', 4), *check to be sure you got the FKEY*,
dereference the handle, cast the pointer into a procedure pointer, and
call the procedure.  Note that the procedure is void (no return value)
and has no parameters.

Ephraim Vishniac					  ephraim@think.com
Thinking Machines Corporation / 245 First Street / Cambridge, MA 02142-1214

     On two occasions I have been asked, "Pray, Mr. Babbage, if you put
     into the machine wrong figures, will the right answers come out?"

steele@unc.cs.unc.edu (Oliver Steele) (03/11/88)

[follow-ups to comp.sys.mac.programmer]

ephraim@vidar.think.com.UUCP (ephraim vishniac) writes:
>In article <1460@puff.cs.wisc.edu> geraldn@puff.WISC.EDU (Gerald Ngui ...Burp!) writes:
>>Could someone please offer me some info on how I could 
>>in Lightspeed Pascal dump the screen to the
>>printer (using the Print Manager?) ? 

>There's code for dumping/printing the screen in FKEY 3 and FKEY 4. So,
>the easy way to dump/print the screen is to GetResource('FKEY', 3) or
>GetResource('FKEY', 4), *check to be sure you got the FKEY*,
>dereference the handle, cast the pointer into a procedure pointer, and
>call the procedure.  Note that the procedure is void (no return value)
>and has no parameters.

Be forewarned that some people renumber their FKEYs.  You may want to
check that the long int starting at the eighth byte of the resource is 4
(if your dumping to the printer), or that the resource ends with the
string ".Print".  You could even cycle through the FKEYs, but this gets
harder than what's described in IM II-165, anyway.

----------------------------------------------------------------------------
Oliver Steele					   ...!uunet!mcnc!unc!steele
							   steele@cs.unc.edu
"In computer science, there's no
excuse for cleverness." -- Zdonik