Is it possible to clear only text area or clear only graphics area?
REM graphics_window
VDU 24,0,0,1847,1400
REM text_window
VDU 28,0,5,80,0
PRINT TAB(0,0)"CLS test"
MOVE 50,50
DRAW 1200,50
Clear text area or graphics area
-
- Posts: 127
- Joined: Tue 07 May 2019, 16:47
Clear text area or graphics area
BBC Model B - 1984-1989. 6502 assembler, Unicomal 1988-1994, Some C and C++, Pascal 1990-1994. Bought a copy of BBC-BASIC 2007, but started to program at a daily basis 2019. C++ in 2021.
-
- Posts: 327
- Joined: Wed 04 Apr 2018, 06:36
Re: Clear text area or graphics area
Yes.
Code: Select all
VDU28,10,40,36,4
COLOUR133
CLS
VDU24,100;300;800;700;
GCOL0,132
CLG
-
- Posts: 127
- Joined: Tue 07 May 2019, 16:47
Re: Clear text area or graphics area
Sorry for not writing correct grammar but will text below be understandable:
If I use VDU 12 or VDU 16 or CLS or CLG all the screen area is erased.
I'm only trying to erase text area or graphics area - not both.
REM graphics_window
VDU 24,0,0,1847,1400
REM text_window
VDU 28,0,5,80,0
PRINT TAB(0,0)"CLS test"
MOVE 50,50
DRAW 1200,50
IF condition_what_ever THEN
CLS or VDU 12 REM clear only text window
ELSE
CLG or VDU 16 REM clear only graphics window
ENDIF
If I use VDU 12 or VDU 16 or CLS or CLG all the screen area is erased.
I'm only trying to erase text area or graphics area - not both.
REM graphics_window
VDU 24,0,0,1847,1400
REM text_window
VDU 28,0,5,80,0
PRINT TAB(0,0)"CLS test"
MOVE 50,50
DRAW 1200,50
IF condition_what_ever THEN
CLS or VDU 12 REM clear only text window
ELSE
CLG or VDU 16 REM clear only graphics window
ENDIF
BBC Model B - 1984-1989. 6502 assembler, Unicomal 1988-1994, Some C and C++, Pascal 1990-1994. Bought a copy of BBC-BASIC 2007, but started to program at a daily basis 2019. C++ in 2021.
Re: Clear text area or graphics area
By default, yes, but after you define a text viewport with VDU 28... CLS clears only that area:
Code: Select all
MODE 8
VDU 28,0,5,79,0
COLOUR 128+1
CLS
Code: Select all
MODE 8
VDU 24,0;0;1278;800;
GCOL 128+4
CLG
-
- Posts: 127
- Joined: Tue 07 May 2019, 16:47
Re: Clear text area or graphics area
I think I'm not clear in my writing. I'm trying to have both types of areas on screen at the same time. I attach a drawing.
You do not have the required permissions to view the files attached to this post.
BBC Model B - 1984-1989. 6502 assembler, Unicomal 1988-1994, Some C and C++, Pascal 1990-1994. Bought a copy of BBC-BASIC 2007, but started to program at a daily basis 2019. C++ in 2021.
Re: Clear text area or graphics area
Yes, you were perfectly clear. My first code snippet defines a text viewport occupying the top 6 lines (rows) and the second snippet defines a graphics viewport occupying the bottom 800 graphics units. If you combine the two snippets into one program you get exactly what you describe, thus:
Code: Select all
MODE 8
VDU 28,0,5,79,0
VDU 24,0;0;1278;800;
COLOUR 128+1
GCOL 128+4
CLS
CLG
You do not have the required permissions to view the files attached to this post.
-
- Posts: 127
- Joined: Tue 07 May 2019, 16:47
Re: Clear text area or graphics area
Exactly what I wanted to achieve.
Thanks.
Thanks.
BBC Model B - 1984-1989. 6502 assembler, Unicomal 1988-1994, Some C and C++, Pascal 1990-1994. Bought a copy of BBC-BASIC 2007, but started to program at a daily basis 2019. C++ in 2021.