Announcement

Collapse
No announcement yet.

Locate

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

  • Locate

    Does LOCATE default to "SCREENY" size?

    The reason I ask is based on the following code:

    Code:
        GOSUB Check_Cursor
        INCR LineY
        INCR LineC
        IF LineC > tC.NumDatas THEN LineC = tC.NumDatas
        IF LineY >= tC.NumDatas + 1 THEN
          LineY = tC.NumDatas + 1             '[color=blue] strange behavior here[/color]
          LOCATE LineY, LineX                   '
          EXIT SELECT
        END IF
        IF LineY > ConsY - 1 THEN
          A$ = SetHeads(tC.NumHeads, tF(), Dhead$())
          COLOR 7, 0
          CLS
          LOCATE 1, 1
          PRINT A$;
          Char = LineC - (ConsY - 2)
          IF Char < 1 THEN Char = 1
          LineY = 2
          FOR I = Char TO LineC
            LOCATE LineY, 1
            PRINT Ddat$(I);
            INCR LineY
          NEXT I
          DECR LineY
          LOCATE LineY, LineX
          COLOR 7, 4
          EXIT SELECT
        END IF
        LOCATE LineY, 1
        PRINT Ddat$(LineC)
        LOCATE LineY, LineX
    When tC.NumDatas is greater than the number of rows for the console, the cursor is set at the number of rows in the console.
    Walt Decker

  • #2
    PB Help Manual, LOCATE topic (emphasis added):
    If either expression is missing or invalid, that particular coordinate is left unchanged.
    Since LOCATE is based on the console's actual screen rows and columns setting, then trying to exceed the count in either would be invalid.
    Rick Angell

    Comment


    • #3
      Thanks, Richard. I missed that in the docs. Gotta learn to read.
      Walt Decker

      Comment

      Working...
      X