Text Screen Input/Output

CLS
CLS ScreenID

Clear the text screen

Argument

ScreenID

ID of text screen to delete: 0 to 4

・4 is the default.

Example

CLS
CLS 1

COLOR [ScreenID,]ColorCode

Set the drawing color of characters

・When this command is executed, the color of characters displayed in PRINT, TPRINT, INPUT, etc. will change.

Arguments

ScreenID

Text screen ID to specify the drawing color: 0 to 4

・4 is the default.

ColorCode

Character drawing color

・ARGB 8-bit color code
・See GCOLOR for details on color codes

Example

COLOR #C_WHITE
COLOR 1,#C_RED
COLOR RGB(128,192,64,64)

COLOR([ScreenID])

Get the drawing color of characters

・Get the current character drawing color.

Argument

ScreenID

ID of text screen to obtain drawing color: 0 to 4

・4 is the default.

Example

C=COLOR()
C1=COLOR(1)

LOCATE [CoordinateX],[CoordinateY]
LOCATE ScreenID,[CoordinateX],[CoordinateY]

Specify the character display coordinates to the text screen

・When this command is executed, the display coordinates of characters to be displayed in PRINT, TPRINT, INPUT, etc. will change.

Arguments

ScreenID

Text screen ID to specify display coordinates: 0 to 4

・4 is the default.

CoordinateX,CoordinateY

・Specify the coordinates to display characters.
・The number of characters that can be displayed depends on the screen size set in TSCREEN.

*If X or Y is not specified, the previous X and Y coordinates are maintained.

Example

LOCATE 20,15
LOCATE ,10
LOCATE 1,10,0

LOCATE [ScreenID] OUT CoordinateX,CoordinateY

Get character display coordinates

・Get the current character display coordinates.

Argument

ScreenID

Text screen ID to specify display coordinates: 0 to 4

・4 is the default.

Return Value

CoordinateX,CoordinateY

・Get the current character display coordinates.

Example

LOCATE OUT X,Y
LOCATE 1 OUT X1,Y1

PRINT [Expression[;Or,Expression...]]

Console character display

・If the expression is not specified, only line feed is performed.
・As an abbreviation, you may write '?'.
・PRINT displays on screen 4.
・TPRINT can specify the displayed destination screen.

Arguments

Expression

・Variables to be displayed, string variables, numeric values, strings

; (semicolon)

No line break at the end of display

, (comma)

・Displays a blank character without a line break after display.

Example

PRINT "RESULT(X,Y)=";DX*4+1,DY+1

TPRINT ScreenID[,Expression[;Or,Expression...]]

Character display on text screen

・If the expression is not specified, only line feed is performed.
・As an abbreviation, you may write 'T?'.
・Unlike PRINT, TPRINT can specify the displayed destination screen.

Arguments

ScreenID

ID of the screen that displays characters: 0 to 4

Expression

・Variables to be displayed, string variables, numeric values, strings
・Calculation formulas using arithmetic operations and functions can also be described (calculation results are displayed).

; (semicolon)

After display, it doesn't make a line break, and put the next display closely.

, (comma)

・After display, it doesn't make a line break, and open the next display at uniform space.

Example

TPRINT 1,CHR$(&HEA01);CHR$(&HEA02);

ATTR [ScreenID,]HorizontalFlip,VerticalFlip,Rotation
ATTR [ScreenID,]DisplayAttribute

Set the attributes of characters to be displayed on the text screen

・When this command is executed, the display attributes of characters displayed in PRINT, TPRINT, INPUT, etc. will change.

Arguments

ScreenID

Text screen ID to specify character display attributes: 0 to 4

・4 is the default.

HorizontalFlip

・Invert the displayed character left and right with 1.
・No inversion at 0.

VerticalFlip

・Invert the displayed characters up and down with 1.
・No inversion at 0.

Rotation

・Rotate 0, 90, 180, and 270 degrees with 0, 1, 2, and 3, respectively.

