Hello, Guest the thread was viewed477 times and contains 4 replies

last post from dddaaannn at the

CURSOR so korrekt?

  • 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

  • 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.

  • 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.