Menu

Command Line Options

2014-07-25
2015-02-23
  • DarrenCaskey

    DarrenCaskey - 2014-07-25

    When Invoking GWBasic from DOS, the command line can include options such as file size. ie: /s:500 which allows the default file size to be larger than the 128 bytes default.

    can PC-BASIC accommodate larger files settings?

     
  • Rob Hagemans

    Rob Hagemans - 2014-07-26

    Hi Darren, at the moment there is no option corresponding to /s in PC-BASIC, so that the default maximum record length is 128. Note that this does not affect the maximum file size, which can be much larger.

    Implementing a record size option certainly is on the list of things to do. My intention is to support all GW-BASIC options. If you have a particular use case for this, let me know and I can prioritise.

    Alternatively, if you're willing to mess a bit with the python code - the record length check is on line 885 of statements.py in the master branch of the source code; changing this line would probably allow you to define larger record lengths. (I'd have to check for side effects but it's worth a try; in the long run, this should definitely not be hard-coded in).

     

    Last edit: Rob Hagemans 2014-07-26
  • Rob Hagemans

    Rob Hagemans - 2014-08-19

    The -s switch is now available in release 14.08

    By the way, to see all command-line options, run pcbasic -h

     

    Last edit: Rob Hagemans 2014-08-19
  • Anonymous

    Anonymous - 2014-09-29

    There is no or little documentation about values that I can put in PCBASIC.INI items: for example how can I print directly in PCBASIC? (I have a LPT1: printer under WinXP SP3 and it works in "real" GWBASIC")
    Thanks

     
  • Rob Hagemans

    Rob Hagemans - 2014-09-29

    You're right, documentation is still lacking, partly because options are in a state of flux (this is still very much beta software, after all). Your best bet is to run pcbasic -h on the command line, which will list all the available options and some explanation of the values. The options in PCBASIC.INI are the same as on the command line.

    To answer your question, it should work with lpt1=PRINTER:default if your printer is set up as the default or with lpt1=PRINTER:PrinterName where PrinterName is the name of the printer in the "Printers and Faxes" tab.

     
  • Anonymous

    Anonymous - 2014-10-01

    Thanks for your fast replay, but it doesn't work. With any modification done in PCBASIC.INI in lptx item, PCBASIC starts but its window closes immediately. I confitm that the printer (a Brother HL-2270DW series) is the USB default printer, and it's virtualized with a NET USE LPT1:= ..... statement.

     
  • Rob Hagemans

    Rob Hagemans - 2014-10-01

    There appears to be a regression in reading the printers from the INI file in version 14.08. I'll fix it for the next minor release.

     
  • Anonymous

    Anonymous - 2015-02-07

    hi I am poppop

    I am excited that I found your pc-basic emulator. after so many years after buying a new win 7 computer I can get back to using gwbasic. my old programs run very well and I can edit and build new programs; however, I am not able to lprint to my usb hp 7300 printer. I have followed some of the previous discussions with no success. I do get print when I leave program thru "system" or shutdown.
    in the pcbasic.ini file there is three (3) lines of direction for lpt1. I assume that the val line is the one to add :printer:hpxxx to. will the pcbasic support usb drives? if so what do I have to do to make it work?
    I am pretty familiar withcomputer lingo, although I have been out of the field since 1995. I think my last try at gwbasic was in 2002.
    would appreciate any advice you may give,

    thanks
    poppop

     
    • Rob Hagemans

      Rob Hagemans - 2015-02-08

      Hi poppop,

      Thanks for your interest!

      From your report, I'm not entirely sure whether you managed to get output from your printer at all or not. It seems like you did, but only on closing PC-BASIC with SYSTEM. If that's what you're seeing, then PC-BASIC supports your USB printer correctly.

      However, if I understand you correctly, you expect the printing to happen before you close PC-BASIC. One option you could try to change is print-trigger=, which I notice appears to be undocumented at the moment. I'll add a line to the documentation. If you set print-trigger=page, the printer should start after every page break. This may be better for your use case.

      I'm not entirely sure how GW-BASIC treated this; I only remember using it with track-feeder dot matrix printers, which simply printed every line as it was LPRINTed. That's not doable with modern printers, so some compromise needs to be found.

      Let me know how you get on -- also, if you continue to experience difficulties, could you let me know what version of PC-BASIC you use (what is the name of the file you downloaded) and what operating system you use (EDIT: I see you use Windows 7). If possible, could you attach the BASIC program you use to do the printing? It would help me understand where PC-BASIC's behaviour is different from what one would expect it to be.

      If any of my assumptions above are incorrect, please correct me and we can move on from there.

      Rob

       

      Last edit: Rob Hagemans 2015-02-08
  • Anonymous

    Anonymous - 2015-02-08

    Dear Rob,

    some time ago I opened the dicussion "Differences PCBasic to GWBasic for an user" and you solved most of my problems with new releases of pc-basic. Only the problem with printing still existed. But now, with print-trigger=page it prints without closing the program. THANK YOU VERRY MUCH, your help is perfect.

    Peter from Vienna, Austria

     
  • Rob Hagemans

    Rob Hagemans - 2015-02-08

    Hi Peter, that's excellent. Is that with the 14.10 release?

    I have a question for you and poppop and anyone else who has used GW-BASIC (the original) for printing: At what point did it send the text to the printer? Unless it could only be used with track-fed paper, it must have collected print commands to go on the same page, then send it all off to the printer in one go. If not, you'd get one sheet of paper for every line of text.

    Anyone remember how this worked, or still has a working MSDOS+GWBASIC+parallel printer setup to test it?

    Rob

     
  • Anonymous

    Anonymous - 2015-02-08

    Dear Rob,

    since Windows 7 I could use my GW_Basic programs only in XP-mode and there I used DOSPRN, a program which allowed to set a fixed time of printer-time-out and after this time without further lprint it started printing.

    Peter

     
    • Rob Hagemans

      Rob Hagemans - 2015-02-08

      Thanks Peter! That's an interesting approach.

       
  • Anonymous

    Anonymous - 2015-02-08

    i am using your pc-basic 14.10.2 (3.23)
    do i put the printer-trigger command in the ini file or where?

    originally i wrote programs in basica and converted to gwbasic.(self taught). my printer(s) were Epson tractor feed serial or parallel driven. my programs would print on any "lprint" instruction. on win xp i could print to file then print to printer. this was bulky and time consuming. i have not done any programming since i went to win 7. your emulator is the first one that will work in win 7.

    i will try to attach one of my programs i wrote for a small business payroll. they used this program until they went with quick books. if you download and try to run it, start with "run 18". it will "list" starting with 10.

    i may have to find me a serial or parallel printer so i can produce what i am wanting to do.
    let me know if attachment comes through.

    thanks for your support

    poppop

     
    • Rob Hagemans

      Rob Hagemans - 2015-02-08

      You can do either of two things:
      1) Either, add a line to PCBASIC.INI:
      print-trigger=page

      2) Or, run PC-BASIC from the command line with:
      pcbasic --print-trigger=page

      If run with this setting, PC-BASIC should send a print job to your printer as soon as a form feed character CHR$(12) is printed. You'll probably see a Windows print dialog come up. Without the setting, you should see a print dialog come up when you close PC-BASIC.

      I wouldn't try to find another printer. For PC-BASIC, it makes no difference whether your printer is a USB printer, a serial printer or a parallel printer, because the printer is controlled by Windows. If it's not working right with your current printer, it won't be different with another type of printer.

      Thanks for sending the payroll program. I'll have a look and see if I can reproduce the problem.

      Rob

       
  • Anonymous

    Anonymous - 2015-02-09

    rob

    thanks again for the help. let me know if, and how the payroll program works. I do enjoy working with basic. I have a son that thinks I'm nuts. he is a computer genie and division director for a large insurance company. he once was web page manager for Victoria secret.

    I got carried away.

    thanks a lot

    poppop

     
    • Rob Hagemans

      Rob Hagemans - 2015-02-09

      Hi, the payroll program works fine for me. I run it with --print-trigger=page and when I select option 2 in the menu and type a name I created, it prints a statement right away.

       
  • Anonymous

    Anonymous - 2015-02-11

    ROB
    that is what it does for me. however, I don't want it to print until I have all employee info entered and then when the program ask for "lprint". I can work with it the way it is. I will do some adjustments. I am working on a different program now and I believe I can make it all work. thanks for all you have done. I do appreciate the way pc-basic performs.

     
  • Rob Hagemans

    Rob Hagemans - 2015-02-11

    OK - if it helps, you can get finer control over printing without the print-trigger command-line option by opening a file to "LPT1:" and printing to the file. It will be sent to the printer when you close the file rather than when you close the program.

     
  • Anonymous

    Anonymous - 2015-02-11

    rob
    good advice. i will probably use that. one way or other I will be able to use pc-basic

    poppop

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.