|
Post by malcolm on Nov 19, 2020 12:13:05 GMT -5
I am converting a qbasic programme to liberty basic .
the programme is for a butcher to do invoices. My current problem is to get the last column to print underneath each other . the invoice shows up great on the screen but when I go to print it off the last column is all over the place. I have spent afew hours on this problem and am asking for help on something I am sure is a simple problem
the code is listed below
REM DAILY TOTALS
CLS
PRINT TAB(25); " W.B.CLARKE & SONS LTD."
PRINT TAB(25); " CATFORTH METHODIST CHAPEL,"
PRINT TAB(22); " CHAPEL LANE, CATFORTH, PR4 0HX."
PRINT TAB(25); " TEL NO: 01772 690439"
PRINT TAB(24); " VAT Reg.No. 732 9880 04"
PRINT
DGT = 0
FOR D = 1 TO IN
PRINT TAB(5); WDT$(D);
PRINT TAB(16); WNN(D),
PRINT TAB(30); win$(D),
PRINT TAB(70);USING ("####.##", WGT(D))
DGT = DGT + WGT(D)
NEXT D
PRINT
PRINT
PRINT TAB(52); "DAILY TOTALS",
PRINT TAB(60);USING ("####.##", DGT)
PRINT
PRINT
INPUT " DO YOU WISH TO OVERIDE PRINTER "; q$
IF q$ = "Y" THEN
INPUT "ARE YOU SURE "; q$
IF q$ = "Y" THEN
GOTO 335
END IF
END IF
REM INPUT "HAVE YOU SET THE PAGE IN THE PRINTER "; q$
LPRINT TAB(20); " W.B.CLARKE & SONS LTD."
LPRINT TAB(20); " CATFORTH METHODIST CHAPEL,"
LPRINT TAB(17); " CHAPEL LANE, CATFORTH, PR4 0HX."
LPRINT TAB(20); " TEL NO: 01772 690439"
LPRINT TAB(19); " VAT Reg.No. 732 9880 04"
LPRINT
DGT = 0
FOR D = 1 TO IN
LPRINT TAB(2); WDT$(D);
LPRINT TAB(13); WNN(D);
LPRINT TAB(21); win$(D)
LPRINT TAB(75);USING ("####.##", WGT(D))
DGT = DGT + WGT(D)
NEXT D
LPRINT
LPRINT
LPRINT TAB(62 ); "DAILY TOTALS";
LPRINT TAB(75);USING ("####.##", DGT)
LPRINT
LPRINT
DUMP
Thank you
|
|
|
Post by tsh73 on Nov 19, 2020 12:58:28 GMT -5
On screen you have line
PRINT TAB(30); win$(D), but on the printer
LPRINT TAB(21); win$(D) this missing comma gives you extra new line before last column on printer.
|
|
|
Post by malcolm on Nov 19, 2020 13:21:13 GMT -5
Thanks tsh73 for getting back so quickly. I think I missed putting that back in when I changed it back to send out but I have put it back in and it makes no difference .
the last column is on the same line as the column before there are no extra lines . I have been using semi coions but I have also tried comma's.
|
|
|
Post by tsh73 on Nov 19, 2020 14:53:10 GMT -5
So problem is not solved? Could you show a picture pointing exactly what's wrong? Your code as is is not runnable. Here's code I adapted (added dummy data) Run it and see if column on the right place. Here's what I got - upper is from LPRINT (to PDF), lower is BASIC screen REM DAILY TOTALS CLS PRINT TAB(25); " W.B.CLARKE & SONS LTD." PRINT TAB(25); " CATFORTH METHODIST CHAPEL," PRINT TAB(22); " CHAPEL LANE, CATFORTH, PR4 0HX." PRINT TAB(25); " TEL NO: 01772 690439" PRINT TAB(24); " VAT Reg.No. 732 9880 04" PRINT DGT = 0 '------------------ 'make up dummy data IN = 9 FOR D = 1 TO IN WDT$(D)="WDT$";D WNN(D)=D*10000 win$(D)="win$";D WGT(D)=D*10 NEXT D
'------------------ FOR D = 1 TO IN PRINT TAB(5); WDT$(D); PRINT TAB(16); WNN(D), PRINT TAB(30); win$(D), PRINT TAB(70);USING ("####.##", WGT(D)) DGT = DGT + WGT(D) NEXT D
PRINT PRINT PRINT TAB(52); "DAILY TOTALS", PRINT TAB(60);USING ("####.##", DGT) PRINT PRINT goto [skip] 'skip these questions. I have virtual PDF printer set up ;) INPUT " DO YOU WISH TO OVERIDE PRINTER "; q$ IF q$ = "Y" THEN INPUT "ARE YOU SURE "; q$ IF q$ = "Y" THEN GOTO 335 END IF END IF [skip]
REM INPUT "HAVE YOU SET THE PAGE IN THE PRINTER "; q$ LPRINT TAB(20); " W.B.CLARKE & SONS LTD." LPRINT TAB(20); " CATFORTH METHODIST CHAPEL," LPRINT TAB(17); " CHAPEL LANE, CATFORTH, PR4 0HX." LPRINT TAB(20); " TEL NO: 01772 690439" LPRINT TAB(19); " VAT Reg.No. 732 9880 04" LPRINT DGT = 0 FOR D = 1 TO IN LPRINT TAB(2); WDT$(D); LPRINT TAB(13); WNN(D); LPRINT TAB(21); win$(D), LPRINT TAB(75);USING ("####.##", WGT(D)) DGT = DGT + WGT(D) NEXT D LPRINT LPRINT LPRINT TAB(62 ); "DAILY TOTALS"; LPRINT TAB(75);USING ("####.##", DGT) LPRINT LPRINT DUMP
|
|
|
Post by malcolm on Nov 19, 2020 16:13:05 GMT -5
HI thanks for your hard work .I changed the semicolons for comas as you had it but it still has not brought it right. I have scanned the printed result and attached it. could this be related to the font dialog as I changed it to change the font but i have tried changing it back but it made no difference Thanks again Scan0058.pdf (185.06 KB)
|
|
|
Post by meerkat on Nov 19, 2020 16:42:49 GMT -5
I always use a function that aligns everything. It might work for you? It aligns "l" left, "r" right or "c" center
hope this helps. Dan
|
|
|
Post by malcolm on Nov 19, 2020 18:39:22 GMT -5
Thank you to both of you. I have eventually sorted it . it turned out to be the fonts and ; and , mixed up with all the changes I had made to try to fix it.
Thanks
Malcolm
|
|
|
Post by tsh73 on Nov 19, 2020 22:57:50 GMT -5
That's sure font. To make column aligned one should use monospaced font like Courier New Andale Mono Consolas Lucida Console
|
|