DisplayAttribute

・Set the horizontal flip, vertical flip, and rotation as a bit value.

b00 ↑ Rotation by 90 degrees (specified by 2 bits of b00 and b01)
b01
b02 Horizontal Flip (0=OFF, 1=ON)
b03 Vertical Flip (0=OFF, 1=ON)

Example

ATTR 0,0,1:PRINT "ABC" 
ATTR 2,8:TPRINT 2,"XYZ" 

ATTR [ScreenID] OUT HorizontalFlip,VerticalFlip,Rotation
ATTR( [ScreenID])

Get display character attribute of text screen

Argument

ScreenID

ID of the text screen that acquires the character display attribute: 0 to 4

・4 is the default.

Return Value

HorizontalFlip

・Invert the displayed character left and right with 1.
・No inversion at 0.

VerticalFlip

・Invert the displayed characters up and down with 1.
・No inversion at 0.

Rotation

・Rotate 0, 90, 180, and 270 degrees with 0, 1, 2, and 3, respectively.

DisplayAttribute

・Get the horizontal flip, vertical flip, and rotation as a bit value.

b00 ↑ Rotation by 90 degrees (specified by 2 bits of b00 and b01)
b01
b02 Horizontal Flip (0=OFF, 1=ON)
b03 Vertical Flip (0=OFF, 1=ON)

Example

ATTR OUT HREV,VREV,ROT
A2=ATTR(2)

SCROLL [ScreenID,]NumberOfCharactersX,NumberOfCharactersY

Scroll the contents of the text screen

・Shift the contents of the text screen in units of characters.
・Characters pushed out of the screen as a result of scrolling disappear.

Argument

ScreenID

ID of scrolling text screen: 0-4

・4 is the default.

NumberOfCharactersX

Number of scroll characters in horizontal direction

・Scroll left for positive values and right for negative values.

NumberOfCharactersY

Number of scroll characters in the vertical direction

・Scroll up with positive values and down with negative values.

Example

SCROLL 5,7
SCROLL 1,-1,0

CHKCHR([ScreenID,]CoordinatesX,Y)

Check the character code of the character displayed on the text screen

Arguments

ScreenID

ID of scrolling text screen: 0 to 4

・4 is the default.

CoordinateX,Y

Coordinates in character units

Return Value

Character code of the character displayed at the specified coordinates

・If no character is displayed, zero is returned.

Example

CODE=CHKCHR(0,0)
CODE=CHKCHR(1,10,10)

CHKCHR [ScreenID,]CoordinateX,Y OUT CharacterCode,DisplayAttribute

Check the character code and display attributes of characters displayed on the text screen

Arguments

ScreenID

ID of scrolling text screen: 0 to 4

・4 is the default.

CoordinateX,Y

Coordinates in character units

Return Value

CharacterCode

Character code of the character displayed at the specified coordinates

・If no character is displayed, zero is returned.

DisplayAttribute

Display attribute set at specified coordinates

・See ATTR cmmand.

Example

CHKCHR 0,0 OUT CH,AT
CHKCHR 1,10,10 OUT CH,AT

CHKCHR(ScreenID,CoordinatesX,Y,CoordinateConversionFlag)

Check the character code of the character displayed on the text screen

Arguments

ScreenID

ID of scrolling text screen: 0 to 4

CoordinateX,Y

Coordinate to check character code

・The meaning of coordinates changes depending on the value of the next coordinate conversion flag.

CoordinateConversionFlag

Flag that specifies the coordinate system of coordinates X and Y

・In case of 0, it is interpreted as character unit coordinates (same as LOCATE coordinates).
・In case of 1, it is interpreted as display coordinates (same as TOFS etc.).
・In the case of display coordinates, the influence of LMATRIX is not considered.

Return value

Character code of the character displayed at the specified coordinates
・ If no character is displayed, zero is returned.

Example

CODE = CHKCHR (1,10,10,0)
CODE = CHKCHR (1,200,120,1)

