Hi,
this isn't the same but
open window 200,200
open printer "file.ps"
line 0,0 to 200,200
text 100,100,"Hallo"
close window
close printer
will create this file:
%!PS-Adobe-1.0
%%Title: (null) grafic
%%BoundingBox: 0 0 505 505
%%DocumentFonts: Helvetica
%%Creator: yabasic
%%Pages: (atend)
%%EndComments
gsave
/txt 4 dict def
/rec 6 dict def
/tri 8 dict def
/cir 5 dict def
/rgb 3 dict def
rgb /r 0 put
rgb /g 0 put
rgb /b 0 put
0 setgray
/M {moveto} def
/RL {rlineto} def
/L {lineto} def
/N {newpath} def
/S {stroke} def
/CLYN {(y) eq {1 setgray} {rgb /r get rgb /g get rgb /b get setrgbcolor} ifelse} def
/DO {CLYN N M 0 2.5272 RL 2.5272 0 RL 0 -2.5272 RL closepath fill (n) CLYN} def
/LI {CLYN N M L stroke (n) CLYN} def
/CI {mark 6 1 roll cir /fi 3 -1 roll put
cir /cl 3 -1 roll put
cir /r 3 -1 roll put
cir /x 3 -1 roll put
cir /y 3 -1 roll put
cir /cl get (y) CLYN
N cir /x get cir /y get cir /r get 0 360 arc
closepath cir /fi get (y) eq {fill} {stroke} ifelse
(n) CLYN cleartomark} def
/AT {mark 5 1 roll txt /txt 3 -1 roll put
txt /xa 3 -1 roll put
txt /y 3 -1 roll put
txt /x 3 -1 roll put
N txt /x get txt /y get M
txt /txt get false charpath flattenpath pathbbox
pop exch pop exch sub
txt /x get exch
txt /xa get (c) eq {2 div sub} if
txt /xa get (l) eq {pop} if
txt /xa get (r) eq {sub} if
txt /y get M
txt /txt get show cleartomark
} def
/RE {mark 7 1 roll rec /fi 3 -1 roll put
rec /cl 3 -1 roll put
rec /y2 3 -1 roll put
rec /x2 3 -1 roll put
rec /y1 3 -1 roll put
rec /x1 3 -1 roll put
rec /cl get CLYN
N rec /x1 get rec /y1 get M
rec /x1 get rec /y2 get L
rec /x2 get rec /y2 get L
rec /x2 get rec /y1 get Lcolour 255,0,0
rec /x1 get rec /y1 get L
closepath rec /fi get (y) eq {fill} {stroke} ifelse
(n) CLYN cleartomark} def
/TRI {mark 9 1 roll tri /fi 3 -1 roll put
tri /cl 3 -1 roll put
tri /y3 3 -1 roll put
tri /x3 3 -1 roll put
tri /y2 3 -1 roll put
tri /x2 3 -1 roll put
tri /y1 3 -1 roll put
tri /x1 3 -1 roll put
tri /cl get CLYN
N tri /x1 get tri /y1 get M
tri /x2 get tri /y2 get L
tri /x3 get tri /y3 get L
closepath tri /fi get (y) eq {fill} {stroke} ifelse
(n) CLYN cleartomark} def
30 30 translate
2.5272 setlinewidth
0 505.44 505.44 0 (n) LI
/Helvetica findfont setfont newpath 0 0 moveto
(The Quick Brown Fox Jumped Over The Lazy Dog 0123456789) false charpath flattenpath pathbbox
3 -1 roll pop pop sub abs 913.204 exch div
/Helvetica findfont exch scalefont setfont
252.72 252.72 (l) (Hallo) AT
showpage
grestore
%%Trailer
which is rather good, IMO. That example was posted on the old Yabasic forum and according to my reply it didn't work under Windows or, perhaps, I was misunderstanding what it did (my money is on the latter LOL). The code produced opens perfectly with The Gimp, Evince etc.
Just opening the printer and omitting to open the file will simply send the output of the program to the printer.
Derek.
Edit: In that case you can draw whatever you want, send the output to a postscript file, open it with PhotoShop, The Gimp etc, edit it and save it as any picture format you want! Yabasic never ceases to surprise me!