Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Printing to 25th line inQuick Basic 4.5

gaj2gaj2 Member Posts: 1
I'm not sure if this message belongs in this group, but I'm not sure where else to post it.

I am writing a program in QB 4.5 which will display the disk directory of a given sub-directory. (I prefer DOS to Windows Explorer.)

I am programming in a "Command Prompt" window on a Windows 2000 PC.

I want to display the files on the 25 line by 80 column text screen, listing 24 files, then the "Press any key..." message while waiting for a keypress. I am reading lines of text from a disk file, and printing them to the screen.

However, Quick Basic doesn't allow me to display anything on the 25th line of the screen! (The screen scrolls AFTER printing to the 24th line, even if I include a semicolon at the end of the PRINT statement.

I CAN put the "Press any key..." message on the 25th line with a LOCATE 25,1:PRINT command.

Is there a way to print to all 25 lines on the screen without scrolling?

(I recall on the old IBM PC/XT, in GWBasic, there was a function key menu on the 25th screen line which you couldn't PRINT to... Does QuickBasic have a similar feature?)

Thanks for any information!

Comments

  • gunnargunnar Member Posts: 50
    you could make an array and then load the lines from the file, and do the scrolling in the array like this:

    '-----------------cut here-----------------------'
    'this is supposed to work'
    '...'
    'but it's not very optimal!'
    'well, anyway, it should give you the basic idea'
    SHELL "C:" 'change the drive'
    SHELL "cd Linux" 'change the directory'
    SHELL "dir /b >C: mpfile.tmp" 'guess what'
    OPEN "C: mpfile.tmp" FOR INPUT AS #1
    x = 0
    DIM array(1 TO 25) AS STRING

    DO WHILE NOT EOF(1)
    DO WHILE x < 25 ''
    x = x + 1 '| get 25 files to the array...'
    LINE INPUT #1, array(x) '|'
    LOOP '/'
    GOSUB printit
    LOOP
    CLOSE
    END

    printit:
    CLS
    FOR a = 1 TO 25 'and print them'
    LOCATE a, 1: PRINT array(a)
    NEXT a
    RETURN

    '----------------cut here---------------'




    : I'm not sure if this message belongs in this group, but I'm not sure where else to post it.
    :
    : I am writing a program in QB 4.5 which will display the disk directory of a given sub-directory. (I prefer DOS to Windows Explorer.)
    :
    : I am programming in a "Command Prompt" window on a Windows 2000 PC.
    :
    : I want to display the files on the 25 line by 80 column text screen, listing 24 files, then the "Press any key..." message while waiting for a keypress. I am reading lines of text from a disk file, and printing them to the screen.
    :
    : However, Quick Basic doesn't allow me to display anything on the 25th line of the screen! (The screen scrolls AFTER printing to the 24th line, even if I include a semicolon at the end of the PRINT statement.
    :
    : I CAN put the "Press any key..." message on the 25th line with a LOCATE 25,1:PRINT command.
    :
    : Is there a way to print to all 25 lines on the screen without scrolling?
    :
    : (I recall on the old IBM PC/XT, in GWBasic, there was a function key menu on the 25th screen line which you couldn't PRINT to... Does QuickBasic have a similar feature?)
    :
    : Thanks for any information!
    :
    :

  • Folker FritzFolker Fritz Member Posts: 19
    If you use the PRINT command then qbasic uses a linefeed after the written text. and when you are at line 25 the linefeed moves you to line 26 (outside the screen) and scrolls the screen upwards so that it could the viewed on the screen. to remove the linefeed simple
    use a ';' after your text.

    wrong:
    [code]LOCATE 25, 1: PRINT "TEST"[/code]

    correct:
    [code]LOCATE 25, 1: PRINT "TEST"[red];[/red][/code]

Sign In or Register to comment.