[↑]
SmileBASIC4 Replica Reference
CHKCHR
1. Check the character code of the character displayed on the text screen

CHKCHR([ScreenID,]CoordinatesX,Y)

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)
2. Check the character code and display attributes of characters displayed on the text screen

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

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
3. Check the character code of the character displayed on the text screen

CHKCHR(ScreenID,CoordinatesX,Y,CoordinateConversionFlag)

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)
4. Check the character code and display attributes of characters displayed on the text screen

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

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
About this site
Our site is an unofficial manual site of programming software "SmileBASIC" for NintendoSwitch™.
I acquire the content of the site from the official reference site of the SmileBoom Co.Ltd. that is the development and sales cause of the software in real time (a minimum period of 24 hours update) and display it. For automatic update, contents may become improper.
Please confirm the correct content in an official site.

June 3, 2020
by mim
OK
|