Announcement

Collapse
No announcement yet.

Emulating DOS BASIC Width 40 or 80 screens in PBCC

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Emulating DOS BASIC Width 40 or 80 screens in PBCC

    Back in the MS-DOS days, the likes of GWBASIC, QBASIC/QuickBASIC and PowerBASIC allowed for text display modes of 40x25 (Width 40) and 80x25 (Width 80) in Screen 0 (zero).

    I was wondering how PBCC might best emulate the Width 40/80 text modes with code that is compatible with CC versions 4.xx and 5.xx.

    FUNCTION Merry Christmas AS Good Cheer

  • #2
    This is one way:
    Code:
    #COMPILE EXE
    #DIM ALL
    #DEBUG DISPLAY ON
    #IF %DEF(%PB_CC32)  ' if to be compiled with PBCC6 or PBCC5, then 
      #CONSOLE OFF      ' this example doesn't need the console window 
    #ENDIF
    
    FUNCTION PBMAIN () AS LONG
      LOCAL gWin, clm, rw, ndx, fnt  AS LONG
      clm= 80
      rw =40
      FONT NEW "Lucida Console", 10, 0 TO fnt
      GRAPHIC WINDOW TEXT "TEXT window", 100,100,rw,clm, fnt TO gWin
        FOR ndx=1 TO 8
          IF ndx<8 THEN
            GRAPHIC PRINT "1234567890";
          ELSE
            GRAPHIC PRINT "1234567890"
          END IF
        NEXT ndx
        FOR ndx=2 TO 40
          GRAPHIC PRINT ndx
        NEXT ndx
        GRAPHIC WAITKEY$
        FONT END fnt
        GRAPHIC WINDOW END
    END FUNCTION
    Rod
    "To every unsung hero in the universe
    To those who roam the skies and those who roam the earth
    To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

    Comment


    • #3
      Compiling this in PBCC 5.05

      ERROR 519 -- Says That TEXT in GRAPHIC WINDOW TEXT is a missing declaration

      Turns out that GRAPHIC WINDOW TEXT is valid only with PBCC 6.xx

      ALSO -- Can you toggle (manually or automaticly) between a normal window and a graphic window in the same program?

      Comment


      • #4
        PBCC 4 and 5 - CONSOLE SET SCREEN
        PBCC 6 - CON.SCREEN

        Sets the size of the console window itself in rows and columns.

        Cheers,

        P.S. Both PBWin 10 and PBCC 6 have TXT.WINDOW. Like an extra console that can have it's size set.
        Dale

        Comment


        • #5
          Sorry, I misunderstood that PBCC 4 or PBCC 5, thinking 5 was the latest version. GRAPHIC WINDOW TEXT is PBCC 6 and will handle normal graphic statements as well as TEXT, no need to switch between the two kinds. I don't have PBCC 4 or 5 on this machine, but I think you could still emulate those sizes by figuring your font size and setting the window size accordingly. If you don't turn the #CONSOLE OFF you would have both the CONSOL and the GRAPHIC windows.
          Rod
          "To every unsung hero in the universe
          To those who roam the skies and those who roam the earth
          To all good men of reason may they never thirst " - from "Heaven Help the Devil" by G. Lightfoot

          Comment

          Working...
          X