CT-User
[Top] [All Lists]

Qbasic program to laser print *.dup and *.mul

To: <ct-user@contesting.com>
Subject: Qbasic program to laser print *.dup and *.mul
From: 72240.1433@compuserve.com (Robert E.Naumann)
Date: 01 Dec 94 14:38:45 EST
'**First line of Program*****************************************
'PROGRAM TO CONVERT Dot Matrix Formatted DUP or MUL Files 
'to Laser Printer Codes  by KR2J
'Save this message as an ascii file keeping everything
'between the first line and last line markers let me know if you have 
'any difficulty
'If you have a Quickbasic compiler, you can create an executable
'program from this file and use the following line instead of using the
'file name input routine for QBasic

'The following is the line to use in QuickBasic
'ProcessFile$ = COMMAND$

'The command$ function allows you to give the proigram the filename
'as a command line parameter ala "ct binfile" 

cls

' the following 2 lines should be removed if you compile this program
' in MicroSoft QuickBasic

Print "Enter the file name with the extension and press Enter"
Input ProcessFile$
ProcessFile$ = UCASE$(ProcessFile$)
IF ((INSTR(ProcessFile$, ".DUP")) OR (INSTR(ProcessFile$, ".MUL"))) THEN
 nufile$ = LEFT$(ProcessFile$, INSTR(ProcessFile$, ".") + 1) + "LZ"
 CLS
 LOCATE 1, 3
 PRINT "   Dot Matrix to HP Laser Formatter for -DUP- amd -MUL- Files ";
 LOCATE 3, 3
 PRINT " A file called "; nufile$; " will be generated "
 LOCATE 4, 3
 PRINT " that will be printable on an HP Laser Printer or Compatible";
 LOCATE 10, 10
 PRINT " Processing Line Number " 
 OPEN ProcessFile$ FOR INPUT AS #1 LEN = 2048
 OPEN nufile$ FOR OUTPUT AS #2 LEN = 2048
 WHILE NOT EOF(1)
  LINE INPUT #1, Work$
    X = X + 1
    IF X = 1 THEN PRINT #2, CHR$(27) + "(s0p10H"
    LOCATE 10, 36
    PRINT X;
    PrintReset = INSTR(Work$, CHR$(18))
    SmallPrint = INSTR(Work$, CHR$(15))
    IF PrintReset THEN
        MID$(Work$, PrintReset) = CHR$(27)
        Front$ = MID$(Work$, 1, PrintReset)
        End$ = MID$(Work$, PrintReset + 1, LEN(Work$))
        Converted$ = Front$ + "E" + End$
        Front$ = ""
        End$ = ""
    END IF
    IF SmallPrint THEN
        MID$(Work$, SmallPrint) = CHR$(27)
        Front$ = MID$(Work$, 1, SmallPrint)
        End$ = MID$(Work$, SmallPrint + 1, LEN(Work$))
        PRINT #2, Front$ + "(s0p16.66H"
        Converted$ = End$
        Front$ = ""
        End$ = ""
    END IF
    IF SmallPrint = 0 AND PrintReset = 0 THEN
        Converted$ = Work$
    END IF
    PRINT #2, Converted$
    PrintReset = 0
    SmallPrint = 0
 WEND
ELSE
    PRINT "The file must be either a *.DUP or a *.MUL file"
    END
END IF
CLOSE
END
'**********Last line of program****************************************







<Prev in Thread] Current Thread [Next in Thread>
  • Qbasic program to laser print *.dup and *.mul, Robert E.Naumann <=