CHKCHR ScreenID,CoordinatesX,Y,CoordinateConversionFlag OUT CharacterCode,DisplayAttribute

Check the character code and display attributes of characters displayed on the text screen

Arguments

ScreenID

ID of scrolling text screen: 0 to 4

CoordinateX,Y

Coordinate to check character code

・The meaning of coordinates changes depending on the value of the next coordinate conversion flag.

CoordinateConversionFlag

Flag that specifies the coordinate system of coordinates X and Y

・In case of 0, it is interpreted as character unit coordinates (same as LOCATE coordinates).
・In case of 1, it is interpreted as screen coordinates (same as TOFS etc.).
・In the case of screen coordinates, the influence of LMATRIX is not considered.

Return Value

CharacterCode

Character code of the character displayed at the specified coordinates

・If no character is displayed, zero is returned.

DisplayAttribute

Display attribute set at specified coordinates

・See ATTR command.

Example

CHKCHR 1,10,10,0 OUT CH,AT
CHKCHR 1,200,120,1 OUT CH,AT

INPUT ["GuideString";]Variable[,Variable2...]

Enter numbers or strings from the keyboard

・Waiting for input until the ENTER key is entered.
・When the number of inputs is insufficient, “?Redo from start” is displayed and input again.
・Unlike other text screen commands, the text screen is fixed at 4.

Argument

GuideString

Guide message for input (optional)

・If the semicolon after the guide string is set to a comma, ? is not displayed.
・Only when using a semicolon, string variables can be used for the guide string.

Variable

Variable that receives input (numeric or string variable)

・When specifying multiple variables, separate them with a comma.

Example

INPUT "Input your name and age";NM$,AG

LINPUT ["GuideString";]StringVariable

Get string from keyboard

・Accepts "," etc. that cannot be input with the INPUT command.
・Waiting for input until the ENTER key is entered.
・Unlike other text screen commands, the text screen is fixed at 4.

Arguments

GuideString

Guide message for input (optional)

StringVariable

String variable that receives one line of input

Example

LINPUT "ADDRESS:";ADR$

INKEY$()
INKEY$(ControllerInputExclusionFlag)

Get one character entered from the keyboard

・Even if there is no input from the keyboard, it doesn't wait for input.
・When there is a preceding key input, it returns one character at a time from the oldest input.

Argument

ControllerInputExclusionFlag

・If 0 is specified, a part of the controller's button input is returned as a key input.
・If 1 is specified, the controller input is ignored.
・0, if not specified.

Correspondence between controller input and characters is as follows

+Control Pad Right CHR$(&H1C)
+Control Pad Left CHR$(&H1D)
+Control Pad Up CHR$(&H1E)
+Control Pad Down CHR$(&H1F)
A Button CHR$(&H0D)
Y Button CHR$(&H08)

Return

・Returns characters entered from the keyboard one by one.
・If there is no input, the empty string "" is returned.
・Special keys return the following characters.

Esc CHR$(&H1B)
Tab CHR$(&H09)
BackSpace CHR$(&H08)
Enter CHR$(&H0D)
Insert CHR$(&H1A)
Delete CHR$(&H10)
Home CHR$(&H02)
End CHR$(&H03)
PageUp CHR$(&H11)
PageDown CHR$(&H12)
CHR$(&H1C)
CHR$(&H1D)
CHR$(&H1E)
CHR$(&H1F)

Example

C$=INKEY$()
KBONLY$=INKEY$(1)

TSCREEN FontType[,CharacterSize]

Set the width of the console (text screen 4) and the font used for display

・The width and height are set by dividing the screen size by the character size.

Arguments

FontType

Type of font used for display: 8 to 64 (multiple of 8)

・If you specify 24 or more, only user-defined characters will be displayed.

FontSize

Character display size: 8 to 64

Example

TSCREEN 8

