CURSOR so korrekt?

There are 4 replies in this Thread which has previously been viewed 820 times. The latest Post (March 19, 2025 at 6:55 PM) was by dddaaannn.

  • Hi,

    Ich spiele ein wenig in Basic herum und nutze zum positionieren der Textausgabe den Cursor- Befehl. Mir ist dabei aufgefallen, dass man aber immer mit ; die Ausgabe abschließen muss, sonst wird ein CRLF ausgeführt - aber ganz woanders.

    Ich habe z.b. mit PRINT einen Rahmen ums Bild gezeichnet, wobei rechts unten wohl nur ein Poke hilft, sonst scrollt alles hoch.

    Dann platzieren ich mit cursor den Cursor irgendwo, z.b. Zeile 12, Spalte 30 und schreibe einen Text. Nun sollte m.m.n. das CRLF den Cursor auf Zeile 13, Spalte 1 schieben. Tatsächlich aber scrollt jetzt der Bildschirm eine Zeile hoch (weil der Rahmen ja zuletzt in der untersten Zeile gemalt wurde?). Dadurch wird immer die Ausgabe zerstört, wenn man nicht dauernd ; anhängt, um CRLF zu unterdrücken.

    Ist das Verhalten so gewollt oder ist das ein Bug?

    Normal sollte es ja dann eine Zeile drunter (nach der letzten Ausgsbe) weitergehen.

    Gruß

    DS65

  • Zeichne den Rahmen doch mit einfach mit T@& und C@&.

    100 % echte Dummheit

    Keine künstliche Intelligenz involviert.

  • The intended behavior of the screen terminal is to scroll the screen up when PRINTing a carriage return in the bottommost row (scrolling), or push some lines down when PRINTing a character in the rightmost column (line pushing). These mechanisms allow for line entry at the bottom of the screen, and typing long logical lines in the middle of the screen. By design, PRINTing is similar to typing, and behaves by the same rules. Without the semicolon, PRINT prints a carriage return, as you would press Return at the end of a typed line.

    If you want to paint characters onto the screen using PRINT, you usually want to disable scrolling and line pushing so PRINT can reach the borders without changing the rest of the display. To disable scrolling, print CHR$(27)+"M". (To re-enable: CHR$(27)+"L") To disable line pushing, print CHR$(27)+"R". (To re-enable: CHR$(27)+"N"). CHR$(27) is Escape, so you can test these behaviors by pressing Escape then the corresponding key. The ability to disable line pushing was introduced in ROM beta 920386, and will be in the next stable release v0.97.

    It is possible that there is either a bug or unintuitive behavior when using CURSOR with PRINT. If you can give me precise steps to reproduce the behavior you're seeing, that'd help me track it down. I haven't been able to reproduce an issue with a few attempts.

    Subscribe to Dan's MEGA65 Digest: Please login to see this link.

  • 10 PRINT CHR$(27)+"4"+CHR$(147)

    20 PRINT CHR$(27)+"R"

    30 PRINT CHR$(27)+"M"

    40 FOR L=0 TO 20

    50 CURSOR 10,L:PRINT L

    60 NEXT

    70 CURSOR 36,10:PRINT "1234";

    80 PRINT CHR$(27)+"L"

    90 CURSOR 0,21:END

    It does not seem to work.

    Printing the rightmost column messes up the screen.

    What am I doing wrong ?

    Tested with ROM 920395.

    100 % echte Dummheit

    Keine künstliche Intelligenz involviert.

  • Sorry, I had a typo in my message about which ROM version is required. The ability to disable line pushing was added in ROM 9820396, and will be in the next release package v0.97. Your example works in ROM 920412.