From: hijim::pronet::net at: 28-Apr-2003 19:40
I use these functions for line printing on my HP-895Cse. It has built-in fonts. I'm not
sure if most printers still do.
lprint: func [x] [write %//prn join x newline] ; print line and cr
lprin: func [x] [write %//prn x] ; print line
cr: does [write %//prn newline] ; carriage return
ff: does [write %//prn #"^l"] ; formfeed
I also use a free download called txtprint.exe to print in columns and in dirrerent fonts
and sizes. It prints through the HP Windows print driver.
I also have a print function for printing from a text-area.
btn green / 1.8 "Print" [
if my-area/text <> none [
write %//prn format copy my-area/text
The format function:
format: func [prn-txt /local count] [
insert prn-txt " " ; margin of 5
replace/all prn-txt "^/" "^/ "
forall prn-txt [
if (first prn-txt) = newline [count: 0]
if all [
count >= 76 ; wraps at 70 characters
find/reverse prn-txt " "
prn-txt: find/reverse prn-txt " "
change prn-txt newline
prn-txt: insert next prn-txt " " ; margin of 5
count: count + 1
append prn-txt "^/^L"
I hope this helps,