TSCREEN ScreenID,FontType,CharacterSize[,Width,Height]
TSCREEN ScreenID,FontType,Width,Height

Set text screen size and font used for display

Arguments

ScreenID

ID of text screen to set: 0 to 4

FontType

Type of font used for display: 8 to 64 (multiple of 8)

・If you specify 24 or more, only user-defined characters will be displayed.

FontSize

Character display size: 8 to 64

Width,Height

Specify text screen width and height in characters

・Width x height can be specified up to 32768.
・If the width and height not specified or 0 is specified, the current screen size divided by the character size is set.

Example

TSCREEN 1,16,16,100,100

TSCREEN [ScreenID] OUT FontType,CharacterSize,Width,Height

Get text screen size and font used for display

Argument

ScreenID

ID of text screen to delete: 0 to 4

・4 is the default.

Return Value

FontType

Type of font used for display: 8 to 64

FontSize

Character display size: 8 to 64

Width,Height

Text screen width and height

Example

TSCREEN OUT FONT,SIZE,W,H
TSCREEN 1 OUT FONT,SIZE,W,H

TPAGE [ScreenID,]GraphicPage,ReferenceOriginX,ReferenceOriginY

Set a reference graphic page for user-defined characters

・Set a graphic page that references a picture of user-defined characters and a reference origin.
・User-defined characters are 4096 characters from &HE800 to &HF7FF, and characters in this range refer to the place set by TPAGE as the font.
・Normal characters that are not user-defined characters cannot change the reference graphic page or reference origin.
・Calling TPAGE after indicating characters also affects the displayed characters.

Arguments

ScreenID

ID of text screen to set: 0 to 4

・4 is the default.

GraphicPage

Reference graphic page: -1 to 5

ReferenceOriginX,ReferenceOriginY

Reference origin coordinates in the graphic page

・For user-defined characters, refer to the range of 64x64 characters from the reference origin.
・If the font type is 8, it will be 512x512 pixels, if it is 16, it will be 1024x1024 pixels, if 32, it will be 2048x2048 pixels.

TPAGE [ScreenID] OUT GraphicPage,ReferenceOriginX,ReferenceOriginY

Get a reference graphic page for user-defined characters

Arguments

ScreenID

ID of the text screen to obtain reference information: 0 to 4

・4 is the default.

GraphicPage

Graphic page to refer to

ReferenceOriginX,ReferenceOriginY

Reference origin coordinates in the graphic page

TCOLOR ScreenID,ColorCode

Set the color to multiply the entire text screen

・COLOR sets the color in units of characters, whereas TCOLOR changes the overall color by multiplying the entire text screen by the specified color.

Arguments

ScreenID

ID of text screen to set: 0 to 4

ColorCode

Drawing color to set

・8-bit color code for each ARGB
・See GCOLOR

TCOLOR(ScreenID)

Get the color to multiply the entire text screen

Argument

ScreenID

ID of text screen to get color from: 0 to 4

Return Value

Drawing color set for the specified text screen

TLAYER ScreenID,LayerID

Set the layer to which the text screen belongs

Arguments

ScreenID

ID of text screen to set: 0 to 4

LayerID

ID of the layer to which the screen belongs: 0 to 7

TLAYER(ScreenID)

Get the layer to which the text screen belongs

Argument

ScreenID

ID of text screen to obtain layer ID: 0 to 4

Return Value

Layer ID to which the screen belongs

TPUT ScreenID,X,Y,CharacterCode[,DisplayAttribute]
TPUT ScreenID,X,Y,String[,DisplayAttribute]

Write a character at the specified coordinates on the text screen

Arguments

ScreenID

Text screen ID for writing characters: 0 to 4

X,Y

Coordinate to write character

CharacterCode

Character code of characters to write: 0 to 65535

・If you specify a character code that does not have a font, x is displayed.

String

A string containing the character to write

・Write the first character.

DisplayAttribute

Character display attribute

・Same display attributes as set by ATTR.
・If not specified, the display attribute set in ATTR is used.

