No announcement yet.

Help with CONSOLE SET SCREEN problem

  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with CONSOLE SET SCREEN problem


    In trying to execute a size change of the console, using the PowerBasic’s Console Compiler 4.0’s command,

    CONSOLE SET SCREEN ncRows, ncColumns

    I have been unable, for the vast majority of screen sizes, to affect a size change, regardless of how ncRows is set. Generally no change occurs at all. An example in which this is the case is the little program below, which I wrote to try to understand what is going on with the command in question:

    #DIM ALL


    DIM rows AS LONG, columns AS LONG, i AS LONG
    FOR i = 25 TO 69
    CONSOLE SET SCREEN i, 70 'ncRows&, ncColumns&
    CONSOLE GET SCREEN TO rows, columns
    PRINT i; " = index", rows; " = rows", columns; " = columns"
    NEXT i


    When I do run the above program, a typical result is for the number of rows to, in fact, decrease perhaps to 23, and remain fixed regardless of the value of i. Only intermittently does the screen actually change size so that the number of rows matches the index, i, and usually only for a specific value of i, reverting back to a much lower row and column size as i increments. In addition, when this does happen, it does so erratically, varying from run to run, with no modification at all on my part and with no discernable pattern. This is a typical output from the program after I went through the loop a few times:

    42 = index 23 = rows 68 = columns

    and what I saw is consistent with the output, i.e. the report produced by the command “CONSOLE GET SCREEN “does seem to be reporting results correctly—the console did appear to be of dimensions of about 23 rows and 68 columns. Notice also, that even the column has decremented to 68, even though it is held at 70 throughout the run. I do observe that the vertical scroll bar shrinks as I repeatedly hit return, indicating that the virtual console is increasing in size, though the visible console remains unchanged. The PowerBasic log file is normal, with no errors. Also, when I run this in the IDE, ERR = 0 throughout the run. The computer that produced this output is a Dell DM051 with a system memory of 3584 MB, a Phoenix BIOS, a RADEON X600 256MB HyperMemory video adapter, and it runs a Windows XP operating system, service pack 2. For whatever it’s worth, I have run this same code on a HP Pavilion laptop using the same operating system and the program behaved as it should.

    Any assistance or workaround to this problem, other than using another machine, would be appreciated. The actual application I am working on that will invoke the CONSOLE SET command is expected to be run on various platforms, so I am anxious to resolve this issue.

    Thank you,

    Last edited by Paul Kohn; 2 Feb 2008, 10:00 PM.

  • #2
    Paul, I've always been able to solve all my console display proglems through System Menu.

    If you haven't tried it, you can right click on the caption on your console window.

    In Default and Layout, changing some of those numbers might fix your problem. They won't come into effect till the next time you run your console window.

    If you want to test the different buffers and screen sizes, you can click on Properties and Layout which should work on your running console window. But it won't stick. You have to set it up in default to make it stick.

    Others have different ways on handling console problems, maybe somebody can come by with a better answer.

    I tried your little program and it ran like it should. It attached scroll bars at 50 rows and that was when it hit bottom.


    • #3
      Good Suggestion

      Thanks Jerry:

      That is a good suggestion. I tried it and it works. Since I don’t know who ultimately will run the actual application I am working on and on what platform, I can include this as a workaround in my external documentation. I do suspect “CONSOLE SET SCREEN” works for the vast majority of configurations (in fact it works on yours and it works on my other computer) or this issue would have probably have come up a long time ago in these forums, but there could always be those few for whom it does not. Your suggestion is simple and direct. Thanks again.



      • #4
        Hi Paul, I just ran across your post. We had same problem. Pbcc3.0 command CONSOLE SCREEN worked. PBCC 4.01 CONSOLE SET SCREEN actually worked but problem is the console window is not maximized so scroll bars are added. PBCC 4.03 CONSOLE SET SCREEN worked and console window was displayed maximized - all worked perfect. PBCC 4.04 went back to console not maximized. By adding win api call ShowWindow(CONSHNDL,%SW_MAXIMIZE) after CONSOLE SET SCREEN - I believe that resolved the problem. I will be testing in PBCC 5.01 to see what the results are.


        • #5
          Can't get screen to set to sizes specified with PB/CC 5.01
          I believe there is a solution somewhere on the BBS.
          Try this test program to see sizes are not set, but no error is returned.
          #COMPILE EXE
          #DIM ALL
            LOCAL rows AS LONG, columns AS LONG
            LOCAL NewRows AS LONG, NewColumns AS LONG
            columns = 60
            FOR rows = 25 TO 69
              CONSOLE SET SCREEN rows,columns
              SLEEP 250
              IF ERR THEN
                ? "ERROR" + STR$(ERRCLEAR)
                CONSOLE GET SCREEN TO NewRows, NewColumns
                IF ERR THEN
                  PRINT "rows","columns","newrows","newcolumns"
                  PRINT rows,columns,newrows,newcolumns
                END IF
              END IF
          END FUNCTION
          Here are some useful routines for full screen and graphics.

          Main reason I don't write more PB/CC programs is not being able to figure out how to control console size.
          Last edited by Mike Doty; 22 Apr 2009, 01:23 PM.