[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Printing to a USB from XyDOS via XyWin



Paul Breeze wrote:
Please do post your program. I imagine that this technique will allow printing to any printer that Windows supports, on any port.

It should.
The program is below. It is a little simpler and quicker than what I wrote about last night. It is heavily commented and has instruction-comments at the top. The executable code is only about 8 lines.

XPLeNCODE v2.0
b-gin [UNTITLED]
;*; February 9, 2004[cr|lf];*; Harry Binswanger's adaptation 2/9/04
of Tim Baehr's WORDPAD.PGM [cr|lf];*; to use XyWin instead of
 wordpad.exe. [cr|lf];*; You can load to a key in your .kbd f
ile:[cr|lf];*; nn=xh,bx,r,u,n, ,c,:,\,x,y,\,p,r,n,u,s,b,.,p,g
,m,q2[cr|lf];*; Assumptions: [cr|lf];*; 1. xw.exe is located{032}
in c:\xywin\[cr|lf];*; 2. you don't mind having a temp file n
amed -temp.xyw living in the [cr|lf];*; directory your edito
r.exe is in. (I don't delete it at the end.)[cr|lf];*; 3. you
 have prepared a file named c:\xywin\xwprint.int [cr|lf];*; {032}
 which contains as its last three lines:[cr|lf];*;   [BX_]
ty c:\xywin\-temp.xyw[Q2_];*;[cr|lf];*;   [BX_]wait[Q2_];*;
[cr|lf];*;   [BX_]quit[Q2_];*;[cr|lf];*;[cr|lf];*; If there
's no open file on the screen, exit with message[cr|lf]{<}IF{
<}VA$WS{>}<>1{>}{<}PRYou must have a file open.{>}{<}EX{>}{<}
EI{>};*;[cr|lf];*;[cr|lf];*; If file is [UNTITLED], set a fla
g in S/G 24; then remember cursor location[cr|lf];*; select t
he whole thing, then restore cursor location.[cr|lf];*; This{032}
is Tim's code. I gather it is a way to get around the special
 case[cr|lf];*; of printing from an [UNTITLED] window, becaus
e just SAving it to the temp ;*; file, as program does with a
ny other window, would change its name.[cr|lf];*; The flag of
 s/g 24 is so the pgm can cancel the DeFine when done[cr|lf]{
<}SV24,{>}{<}IF({<}VA$FI{>}=={<}VA\264{>})&({<}VA$DF{>}<>1){>
}{<}SV24,1{>}{<}SX25,{<}CP{>}{>}[XD_][DX_][TF_][DF_][BF_][DF_
][BX_]jmp {<}PV25{>}[Q2_][DO_][FF_]{<}EI{>};*;[cr|lf];*;[cr|l
f];*;Get name of XyDOS directory (will put temp file in it)[c
r|lf]{<}SX60,{<}VADR{>}{>};*;[cr|lf];*;[cr|lf];*; Has text ha
s been DeFined? If it has, set variable 01 to "d" so writing
 to the temp file will use command "sad" (SAve Defined) not j
ust "sa".[cr|lf]{<}IF{<}VA$DF{>}==1{>}{<}SV01,d{>}{<}EI{>};*;
 [cr|lf];*;[cr|lf];*;Save file or defined text to temp file i
n c:\xywin\[cr|lf][BX_]sa{<}PV01{>}
/nv c:\xywin\-temp.xyw[Q2_];*;[cr|lf];*;[cr|lf];*;Go to DOS,{032}
launch XyWin with xwprint.int as its ".int file"[cr|lf][BX_]d
os/nv/x/z /c start /w c:\xywin\xw.exe ,c:\xywin\xwprint.int[Q
2_];*;[cr|lf]{<}IF{<}IS24{>}=="1"{>}[XD_]{<}EI{>};*; Cancel t
he DeFine in case it was [UNTITLED][cr|lf]{<}PRDone. Have not
 deleted -temp.xyw.{>}{<}EX{>}[cr|lf]
-nd
XPLeNCODE


Harry Binswanger
hb@xxxxxxxx