TFILL ScreenID,StartPointX,StartPointY,EndPointX,EndPointY,CharacterCode[,DisplayAttribute]
TFILL ScreenID,StartPointX,StartPointY,EndPointX,EndPointY,String [,DisplayAttribute]

Fill the specified area of the text screen with the specified character/string

Arguments

ScreenID

Text screen ID for writing characters: 0 to 4

StartPointX,StartPointY,EndPointX,EndPointY

Range to write characters

・The upper left area is a rectangle surrounded by the StartPointX and StartPointY, and the lower right area is surrounded by the EndPointX and EndPointY.

CharacterCode

Character code of characters to write: 0 to 65535

・If you specify a character code that does not have a font, x is displayed.

String

A string containing the character to write

・The characters in the string fill from the upper left to the right. When they reach at the far right, step down one line and fill from the left end to the right.

DisplayAttribute

Character display attribute

・Same display attributes as set by ATTR.
・If not specified, the display attribute set in ATTR is used.

Example

TFILL 0,2,2,10,5,&HE810,#A_REVV
TFILL 0,2,6,11,10,"ABC" 

THOME ScreenID,HomeCoordinateX,HomeCoordinateY

Set the home coordinate (coordinate reference point) of the text screen

Home coordinates are used as the coordinate reference point of the TOFS command, TROT(Rotation) and TSCALE (scaling) center point

Arguments

ScreenID

ID of text screen to set: 0 to 4

HomeCoordinateX,HomeCoordinateY

Home coordinate to be set

・Depending on the hardware specifications, setting a Real may cause the reference font image to shift by one pixel.

THOME ScreenID OUT HomeCoordinateX,HomeCoordinateY

Get text screen home coordinates

Argument

ScreenID

ID of text screen to obtain: 0 to 4

Return Value

HomeCoordinateX,HomeCoordinateY

Home coordinate

TOFS ScreenID,X,Y[,Z]

Set text screen display coordinates

・The relationship between THOME and TOFS can be thought of as "take the coordinates on the text screen set with THOME to the coordinates on the display set with TOFS".

Arguments

ScreenID

ID of text screen to set: 0 to 4

X,Y

Display coordinates to be set

・Depending on the hardware specifications, setting a Real may cause the reference font image to shift by one pixel.

Z

Display priority: -4095 to 4095

・The smaller it is, the closer it is displayed.

TOFS ScreenID OUT X,Y[,Z]

Get text screen display coordinates

Argument

ScreenID

ID of text screen to obtain: 0 to 4

Return Value

X,Y

Display coordinates

Z

Display priority

TROT ScreenID,Angle

Set text screen rotation angle

・Rotate around the home position set in THOME.

Arguments

ScreenID

ID of text screen to set: 0 to 4

Angle

Rotation angle (degree)

・Depending on the hardware specifications, the reference font image may be shifted by 1 pixel depending on the setting angle.

TROT(ScreenID)

Get text screen rotation angle

Argument

ScreenID

ID of text screen to obtain: 0 to 4

Return Value

Rotation angle

TSCALE ScreenID,MagnificationX,MagnificationY

Enlarge/reduce the text screen

・Zoom in/out around the home position set in THOME.
・Zoom in with a value greater than 1.0 (2.0 makes double), reduce down with a value less than 1.0 (0.5 makes half).

Arguments

ScreenID

ID of text screen to set: 0 to 4

MagnificationX,MagnificationY

Set the magnification factor to horizontal (X) and vertical (Y)

・Depending on the hardware specifications, the reference font image may be shifted by 1 pixel depending on the setting value.

TSCALE ScreenID OUT MagnificationX,MagnificationY

Get the scale of the text screen

Arguments

ScreenID

ID of text screen to obtain: 0 to 4

MagnificationX,MagnificationY

Current zoom ratio

TSHOW ScreenID

Display text screen

Argument

ScreenID

Screen ID to display: 0 to 4

