The SCREEN HORIZONTAL SCROLL
command is designed to scroll the screen
horizontally, but its interpretation and the meaning of the parameter supplied
vary significantly depending on the hardware platform on which the program is
running. This peculiarity makes it essential to understand the specifics of each
system to correctly use this command and achieve the desired effect.
On Commodore computers, the numeric parameter supplied to the
SCREEN HORIZONTAL SCROLL
command takes integer values between 0 and 7.
In this range, the value 4 represents the center position of the scroll.
Values less than 4 move the screen content to the left, while values greater
than 4 move it to the right. The amount of scrolling is proportional to the
distance from the center value of 4. For example, a value of 0 or 7 will
produce maximum scrolling to the left or right, respectively, while a value
of 3 will cause a slight shift to the left of the center.
The SCREEN HORIZONTAL SCROLL
command behaves differently on the TRS-80
Color Computer 3. On this platform, the numeric parameter indicates the starting
position of the screen. A value of 0 specifies that the display begins at the
leftmost available column. As the parameter value increases, the screen is
progressively moved to the left, revealing portions of the screen that were
previously located to the right of the visible area. In other words, a larger parameter
value causes the displayed content to scroll to the left, revealing what was
beyond the right edge of the screen. This approach is more intuitive for those
who expect an increasing value to correspond to a movement in a specific direction.
This divergence in the semantics of the SCREEN HORIZONTAL SCROLL
command across
platforms highlights one of the inherent challenges in developing cross-platform
software such as ugBASIC. The developer must be aware of the target machine in
order to properly use this command and achieve the desired horizontal scrolling
effect. Often, in ugBASIC programs that aim for cross-platform compatibility,
conditional procedures (PROCEDURE ... ON target
) are used to apply different
parameter values to the SCREEN HORIZONTAL SCROLL
command, adapting the behavior
to the specifics of each system and thus ensuring a consistent user experience
or desired visual effect on each machine.
SCREEN HORIZONTAL SCROLL offset
SCREEN HORIZONTAL SCROLL 3
Join BASIC 10Liner Contest with ugBASIC!
An interesting competition is held at the beginning of each year: the
BASIC 10Liner Contest.
It is possible to use ugBASIC to participate in the next
"BASIC10Liner" competition, in the following categories:
SCREEN HORIZONTAL SCROLL ↔ ScHzScl
If you have found a problem with this keyword, if you think there is a bug or, more
simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!
open an issue
BACK TO KEYWORDS