Dear List and dear Maxim,

at your request there are two attachments in BASIC.

The first one is for QB.exe (Quick Basic) and is composed to have a
inkjet printer function on a WordStar file... a kind of printerdriver.

It is used with the folowing files:

===================== !printer.bat =========================
ECHO OFF
CLS

ECHO ****** copyright 1997 : Bastiaan T. Edelman, PA3FFZ ******
TYPE !print.txt
pause For "new" caracterset : press ^C

QB /RUN !XER11!.BAS

=============================================================

now the directions for use in !print.txt are printed (sri Dutch)

===================== !print.txt ============================
******
******
Het doel van het programma:
uitprinten van een WordStar bestand met de XeroX XJ5 inktjet printer.

Oude karakterset : bestanden met Toshiba T1000 aangemaakt
                   de tekens voor � � � � � � � � komen dan ook goed.
         daarvoor werden gebruikt [ ] \ | } ~ ` {

Nieuwe karakterset : [ ] \ | } ~ ` {  blijven zoals ze zijn

>>>>>>>>>>>> Dit programma gebruikt de nieuwe karakterset
             ============================================

afbreken voor de oude karakterset met ^C en dan Y
opstart commando voor de oude set : !prt-oud  (.bat)

******
=============================================================
The above mentioned caracters are corrupted anyway in this e-mail, but
they are eg. 'ohm' 'mu' 'diameter' and 'umlaut' caracters for German and
Dutch language.

Then the program !xer11!.bas is started.
It uses the conversion program 'wsconvt.exe' in a DOS shell, a conver-
sion to ASCII (caracterset 437).
The converted file is read line by line and checked for caracters that
need to be converted for the XEROX XJ5 printer (= HP deskjet 500).
Then a new file is written and send to the printer.

After that all the temporary files are killed.

Most comments in the program are translated into English.
I hope you understand... originaly in Dutch.

========================== !xer11!.bas ====================
'copyright 1997, Bastiaan T.Edelman, PA3FFZ


'This program uses a WordStar file to be printed by inktjet printer HP500
'WSfile$ = WS file to read

'converted line by line to !WSfile with WSCONVT.exe (DOS) into ASCII
'ASCII => !convt!

'The file !convt! is read line by line and checked for caracters to be
'changed... as the printer needs the converted caracters.

'The converted file is saved in => !prnfile

'BASIC... DOS ... SHELL ... BASIC ... DOS ... printing

'After printing all temporary files are deleted

'******** READ FILE AND CONVERT TO ASCII ****************************
SHELL "dir/w"
PRINT
PRINT

      INPUT "Give filename to be printed"; WSfile$
      OPEN WSfile$ FOR INPUT AS #3
      OPEN "!WSfile" FOR OUTPUT AS #4
DO UNTIL EOF(3)

      LINE INPUT #3, WSregel$
      PRINT #4, WSregel$                 'regel = line
LOOP
      CLOSE #3, #4

SHELL "wsconvt !WSfile !convt! b"

'******** OLD FILE READ ******** NEW FILE WRITE ***********

OPEN "!CONVT!" FOR INPUT AS #1
OPEN "!PRNFILE" FOR OUTPUT AS #2
PRINT #2, CHR$(27) + "E"    'reset printer
PRINT #2, CHR$(27) + "&l0L"
PRINT #2, CHR$(27) + "&a7L" 'linker kantlijn

50    Nw% = 0

      LINE INPUT #1, regel$              'read first line
      IF EOF(1) THEN GOTO 250

120
                                                   'zoeken naar..(search)
               IF Nw% = 0 THEN Zoek$ = CHR$(14)  'enlarged
               IF Nw% = 1 THEN Zoek$ = CHR$(5)   'italic
               IF Nw% = 2 THEN Zoek$ = CHR$(18)  'italic off
               IF Nw% = 3 THEN Zoek$ = CHR$(20)  'enlarged off
               IF Nw% = 4 THEN Zoek$ = CHR$(17)  'sub script on
               IF Nw% = 5 THEN Zoek$ = CHR$(23)  'sub script off
               IF Nw% = 6 THEN Zoek$ = CHR$(2)   'dik (bold)
               IF Nw% = 7 THEN Zoek$ = CHR$(19)  'onderstreep (underscore)
               IF Nw% = 8 THEN Zoek$ = CHR$(31)  'afbreekstreepje -
               IF Nw% = 9 THEN Zoek$ = CHR$(15)  'condensed (small)

                                                    'replace by ....
               IF Nw% = 0 THEN Nieuw$ = CHR$(27) + "(s5H"
               IF Nw% = 1 THEN Nieuw$ = CHR$(27) + "(s1S"
               IF Nw% = 2 THEN Nieuw$ = CHR$(27) + "(s0S"
               IF Nw% = 3 THEN Nieuw$ = CHR$(27) + "(s10H"
               IF Nw% = 4 THEN Nieuw$ = CHR$(27) + "(s-1U"
               IF Nw% = 5 THEN Nieuw$ = CHR$(27) + "(s+0U"
               IF Nw% = 6 THEN Nieuw$ = CHR$(27) + "(s3B"
               IF Nw% = 6 THEN Nieuw2$ = CHR$(27) + "(s0B"
               IF Nw% = 7 THEN Nieuw$ = CHR$(27) + "&d1D"
               IF Nw% = 7 THEN Nieuw2$ = CHR$(27) + "&d@"
               IF Nw% = 8 THEN Nieuw$ = "-"
               IF Nw% = 9 THEN Nieuw$ = CHR$(27) + "(s15H"



               IF Nw% = 10 THEN GOTO 210            'all replaced

       Maal% = 1                'caracter not exists
       Nw% = 1 + Nw%
150                                                 'converting now

               Daar% = INSTR(regel$, Zoek$)         'Daar% is place in line
               IF Daar% = 0 THEN GOTO 120           'No such caracter
         Links$ = LEFT$(regel$, Daar% - 1)          '- 1 = 1 replace caracter
         Lengte% = LEN(regel$)
         Rechts$ = RIGHT$(regel$, Lengte% - Daar%)

          regel$ = Links$ + Nieuw$ + Rechts$ + CHR$(27) + "(s10H"
                                                    'this is the new line
                                                    'CHR$ ++ is enlarged off

'LET OP ! Nw% is 1 up => codes at Nw% also 1 up !!!!

       Maal% = 1 + Maal%
       IF Maal% = 2 AND Nw% = 7 THEN Nieuw$ = Nieuw2$
       IF Maal% = 4 AND Nw% = 7 THEN Nieuw$ = Nieuw2$
       IF Maal% = 2 AND Nw% = 8 THEN Nieuw$ = Nieuw2$
       IF Maal% = 4 AND Nw% = 8 THEN Nieuw$ = Nieuw2$


         GOTO 150            'but more than one of the same caracter possible

210
            PRINT #2, regel$                    'new line to new file
            PRINT regel$
GOTO 50                                         'next line (regel)
250
            PRINT
            PRINT

' ******** THE PRINTING AND DELETING OF TEMP. FILES **********

CLOSE #1, #2
SHELL "TYPE !PRNFILE > PRN"
PRINT "Het printen is klaar"        'Printing ready
PRINT
PRINT "Type Alt F  X to exit program"

KILL "!convt!"
KILL "!prnfile"
KILL "!WSfile"
END

=================================================================

The second program is written in GW-BASIC and is used to key a radio
transmitter via the RS232 COM1 port.
Keying is done in MORSE code.

Some comments:
40 INPUT S => speed (inverted)
50 INPUT text as -.-. (morse code)
         1 = standard text
         2 = any text in ASCII
720 pause to listen (receive)

This program is mostly use on XT laptop (4,7MHz)

========================== sein-232.bas =========================
10 CLS
20 PRINT"copyright 1998 * PA3FFZ, Bastiaan T.Edelman"
21 PRINT"==========================================="
22 PRINT
25 PRINT"Seinen met de RS232-poort via pen20 (25) of pen4 (9)"
26 PRINT
30 PRINT "S is de langzaamheid"
40 INPUT"Geef een getal voor S   ",S
50 PRINT "Geef de te seinen tekst in punt. streep- en spatie "
60 PRINT"Voor de standaard tekst: toets 1"
65 PRINT"Tekst in letters en cijfers: toets 2"
70 INPUT L$
80 IF L$="1" THEN L$="- . ... -   -.. .   .--. .- ...-- ..-. ..-. --..   .. -.   .--- 
--- ...-- ..--- -... ..-   -.- -.-   "
90 IF L$="2" THEN CLS:INPUT"Geef uw tekst in kleine letters  ",T$:L$=""
100 LE=LEN(T$)
110 FOR Y=1 TO LE
120 TX$=MID$(T$,Y,1)
130 IF TX$="a" THEN P$=".- "
140 IF TX$="b" THEN P$="-... "
150 IF TX$="c" THEN P$="-.-. "
160 IF TX$="d" THEN P$="-.. "
170 IF TX$="e" THEN P$=". "
180 IF TX$="f" THEN P$="..-. "
190 IF TX$="g" THEN P$="--. "
200 IF TX$="h" THEN P$=".... "
210 IF TX$="i" THEN P$=".. "
220 IF TX$="j" THEN P$=".--- "
230 IF TX$="k" THEN P$="-.- "
240 IF TX$="l" THEN P$=".-.. "
250 IF TX$="m" THEN P$="-- "
260 IF TX$="n" THEN P$="-. "
270 IF TX$="o" THEN P$="--- "
280 IF TX$="p" THEN P$=".--. "
290 IF TX$="q" THEN P$="--.- "
300 IF TX$="r" THEN P$=".-. "
310 IF TX$="s" THEN P$="... "
320 IF TX$="t" THEN P$="- "
330 IF TX$="u" THEN P$="..- "
340 IF TX$="v" THEN P$="...- "
350 IF TX$="w" THEN P$=".-- "
360 IF TX$="x" THEN P$="-..- "
370 IF TX$="y" THEN P$="-.-- "
380 IF TX$="z" THEN P$="--.. "
390 IF TX$="1" THEN P$=".---- "
400 IF TX$="2" THEN P$="..--- "
410 IF TX$="3" THEN P$="...-- "
420 IF TX$="4" THEN P$="....- "
430 IF TX$="5" THEN P$="..... "
440 IF TX$="6" THEN P$="-.... "
450 IF TX$="7" THEN P$="--... "
460 IF TX$="8" THEN P$="---.. "
470 IF TX$="9" THEN P$="----. "
480 IF TX$="0" THEN P$="----- "
490 IF TX$="/" THEN P$="-..-. "
500 IF TX$="?" THEN P$="..--.. "
510 IF TX$="." THEN P$=".-.-.- "
520 IF TX$="-" THEN P$="-....- "
530 IF TX$=" " THEN P$="  "
540 IF TX$="=" THEN P$="-....- "
550 IF TX$="," THEN P$="--..-- "
560 L$=L$+P$
580 NEXT Y
585 PRINT L$
590 L=LEN(L$)
600 L=LEN(L$)
610 A$=INKEY$
620 IF A$="p" THEN PRINT"PAUSE .... toets op F5 om verder te gaan":STOP
630 PRINT"SEINEN .... TOETS OP p VOOR EEN PAUSE"
640 L=LEN(L$)
650 FOR X=1 TO L
660 Q$=MID$(L$,X,1)
670 IF Q$="." THEN OUT(1020),1:GOSUB 750
680 IF Q$="-" THEN OUT(1020),1:GOSUB 770
690 IF Q$=" " THEN OUT(1020),0:GOSUB 790
700 FOR W=0 TO S:NEXT W
710 NEXT X
720 PRINT"LUISTEREN":FOR W=0 TO S*100:NEXT W
730 GOTO 610
740 END
750 FOR W=0 TO S:NEXT W:OUT(1020),0
760 RETURN
770 FOR W=0 TO S*3:NEXT W:OUT(1020),0
780 RETURN
790 FOR W=0 TO S*2:NEXT W
800 RETURN

==============================================================

Hope this will be usefull to Maksim,
Bastiaan

+
-- This mail was written by user of Arachne, the Ultimate Internet Client
-- Arachne V1.61, NON-COMMERCIAL copy, http://arachne.cz/

!xer11!.bas

sein-232.bas

Reply via email to