TSHOW(ScreenID)

Get text screen display status

Argument

ScreenID

Screen ID to get: 0 to 4

Return Value

Returns 1 if the text screen is displayed, otherwise 0.

THIDE ScreenID

Hide text screen

Argument

ScreenID

Screen ID to hide display: 0 to 4

THIDE(ScreenID)

Get text screen display status

Argument

ScreenID

Screen ID to get: 0 to 4

Return Value

Returns 0 if the text screen is displayed, otherwise 1.

TBLEND ScreenID,CompositeMethod

Set the text screen composition method

Arguments

ScreenID

Text screen ID to set the composition method: 0 to 4

CompositeMethod

Composition method to set: 0 to 1

・Normal composition with 0, additive composition with 1.

TBLEND(ScreenID)

Get text screen composition method

Argument

Screen ID

ID of the text screen to obtain the synthesis method: 0-4

Return value

Set synthesis method
・ Normal synthesis with 0, additive synthesis with 1.

TANIM ScreenID,AnimationTarget,DataArray[,Loop]

Set animation on the text screen (specified by array)

Text screen animation common specifications

・Animation is to set a value and wait for a specified time.
・The animation starts from the next frame after running TANIM.
・Accept up to 32 data for each target element.
・If a negative value is specified for time, linear interpolation is performed from the previous value.

Arguments

TextScreenID

ID of text screen to set animation: 0 to 4

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of text screen internal variable 7)

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・"I" and "UV" that can be used with SPANIM are ignored even if they are specified.

DataArray

1D numeric array that stores animation data

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

DataArray

・Anime data is prepared in the following order in the numerical array (up to 32).
・Time1,Item1,[Item2,] Time2,Item1,[Item2,]...

Example

DIM PANIM[ 6 ]
PANIM[0]=-60 'frame(-60=smooth)
PANIM[1]=200 'offset X,Y
PANIM[2]=100
PANIM[3]=-30 'frame
PANIM[4]=50 'offset
PANIM[5]=20
TANIM 0,"XY",PANIM

TANIM ScreenID,AnimationTarget,"@LabelString"[,Loop]

Set animation on the text screen (specified with DATA command)

Arguments

ScreenID

ID of text screen to set animation: 0 to 4

AnimationTarget

Numeric value or string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of text screen internal variable 7)

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・"I" and "UV" that can be used with SPANIM are ignored even if they are specified.

@LabelString

・The first label of the DATA command that stores the animation data.
・@Label name is enclosed in "" and specified as a string (or character variable).

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

Data

Animation data is prepared in the following order in the DATA command

DATA NumberOfKeyFrames (up to 32)
DATA Time1,Item1[,Item2]
DATA Time2,Item1[,Item2]
:

Example

@MOVDATA
DATA 2 'counter
DATA -60,200,100 'frame,offset
DATA -30,50,20 'frame,offset
TANIM 0,"XY",@MOVDATA

TANIM ScreenID,AnimationTarget,Time1,Item1[,Item2][,Time2,Item1[,Item2]]...[,Loop]

Set animation on the text screen (directly specified as an argument)

Argument

ScreenID

ID of text screen to set animation: 0 to 4

AnimationTarget

Numeric value or character string that manages the element to be changed

0 "XY" XY Coordinates
1 "Z" Z Coordinate
2 "R" Rotation Angle
3 "S" Magnification XY
4 "C" Display Color
5 "V" Variable (value of text screen variable 7)
6 "UV" UV Coordinates (definition source image coordinates)
7 "I" Definition Number

・If you add "+" to the end of the string or add 8 to the value, it will be the relative value from the animation start point.
・"I" and "UV" that can be used with SPANIM are ignored even if they are specified.

Time,Item

・Animation data itself (up to 32 as many as necessary).

Loop

Loop count: 1 or more

・Specify 0 to make an infinite loop.
・1, if not specified.

Example

TANIM 0,"XY",-60,200,100,-30,50,20

