Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
simplest possible scrolling
#1
Please, can you show me the simplest possible example of scrolling up-down in a text program (by arrow keys)? I can't seem to understand tutorials.
illingtoProgram
Reply
#2
This should be pretty easy to figure out... Just play around with it.

Smile

Code:
DEFINT A-Z
SCREEN 13

DIM Array(1 TO 223) AS STRING

FOR A = 1 TO 223
Array(A) = CHR$(A + 32)
NEXT


DO
In$ = INKEY$
IF In$ = "8" THEN StartPosition = StartPosition - 1
IF In$ = "2" THEN StartPosition = StartPosition + 1

IF StartPosition > 200 THEN StartPosition = 200
IF StartPosition < 0 THEN StartPosition = 0

FOR T = 1 TO 23
  ArrayPosition = StartPosition + T
  LOCATE T, 1
  PRINT LTRIM$(STR$(ArrayPosition)); SPACE$(1); STRING$(5, Array(ArrayPosition)); SPACE$(5)
NEXT

LOOP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)