MODE, IF........ENDIF Tutorial 007
The following short program shows how the possible BB4W "screen modes" set
by the MODE statement affect the display which your own programs will produce.
REM Screen Modes Demo
OFF
FOR m=0 TO 33
MODE m
PRINT"BB4W has 33
Screen Modes"
PRINTTAB(0,5)"This is MODE ";m
COLOUR1
PRINT'STRING$(10,"0123456789")
COLOUR2
PRINT'"(One hundred characters)"
IF m<33 THEN
COLOUR3
PRINT''"Press a key
for next mode"
ELSE PRINT''"That's it"
ENDIF
hold=GET
NEXT m
As ususal Select/Copy/Paste this program listing into the BB4W editing window,
then RUN it.
To see how it works look at the following asterisked
comments:
Annotated listing (Don't run this):
100 REM Screen Modes Demo
110 OFF
120 FOR m=0 TO 33 ******** Steps through all the available screen
modes ********
130 MODE m
140 PRINT"BB4W has 33 Screen Modes"
150 PRINTTAB(0,5)"This is MODE ";m
160 COLOUR1 ******Some modes only have black and white
so ineffective"
170 PRINT' STRING$(10,"0123456789") *****Prints ten copies
of the string 0123456789 *****
180 COLOUR2
190 PRINT'"(One hundred characters)"
200 IF m<33 THEN ***** See line 240 for the
corresponding ENDIF *****
210 COLOUR3
220 PRINT''"Press a key for next mode"
230 ELSE PRINT''"That's it"
240 ENDIF
250 hold=GET *** program waits here until a key
is pressed ***
260 NEXT m
For more information on MODE statements see the BB4W Help file under the
section which begins:
MODE
MO.
A statement to set the screen display mode. The screen (i.e. BASIC's output
window) is cleared and all the graphics and text parameters (colours, origin,
etc) are reset to their default values. ...............................etc
Next Tutorial
Richard Weston's Homepage