TANIM ScreenID,AnimationDefinitionNumber

Set the animation on the text screen (specified by the animation definition number)

Arguments

ScreenID

ID of text screen to set animation: 0 to 4

AnimationDefinitionNumber

Definition number already defined by ANIMDEF command: 0 to 1023

Example

ANIMDEF 0,"XY",-60,100,0
TANIM 0,0

TANIM [ScreenID]

Clear the animation set in the text screen

Argument

ScreenID

ID of text screen to clear animation: 0 to 4

・If not specified, clear all screen animations.

Example

TANIM 0
TANIM

TSTOP [ScreenID]

Stop the text screen animation

Argument

ScreenID

Target text screen ID: 0 to 4

・If not specified, animation of all text screens is stopped.

Example

TSTOP

TSTART [ScreenID]

Start text screen animation

Argument

ScreenID

Target text screen ID: 0 to 4

・If not specified, start animation of all text screens.

Example

TSTART

TCHK(ScreenID)

Get text screen animation state

Argument

ScreenID

Target text screen ID: 0 to 4

Return Value

b00 XY Coordinates 1 #CHKXY
b01 Z Coordinate 2 #CHKZ
b02 Rotation 4 #CHKR
b03 Magnification XY 8 #CHKS
b04 Display Color 16 #CHKC
b05 Variable 32 #CHKV

Target assignment for each bit (when all are 0, animation is stopped)

Example

ST=TCHK(0)
'|b00|#CHKXY|
'|b01|#CHKZ|
'|b02|#CHKR|
'|b03|#CHKS|
'|b04|#CHKC|
'|b05|#CHKV|

TVAR ScreenID,VariableKey,Value
TVAR ScreenID,VariableKey

Write to text screen variables

・Cleared when program execution starts or ACLS is called.

Arguments

ScreenID

Target text screen ID: 0 to 4

VariableKey

The name of the text screen variable

・A string or Int can be given as a name.

Value

Value to be registered in internal variable

・Numerical values or strings can be registered.
・If not specified, the value associated with the variable key is deleted.

Example

TVAR 0,7,1
TVAR 0,"NAME","VALUE" 
TVAR 0,"NAME" 'Delete value

TVAR(ScreenID,VariableKey)

Get text screen variable

Argument

ScreenID

Target text screen ID: 0 to 4

InternalVariableNumber

The name of the text screen variable

・A string or Int can be given as a name.

Return Value

Value set by TVAR

・If no value is set with TVAR, the Int 0 is returned.

Example

V=TVAR(0,0)

TVAR ScreenID[,VariableKey]

Delete text screen variables

Argument

ScreenID

Target screen ID: 0 to 4

VariableKey

The name of the text screen variable to delete

・A string or Int can be given as a name.
・If not specified, all text screen variables in the specified screen are deleted.

Example

TVAR 0,7
TVAR 0,"NAME" 

TCOPY CopyDestinationScreenID[,CopySourceScreenID],StartPointX,StartPointY,EndPointX,EndPointY,TransferDestinationX,TransferDestinationY

Copy the character information in the text screen

Argument

CopyDestinationScreenID

Copy destination text screen ID: 0 to 4

CopySourceScreenID

Copy source text screen ID: 0 to 4

・If not specified, the same screen as the copy destination screen is specified.

StartPointX,Y,EndPointX,Y

Source start and end coordinates

TransferDestinationX,Y

Start point coordinates of the copy destination

TCOPY 4,0,0,9,9,10,10
TCOPY 4,1,0,0,9,9,10,10

TSAVE ReadoutScreenID,[X,Y,Width,Height,]TransferDestinationArray

Copy text screen character information to array

・Refer to TARRAY for the data structure in the array.

Argument

ReadoutScreenID

Text screen ID for retrieving character information: 0 to 4

X,Y,Width,Height

Start point X, Y coordinate, width, height of the copy source range

・If not specified, the entire text screen is specified.

