Announcement

Collapse
No announcement yet.

CONSOLE SET SCREEN - no error returned

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

    CONSOLE SET SCREEN - no error returned

    'Can't get an error from CONSOLE SET SCREEN with XP SP3
    'Also, if system starts in FULL SCREEN may need to get to window mode
    'The easiest way I've found is to SHELL "DOSBOX.EXE /WINDOW" 'Perfect Sync
    ' I've probably reported this before, but cannot find it.
    '
    Code:
    #COMPILE EXE
    #DIM ALL
    FUNCTION PBMAIN () AS LONG
      'The problem here is that the buffer size must be as large as size or get scroll bars
      LOCAL r&,c  AS LONG    'rows and columns wanted
      LOCAL rr,cc AS LONG    'after CONSOLE GET SCREEN
      LOCAL counter AS LONG
      REM SHELL "DOSBOX.EXE /WINDOW"          'another matter
      r   = 30               'request rows
      c   = 71               'request columns
      SLEEP 250
      CONSOLE SET SCREEN r, c
      SLEEP 250
      IF ERR THEN
        ? "CONSOLE SET SCREEN never showed an error, until now! (XP SP3)";ERRCLEAR
        WAITKEY$
        EXIT FUNCTION
      END IF
      SLEEP 1000
      CONSOLE GET SCREEN TO rr&, cc&
      SLEEP 1000
      PRINT " r"," c"," rr"," cc"
      ? r,c,rr,cc
      IF r <> rr OR c <> cc THEN
        BEEP
        ? "Failed, but no error reported.
        ? "Press any key to end program"
        WAITKEY$
        EXIT FUNCTION
      ELSE
        ? "Success, you may continue"
        WAITKEY$
        FOR counter = 1 TO r -1
          ? "Row"r
        NEXT
        ? "Row";r
      END IF
      WAITKEY$
    END FUNCTION

    #2
    Submitted to support.
    Is there a way to determine valid screen sizes before CONSOLE SET SCREENl?
    Last edited by Mike Doty; 16 Aug 2008, 02:19 PM.

    Comment


      #3
      There's a GetLargestConsoleWindowSize() function, if all you are interested in is the max size.

      Or,

      You can try SetConsoleScreenBuffer () function with different X and Y values in the COORD structure, and test if Windows Complains? Might be ugly, but might not.

      Are you sure 'invalid screen size' is your problem? Or is this a guess? Or is it a whole 'nother question?

      MCM
      Michael Mattias
      Tal Systems (retired)
      Port Washington WI USA
      [email protected]
      http://www.talsystems.com

      Comment


        #4
        It is not a guess, posted code above.
        I've had this problem for a long time.
        Thanks for the info, I'll check them out.
        I do very little with consoles, but it is nice to know it will work on other machines. DosBox /FullScrn and DosBox /Window have been needed.

        Comment


          #5
          Searching for that was exactly what I needed!
          Might even write more console apps, now!

          Comment

          Working...
          X
          😀
          🥰
          🤢
          😎
          😡
          👍
          👎