Menu

Line 25

Anonymous
2014-10-30
2014-10-30
  • Anonymous

    Anonymous - 2014-10-30

    Good Morning,
    we need to run an old bas file that uses all the 25 lines of gwbasic screen; PC-BASIC only allows 24 lines? How could we solve the problem? It is very important, because the correction of the code should be very very long and complicated. Thank you and Best Regards
    Paolo

     
  • Rob Hagemans

    Rob Hagemans - 2014-10-30

    Hi Paolo,

    Make sure your program includes KEY OFF at the start, which will clear line 25 and make it available to print. This would also be necessary to make it run correctly in GW-BASIC, by the way.

    Another option is to run the program directly with PC-BASIC from the command line:
    pcbasic PROGRAM.BAS
    will set KEY OFF automatically before running PROGRAM.BAS (again, following GW-BASIC behaviour).

    For example, the following short program should work:

    10 CLS: KEY OFF                                                                  
    20 FOR I = 1 TO 25                                                              
    30   LOCATE I,1: PRINT "line",I;                                                     
    40 NEXT                                                                         
    50 A$=INKEY$: IF A$="" GOTO 50
    

    Hope this helps; let me know if you run into any issues - it's easiest if you include a short program that illustrates what doesn't work.

    Rob

     
  • Anonymous

    Anonymous - 2014-10-30

    Hi Rob, thank you for the fast answer!

    Here a sample:
    30 KEY 4 , "SYSTEM"+CHR$(13)
    32 KEY 10, "GOTO 2000"+CHR$(13)
    34 COMMON P1$ :KEY OFF
    36 VIEW PRINT 1 TO 25 :CLS

    I get "Illegal function call in 36"

    BR
    Paolo

     
  • Rob Hagemans

    Rob Hagemans - 2014-10-30

    Thanks, that makes clear what's going on.

    Regular GW-BASIC doesn't actually allow VIEW PRINT 1 to 25, but Tandy-1000 GW-BASIC does. (I don't know why - this is the behaviour I reverse engineered from my copy of GW-BASIC 3.23.) So I would suspect your program was perhaps developed for Tandy. Fortunately, PC-BASIC can handle that too.

    If you tell PC-BASIC to accept Tandy syntax, your code should run fine. Either specify --syntax=tandy on the command line (so run as pcbasic --syntax=tandy) or set a line syntax=tandy in your PCBASIC.INI file.

    If you actually need Tandy graphics modes as well (SCREEN 3 to SCREEN 6), you should go for full Tandy emulation with --preset=tandy, but note that you'll have lower resolution in text mode.

    Rob

     
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.