TransferDestinationArray

Numeric array variable that stores character information

・If there are not enough elements in the array, it is automatically added only to the 1D array.

Example

DIM WORK%[]
TSAVE 4,WORK%

TLOAD WritingScreenID,[X,Y,Width,Height,]TransferSourceArray

Copy character information from array to text screen

・Refer to TARRAY for the data structure in the array.

Argument

WritingScreenID

Text screen ID for writing character information: 0 to 4

X,Y,Width,Height

Start point X, Y coordinate, width, height of writing range

・If not specified, the entire text screen is specified.

ImageArray

Numeric array containing character information

Example

DIM WORK%[]
TLOAD 4,WORK%

TARRAY(ScreenID)

Get an Int array representing the contents of text screen

・Text screen characters, attributes, and colors can be directly read and written as an Int type 2D array.
・Use TUPDATE to reflect the written result.

Argument

ScreenID

ID of the target screen to get the array: 0 to 4

Return Value

Int type 2D array representing the contents of the target screen

・The array size is [ScreenHeight,ScreenWidthx2].
・One character is represented by two elements. The first element contains the display attribute in the upper 16 bits, the character code in the lower 16 bits, and the display color in the second element.

Example

T=TARRAY(0)
T[0,0]=&HE810
PRINT HEX$(T[0,0])

TUPDATE ScreenID [,StartPointX,StartPointY,EndPointX,EndPointY]

Reflect the contents written by TARRAY in the display

・Since normal text screen commands internally perform processing equivalent to TUPDATE, using TUPDATE after executing a character display command has no effect.
・Even if TUPDATE is not used, it is automatically reflected when writing with another character display command near the update coordinates.

Arguments

ScreenID

ID of screen to reflect: 0 to 4

StartPointX,StartPointY,EndPointX,EndPointY

Start and end coordinates of the rectangular area to be reflected

・If not specified, the entire screen is updated.

T=TARRAY(0)
T[0,0]=&HE811
T[0,1]=#C_RED
TUPDATE 0

TFUNC ScreenID,"@Label"
TFUNC ScreenID,"UserDefinedCommandName"

Assign a callback process for each text screen

・It's a command for advanced users who need callback processing.
・You can specify either the label you want to jump with GOSUB or the name of the DEF command you want to execute.
・Callback processing of all text screens is executed at once by CALL TEXT.
・At the callback destination, the management number can be acquired using the CALLIDX function.

Argument

ScreenID

Target text screen ID: 0 to 4

@Label

Label of the processing destination to be called

UserDefinedCommandName

The name of the user-defined command to be called

Example

TFUNC 0,"@PROG" 
TFUNC 1,"USERDEF" 

TFUNC ScreenID

Clear callback processing assigned to text screen

Argument

ScreenID

Clear text screen ID: 0 to 4

Example

TFUNC 0

TCOORD ScreenID, ConvertSourceCoordinatesX,Y [,Mode] OUT ConvertResultCoordinatesX,Y

Convert display coordinates to text screen coordinates

Argument

ScreenID

ID of scrolling text screen: 0 to 4

CoordinateX,Y

Coordinate to check character code

・The meaning of coordinates changes depending on the value of the next mode.

Mode

Specify the coordinate conversion method: 0 to 2

0 Convert text screen coordinates (in dots) to display coordinates
1 Convert display coordinates to character coordinates on the text screen
2 Convert display coordinates to dot coordinates on the text screen

・0, if not specified.
・When using display coordinates, the effect of LMATRIX is not considered.

Return Value

ConvertResultCoordinatesX,Y

Coordinate value of conversion result

・The meaning of the coordinates returned depends on the mode value.

Example

TCOORD 1,10,10,0 OUT DX,DY
GPSET DX,DY,#C_WHITE

TCOORD 1,100,50,1 OUT CX,CY
LOCATE CX,CY:?"A" 

TCOORD 1,100,50,2 OUT SX,SY