[↑]
SmileBASIC4 Replica Reference
All references
Exclusive Commands for Direct Mode
NEW
Erase the program in all program slots
NEW ProgramSlot
Erase the program in the specified program slot
LIST
Switch to edit mode
LIST [ProgramSlot:]LineNumber
Switch to Edit Mode and move the cursor to the specified line number of the specified program slot
LIST ERR
Switch to Edit Mode and move the cursor to the position where the error occurred immediately before.
RUN
Execute the program in program slot 0.
RUN ProgramSlot
Execute the program in the specified program slot.
CONT
Resume execution of a stopped program.
TRACE
Execute only one command of a stopped program
BACKTRACE
Display subroutine and user-defined commands call history
PROJECT "ProjectName"
Changing the current project
SUBRUN FileNameString
Load the specified program on the subprogram side and start execution as a subprogram
SUBSTOP
Stop the running subprogram from the main program side
SUBSHOW
Display the subprogram display
SUBHIDE
Hide the subprogram display
CLEAR
Initialize BASIC internal memory
Variables and Arrays Definitions, Operation Related Commands
VAR Variable[=Expression][,Variable[=Expression]...]
DIM Variable[=Expression][,Variable[=Expression]...]
Define variables explicitly
VAR ArrayVariableName[[NumberOfElements[,NumberOfElements...]]]
DIM ArrayVariableName[[NumberOfElements[,NumberOfElements...]]]
Create an array and set it to a variable
VAR ArrayVariableName[[NumberOfElements[,NumberOfElements...]]]=[Value1,Value2,...]
DIM ArrayVariableName[[NumberOfElements[,NumberOfElements...]]]=[Value1,Value2,...]
Create an array, set the value of the element in advance and set it to the variable
Variable = Expression
Substitute the result of an expression into a variable
SWAP Variable1,Variable2
Exchange values in two variables
INC Variable[,Expression]
Add the result of the expression to the value in the variable
DEC Variable[,Expression]
Subtract the result of the expression from the value in the variable
COPY (CopySourceArray[,CopySourceOffset[,NumberOfCopyElements]])
Copy an array
COPY (CopySourceString[,CopySourceOffset[,NumberOfCopyCharacters]])
Copy the string
COPY CopyDestinationArray[,CopyDestinationOffset],CopySourceArray[[,CopySourceOffset],NumberOfCopyElements]
Copy the contents of an array to another array
COPY CopyDestinationArray[,CopyDestinationOffset],LabelString[,NumberOfCopyData]
Read DATA column into array
COPY CopyDestinationStringVariable[,CopyDestinationOffset],CopySourceString[[,CopySourceOffset],NumberOfCopyCharacters]
Copy part or all of a string to another string variable
RINGCOPY CopyDestinationArray,CopyDestinationOffset,CopySourceArray[[,CopySourceOffset],NumberOfCopyElements]
RINGCOPY CopyDestinationArray,CopyDestinationOffset,CopySourceArray[[,CopySourceOffset],NumberOfCopyElements] OUT Variable
Recognize array as ring buffer and copy data to it
SORT [StartPosition,NumberOfElements,]Array1[,Array2,...]
Sort the array in ascending order
RSORT [StartPosition,NumberOfElements,]Array1[,Array2,...]
Sort the array in descending order
PUSH Array,Expression
Add elements to the end of an array
POP (Array)
Extract elements from the end of an array
UNSHIFT Array,Expression
Add elements to the beginning of an array
SHIFT (Array)
Extract elements from the beginning of an array
FILL Array,Value[,Offset[,NumberOfElements]]
Set all array contents to the specified value
TYPEOF (Value)
Find the value type
ARRAY% (NumberOfElements[,NumberOfElements...])
ARRAY#(NumberOfElements[,NumberOfElements...])
ARRAY$(NumberOfElements[,NumberOfElements...])
Create an array
DIM (Array)
DIM(Array,Dimension)
Check the number of array dimensions and the number of elements in each dimension
RESIZE Array,NumberOfElements[,NumberOfElements...]
Change the size of an array
INSERT Array,InsertionPosition[,NumberOfElements[,InitialValue]]
Insert elements into a 1D array
REMOVE Array,DeletionPosition [,NumberOfElements]
Delete 1D array elements
FIND (Array,Value)
Search an array for a specified value and return the found position
FIND Array,Value OUT Index1[,Index2...]
Search an array for a specified value and return the found position
INSPECT Value
Display detailed value information
Control Commands
@Label
Identifier indicating the location of the program or data
GOTO @Label
GOTO String
Jump to the specified label position
GOSUB @Label
GOSUB String
Jump to the specified label position
RETURN
Jump to the command following the GOSUB command used immediately before.
ON Expression GOTO @Label0,@Label1…
Branch to the label line corresponding to the value of the expression
ON Expression GOSUB @Label0,@Label1…
Branch to the label line corresponding to the value of the expression and return to the next command after ON GOSUB by using the RETURN command
ON BREAK GOTO @Label
Register the jump destination when the user tries to stop the program
IF Expression THEN CodeBlock1
IF Expression THEN CodeBlock1 ELSE CodeBlock2
CodeBlock1 is executed when the value of the expression is true (other than 0)
IF Expression THEN [LineFeed] CodeBlock1 ENDIF
IF Expression THEN [LineFeed] CodeBlock1 ELSE [LineFeed] CodeBlock2 ENDIF
CodeBlock1 is executed when the value of the expression is true (other than 0)
ELSEIF Expression THEN ...
Keywords for executing additional IF statements when conditions are not satisfied by IF statements
IF Expression GOTO @Label [ELSE CodeBlock]
Branch to label when expression is true (other than 0)
CASE Expression
Start conditional branch by CASE
WHEN Expression
Specify the branch condition in CASE to ENDCASE
OTHERWISE
Specify what to do when none of the WHENs is correspond within CASE to ENDCASE
ENDCASE
Terminate conditional branch by CASE
LOOP
LOOP to ENDLOOP loop start keyword
ENDLOOP
Jump to the command immediately following the corresponding LOOP keyword
FOR LoopVariable=InitialValue TO EndValue
FOR LoopVariable=InitialValue TO EndValue STEP Increment
Repeat the process a specified number of times
Command indicating the end of a FOR loop
WHILE Expression
If the calculation result of the expression is false (0), jumps to the command following the next WEND.
WEND
Jump to the previous WHILE command and execute again from WHILE.
REPEAT
REPEAT-UNTIL loop start command
UNTIL Expression
If the expression evaluates to false (0), jumps to the corresponding REPEAT command.
CONTINUE
Force the next loop to start
BREAK
Escape the loop forcibly
END
Quit the program
STOP [DisplayString]
Suspending a running program
About DEF User-Defined Commands
Using DEF, you can define your own commands like the below
DEF DefinitionName
Define a user-defined command with no arguments and no return value
DEF DefinitionName Parameter[,Parameter...]
Define a user-defined command with parameters and no return value
DEF FunctionName([Parameter[,Parameter...]])
Define a user-defined function (user-defined command with only one return value)
DEF CommandName[Parameter[,Parameter...]] OUT ReturnValue [,ReturnValue...]]
Define a user-defined command with multiple return values
DEF CommandName * [OUT *]
Define a user-defined command with variable-length parameters and variable-length return values
About COMMON
A keyword used to define a user-defined command/function beyond the program slot
RETURN Value
Set the return value of DEF and return to the caller
END
Terminate DEF definition of a user-defined command/function
DEFARGC ()
Check the number of parameters of a user-defined command/function
DEFARG (ParameterNumber)
Check the value of parameters of a user-defined command/function
DEFOUTC ()
Check the number of return values of a user-defined command/function
DEFOUT ReturnValueNumber,Value
Specify the return value of a user-defined command/function
CALL CommandName[,Parameter...][ OUT Variable1[,Variable2...]]
Call a user-defined command with a specified name
CALL (FunctionName[,Parameter...])
Call function with specified name
CALL SPRITE
CALL TEXT
Call callback
Mathematics
INT (NumericValue)
Convert to Int type
FLOAT (NumericValue)
Convert to Real type
FLOOR (NumericValue)
Round down decimal places
ROUND (NumericValue)
Round off the fractional part to the nearest Int
CEIL (NumericValue)
Round up after the decimal point
ABS (NumericValue)
Get the absolute value
SGN (NumericValue)
Get the sign
MIN (NumericArray)
Get smallest value in a specified numeric array
MIN (NumericValue,NumericValue[,NumericValue...])
Get the smallest value from multiple specified numbers
MAX (NumericArray)
Get the largest value in a specified numeric array
MAX (NumericValue,NumericValue[,NumericValue...])
Get the largest value from multiple specified numbers
RND ([SeedID,]MaximumValue)
Get Int random number
RNDF ([SeedID])
Get a Real random number
RANDOMIZE SeedID [,SeedValue]
Initialize the random number sequence
SQR (NumericValue)
Calculate the square root
EXP ([NumericValue])
Calculates the power of e(BaseOfNaturalLogarithms)
POW (NumericValue,Multiplier)
Calculate the power
LOG (NumericValue[,Base])
Calculate the logarithm
RAD (NumericValue)
Convert angular units from degrees to radians
DEG (NumericValue)
Convert angular units from radians to degrees
SIN (Angle)
Calculate the sine
COS (Angle)
Calculate the cosine
TAN (Angle)
Calculate the tangent
ASIN (NumericValue)
Calculate the arc sine (inverse function of SIN)
ACOS (NumericValue)
Calculate the arc cosine (inverse function of COS)
ATAN (NumericValue)
Calculate the arc tangent (inverse function of TAN) (from numeric value)
ATAN (CoordinateY,CoordinateX)
Calculate the arc tangent (inverse function of TAN) (from XY coordinates)
SINH (NumericValue)
Calculate the hyperbolic sine
COSH (NumericValue)
Calculate the hyperbolic cosine
TANH (NumericValue)
Calculate the hyperbolic tangent
CLASSIFY (NumericValue)
Judge normal numbers, infinity, and non-numeric values (NaN)
String Operations
About array type references of strings
 
ASC (String)
Get the character code of the first character of the string
CHR$ (CharacterCode)
Return a character from a specified character code
VAL (String)
Convert a string representing a number into a numeric value
STR$ (NumericValue[,NumberOfDigits])
Convert numeric value to string
HEX$ (NumericValue[,NumberOfDigits])
Convert a numeric value to a hexadecimal string
BIN$ (NumericValue[,NumberOfDigits])
Convert a numeric value to a binary string
FORMAT$ (FormatString,Value,...)
Format the value into a string using the display format
LEN (String)
LEN(Array)
Get the number of characters in a string or the number of elements in an array
LAST (String)
LAST(Array)
Return the subscript number at the end of a string or array
MID$ (String,StartPosition [,NumberOfCharacters])
Get substring of the specified number of characters from specified position of the string
LEFT$ (String,NumberOfCharacters)
Get substrings of the specified number of characters from the beginning of the string
RIGHT$ (String,NumberOfCharacters)
Get substring of the specified number of characters from the end of the string
INSTR (String,SearchString)
INSTR(StartPosition,String,SearchString)
Search the specified string in the string and return the position
SUBST$ (String,StartPosition,ReplacementString)
SUBST$(String,StartPosition,NumberOfCharacters,ReplacementString)
Create a new string by replacing part of the string
DATE$ ()
Return current date as a string
TIME$ ()
Return current time as a string
Other
CONST #ConstantName=ConstantExpression[,#ConstantName=ConstantExpression]
Define constants
ENUM #ConstantName[=ConstantExpression][,#ConstantName[=ConstantExpression]]
Define constants with sequential numbers
DATA ConstantExpression[,ConstantExpression...]
Define data to be read by the READ command
READ Variable1[,Variable2...]
Read the value defined by the DATA command
RESTORE @Label
RESTORE String
Change the DATA statement read with the READ command
OPTION FunctionName
Set the program operation mode
WAIT [FrameCount]
Stop program execution until the specified frame count elapses
VSYNC [FrameCount]
Stop program execution until the specified frame count elapses
REM
'
Symbol for comment description
TMREAD OUT H,M,S
TMREAD TimeString OUT H, M, S
Convert time string to number
DTREAD OUT Y,M,D[,W]
DTREAD DateString OUT Y,M,D[,W]
Convert date string to number
CHKLABEL (String[,Flag])
Check if a label with the same name as the specified string exists
CHKCALL (String)
Check if there is an command/function with the same name as the specified string
CHKVAR (String)
Check if a variable with the same name as the specified string exists
DIALOG DisplayString[,SelectionType[,CaptionString[,TimeoutPeriod]]]
Display the dialog and wait until the button is pressed
DIALOG (DisplayString,ButtonType[,CaptionString[,TimeoutPeriod]])
Display dialog and wait until touch or hardware button is pressed
DIALOG (InitialString,CaptionString[,MaximumNumberOfCharacters])
Display a dialog dedicated to file name input
RESULT ()
Get the execution result of some commands
CALLIDX ()
Return the number associated with the callback
CLIPBOARD String
Set clipboard contents
CLIPBOARD ()
Get clipboard contents
KEY KeyNumber,String
Set the function key contents
KEY (FunctionKeyNumber)
Get the contents of a function key
FONTINFO CharacterCode,FontType OUT X,Y
FONTINFO String,FontType OUT X,Y
Get font storage coordinates
FREEMEM ()
FREEMEM OUT TotalFreeSpace,ContinuousFreeSpace
Get free memory space for strings and arrays
MILLISEC ()
Returns the elapsed time since launching SmileBASIC4
MAINCNT ()
Return the elapsed time since launching SmileBASIC
SYSPARAM (InformationNameString)
SYSPARAM InformationNameString OUT SettingValue1,SettingValue2
SYSPARAM InformationNameString,SettingValue
Get and set various information
PERFBEGIN MeasurementNumber [,ColorCode]
Start execution time measurement
PERFEND MeasurementNumber
Finish the execution time measurement and register the result in the performance gauge
PERFEND (MeasurementNumber)
Finish the execution time measurement and register the result in the performance gauge
METALOAD ["ProjectName"]
Load the metadata of the specified project
METAEDIT MetadataItems,SettingData
Set metadata items
METAEDIT MetadataItem OUT SettingData
Get the currently set metadata item
METASAVE
Save metadata
Various Inputs
XCTRLSTYLE MaxNumberOfConnections,OperationStyle[,MotionSensorUseFlag,IRSensorUseFlag[,ConnectionDialogFlag]]
Set the maximum number of controllers connections, operation style, and functions
XCTRLSTYLE 0
Reset the controller operation style to the startup state
XCTRLSTYLE OUT MaxNumberOfConnections,OperationStyle
Obtaining the current maximum controller connections and operation style
CONTROLLER (ControllerID)
Check controller type and connection status
CONTROLLER ControllerID OUT ControllerType,MainColor,SubColor
CONTROLLER ControllerID OUT ControllerType,LeftMainColor,LeftSubColor,RightMainColor,RightSubColor
Check controller connection status and type
BUTTON (ControllerID,ButtonID[,FunctionID])
Get the operation status of a specific button on the controller
BUTTON (ControllerID)
BUTTON(ControllerID,-1[,FunctionID])
Acquire all button status of controller together
BREPEAT ButtonID,RepeatStartTime,RepeatInterval
Set the button repeat speed
BREPEAT ButtonID OUT RepeatStartTime,RepeatInterval
Get button repeat speed
STICK ControllerID[,StickID] OUT X,Y
Check controller Stick status
ACCEL ControllerID[,SensorID] OUT X,Y,Z
Acquire accelerometer information
GYROV ControllerID [,SensorID] OUT X,Y,Z
Get angular velocity of gyroscope
GYROA ControllerID [,SensorID] OUT X,Y,Z
Get the angle of gyroscope
GYROSYNC ControllerID [,SensorID]
Reset the angle of gyroscope
VIBRATE ControllerID [,LeftRightDesignation],VibrationPatternNumber
Vibrate the controller
VIBRATE ControllerID [,LeftRightDesignation],LowBandFrequency,LowBandAmplitude,HighBandFrequency,HighBandAmplitude
Specify the frequency and amplitude to vibrate the controller
VIBRATE (ControllerID[,LeftRightDesignation])
Get controller vibration status
VIBRATE
Stop vibration of all controllers
TOUCH [TouchID[,CoordinateSystemConversionFlag]] OUT TouchTime,X,Y[,TouchArea]
Return touch information on the touch screen
MOUSE [CoordinateSystemConversionFlag] OUT X,Y [,Wheel]
Return mouse coordinate information
MOUSE X,Y[,CoordinateSystemConversionFlag]
Set mouse coordinates
MBUTTON ()
Get all mouse button statuses together
MBUTTON (ButtonID[,FunctionID])
Get the operation status of a specific mouse button
IRSTART ControllerID,IRRecognitionType
Start using the IR Motion Camera
IRSTART ControllerID,0,[LightingType],[Gain],[Exposure],[MinCluster],[MaxCluster],[MinBrightness]
Start using IR Motion Camera (Clustering mode detailed parameter setting type)
IRSTART ControllerID,1,[LightingType],[Gain],[Exposure],[ImageSize]
Start using the IR Motion Camera (shooting mode detailed parameter setting type)
IRSTART ControllerID,2,[LightingType],[Gain],[Exposure]
Start using the IR Motion Camera (moment mode detailed parameter setting type)
IRSTOP ControllerID
Stop using the IR Motion Camera
IRSTATE (ControllerID)
Get IR Motion Camera starting status
IRREAD ControllerID OUT SamplingNumber,NoiseLevel,NumberOfData,DataArray
Read IR Motion Camera recognition results
IRSPRITE ControllerID,SpriteID
Paste motion IR Motion Camera image acquired in the shooting mode to sprite
KEYBOARD (ScanCode[,FunctionID])
KEYBOARD ScanCode [,FunctionID] OUT Result,ModifierKeyInformation
Get USB keyboard input information
Various Inputs (Toy-Con)
XCTRLSTYLE MaxNumberOfConnections,100,Toy-ConTypeLeft1,Toy-ConTypeRight1[,ConnectionDialogFlag ]
XCTRLSTYLE MaxNumberOfConnections,100,Toy-ConTypeLeft1,Toy-ConTypeRight1,Toy-ConTypeLeft2,Toy-ConTypeRight2[,ConnectionDialogFlag ]
Configure Toy-Con connection settings
TCPIANO ControllerID OUT RecognitionFlag[,KeyButtonInformation,DialType,DialRotationAngularVelocity]
Get Toy-Con Piano recognition information
TCROBOT ControllerID OUT RecognitionFlag,LimbInformationArray[,Pitch,Roll,Yaw]
Get recognition information of Toy-Con Robot
TCVISOR ControllerID OUT RecognitionFlag,Pitch,Roll,Yaw
Get visor recognition information of Toy-Con Robot
TCHOUSE ControllerID OUT RecognitionFlag,InformationArray
Get Toy-Con recognition information
TCFISHING ControllerID OUT RecognitionFlag[,FishingRodYaw,FishingRodPitch,ReelSpeed,FishingRodYawAngle,FishingRodPitchAngle]
Get recognition information for Toy-Con Fishing Rod
TCBIKE ControllerID OUT RecognitionFlag[,HandleTilt,AccelAmount,AccelAngle,WheelieAngle]
Get the recognition information of Toy-Con Motorbike
TCCAR ControllerID OUT RecognitionFlag[,Accelerator,WheelInput[,WheelAngle,LeftLever,RightLever,Cord,SideLever,LeftGimmick,RightGimmick]
Get recognition information of Toy-Con Car
TCPLANE ControllerID OUT RecognitionFlag[,Accelerator,StickX,StickY]
Get recognition information of Toy-Con Plane
TCSUBM ControllerID, OUT RecognitionFlag[,Accelerator,LeftWheelAngle,RightWheelAngle]
Get recognition information of Toy-Con Submarine
TCVEHICLE (ControllerID)
Return the currently recognized DriveKit Toy-Con type
Files
FILES ["FileType:"]
FILES "[FileType:] ProjectName"
Display a List of Files on the Console
FILES "//"
Display a List of Projects on the Console
FILES (["FileType:"])
FILES("[FileType:] ProjectName")
Create an Array Containing a List of Files and Projects
FILES ("//")
Create an Array Containing a List of Projects
FILES ["FileType:",]StringArray
FILES "[FileType:]ProjectName,StringArray
Get a List of Files in Array
FILES "//",StringArray
Get a List of Projects in Array
LOAD "[FileType:]FileName"[,Slot]
Load the Program
LOADG "[FileType:]FileName",GraphicPage[,OX,OY]
LOADG "[FileType:]FileName",GraphicPage[,OX,OY] OUT Width,Height
Load Image Files
LOADV ("FileType:FileName")
Read File Contents and Return as String or Array
LOADV "FileType:FileName",Array
Read the Contents of a File into an Array
SAVE "[FileType:]FileName"[,Slot]
Save the Program
SAVEG "[FileType:]FileName",GraphicPage[,StartPointX,StartPointY,Width,Height]
Save Graphic Page Contents to File
SAVEG "JPG:FileName",GraphicPage[,StartPointX,StartPointY,Width,Height] [,CompressionAmount]
Save the Contents of a Graphic Page to a File in High Compression Format
SAVEV "FileType:FileName",Variable
Save Variable Contents to File
PROJECT ()
Get the Current Project
EXEC "[FileType:]FileNameString"[,Slot]
Loading and Executing Programs
EXEC Slot
Run the Program in the Specified Slot
CHKFILE ("[FileType:]FileNameString")
Check if the specified file exists
DELETE "[FileType:]FileName"
Deleting Files
RENAME "[FileType1:]FileName1","[FileType2:]FileName2"
Rename the File
Screen Control
ACLS
ACLS GRPSaveFlag,SPDEFSaveFlag,GRPFSaveFlag[,ANIMDEFSaveFlag]
Clear all display settings and return to the startup state
XSCREEN Width,Height[,SampleMagnification[,CompositeMode[,AspectRatio]]]
Set the display resolution
XSCREEN OUT Width,Height [,SampleMagnification[,CompositeMode[,AspectRatio]]]
Get display resolution
ANIMDEF DefinitionNumber,AnimationTarget,DataArray [,Loop]
Animation definition
ANIMDEF DefinitionNumber,AnimationTarget,@Label[,Loop]
ANIMDEF DefinitionNumber,AnimationTarget,LabelString[,Loop]
Animation definition (specified with DATA command)
ANIMDEF DefinitionNumber,AnimationTarget,Time1,Item1[,Item2][,Time2,Item1[,Item2]]...[,Loop]
Animation definition (specify as direct arguments)
ANIMDEF DefinitionNumber
Clear the animation of the specified definition number
ANIMDEF
Clear all animation definitions
BACKCOLOR BackgroundColor
Set the background color of the BASIC display
BACKCOLOR ()
Get background color of the BASIC display
FADE FadeColor
Apply a fade effect to the display
FADE FadeColor,Time
Apply fade-in and fade-out effects
FADE ()
Get the current fade color
FADECHK ()
Check if it's during fade-in/fade-out
Text Screen Input/Output
CLS
CLS ScreenID
Clear the text screen
COLOR [ScreenID,]ColorCode
Set the drawing color of characters
COLOR ([ScreenID])
Get the drawing color of characters
LOCATE [CoordinateX],[CoordinateY]
LOCATE ScreenID,[CoordinateX],[CoordinateY]
Specify the character display coordinates to the text screen
LOCATE [ScreenID] OUT CoordinateX,CoordinateY
Get character display coordinates
PRINT [Expression[;Or,Expression...]]
Console character display
TPRINT ScreenID[,Expression[;Or,Expression...]]
Character display on text screen
ATTR [ScreenID,]HorizontalFlip,VerticalFlip,Rotation
ATTR [ScreenID,]DisplayAttribute
Set the attributes of characters to be displayed on the text screen
ATTR [ScreenID] OUT HorizontalFlip,VerticalFlip,Rotation
ATTR( [ScreenID])
Get display character attribute of text screen
SCROLL [ScreenID,]NumberOfCharactersX,NumberOfCharactersY
Scroll the contents of the text screen
CHKCHR ([ScreenID,]CoordinatesX,Y)
Check the character code of the character displayed on the text screen
CHKCHR [ScreenID,]CoordinateX,Y OUT CharacterCode,DisplayAttribute
Check the character code and display attributes of characters displayed on the text screen
CHKCHR (ScreenID,CoordinatesX,Y,CoordinateConversionFlag)
Check the character code of the character displayed on the text screen
CHKCHR ScreenID,CoordinatesX,Y,CoordinateConversionFlag OUT CharacterCode,DisplayAttribute
Check the character code and display attributes of characters displayed on the text screen
INPUT ["GuideString";]Variable[,Variable2...]
Enter numbers or strings from the keyboard
LINPUT ["GuideString";]StringVariable
Get string from keyboard
INKEY$ ()
INKEY$(ControllerInputExclusionFlag)
Get one character entered from the keyboard
TSCREEN FontType[,CharacterSize]
Set the width of the console (text screen 4) and the font used for display
TSCREEN ScreenID,FontType,CharacterSize[,Width,Height]
TSCREEN ScreenID,FontType,Width,Height
Set text screen size and font used for display
TSCREEN [ScreenID] OUT FontType,CharacterSize,Width,Height
Get text screen size and font used for display
TPAGE [ScreenID,]GraphicPage,ReferenceOriginX,ReferenceOriginY
Set a reference graphic page for user-defined characters
TPAGE [ScreenID] OUT GraphicPage,ReferenceOriginX,ReferenceOriginY
Get a reference graphic page for user-defined characters
TCOLOR ScreenID,ColorCode
Set the color to multiply the entire text screen
TCOLOR (ScreenID)
Get the color to multiply the entire text screen
TLAYER ScreenID,LayerID
Set the layer to which the text screen belongs
TLAYER (ScreenID)
Get the layer to which the text 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
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
THOME ScreenID,HomeCoordinateX,HomeCoordinateY
Set the home coordinate (coordinate reference point) of the text screen
THOME ScreenID OUT HomeCoordinateX,HomeCoordinateY
Get text screen home coordinates
TOFS ScreenID,X,Y[,Z]
Set text screen display coordinates
TOFS ScreenID OUT X,Y[,Z]
Get text screen display coordinates
TROT ScreenID,Angle
Set text screen rotation angle
TROT (ScreenID)
Get text screen rotation angle
TSCALE ScreenID,MagnificationX,MagnificationY
Enlarge/reduce the text screen
TSCALE ScreenID OUT MagnificationX,MagnificationY
Get the scale of the text screen
TSHOW ScreenID
Display text screen
TSHOW (ScreenID)
Get text screen display status
THIDE ScreenID
Hide text screen
THIDE (ScreenID)
Get text screen display status
TBLEND ScreenID,CompositeMethod
Set the text screen composition method
TBLEND (ScreenID)
Get text screen composition method
TANIM ScreenID,AnimationTarget,DataArray[,Loop]
Set animation on the text screen (specified by array)
TANIM ScreenID,AnimationTarget,"@LabelString"[,Loop]
Set animation on the text screen (specified with DATA command)
TANIM ScreenID,AnimationTarget,Time1,Item1[,Item2][,Time2,Item1[,Item2]]...[,Loop]
Set animation on the text screen (directly specified as an argument)
TANIM ScreenID,AnimationDefinitionNumber
Set the animation on the text screen (specified by the animation definition number)
TANIM [ScreenID]
Clear the animation set in the text screen
TSTOP [ScreenID]
Stop the text screen animation
TSTART [ScreenID]
Start text screen animation
TCHK (ScreenID)
Get text screen animation state
TVAR ScreenID,VariableKey,Value
TVAR ScreenID,VariableKey
Write to text screen variables
TVAR (ScreenID,VariableKey)
Get text screen variable
TVAR ScreenID[,VariableKey]
Delete text screen variables
TCOPY CopyDestinationScreenID[,CopySourceScreenID],StartPointX,StartPointY,EndPointX,EndPointY,TransferDestinationX,TransferDestinationY
Copy the character information in the text screen
TSAVE ReadoutScreenID,[X,Y,Width,Height,]TransferDestinationArray
Copy text screen character information to array
TLOAD WritingScreenID,[X,Y,Width,Height,]TransferSourceArray
Copy character information from array to text screen
TARRAY (ScreenID)
Get an Int array representing the contents of text screen
TUPDATE ScreenID [,StartPointX,StartPointY,EndPointX,EndPointY]
Reflect the contents written by TARRAY in the display
TFUNC ScreenID,"@Label"
TFUNC ScreenID,"UserDefinedCommandName"
Assign a callback process for each text screen
TFUNC ScreenID
Clear callback processing assigned to text screen
TCOORD ScreenID, ConvertSourceCoordinatesX,Y [,Mode] OUT ConvertResultCoordinatesX,Y
Convert display coordinates to text screen coordinates
Graphics
GTARGET DrawingTargetPage
Specifying the graphic drawing target page
GTARGET ()
Get the current graphics drawing target page
GCOLOR ColorCode
Specify graphic drawing color
GCOLOR ()
Get graphics drawing color
RGB (R,G,B)
RGB(A,R,G,B)
Calculate color code from RGB values
RGB (ColorCode,[A],[R],[G],[B])
Replace each component of the color code
RGB ColorCode OUT R,G,B
RGB ColorCode OUT A,R,G,B
Get RGB components from color code
RGBF (R,G,B)
RGBF(A,R,G,B)
Calculate color code from floating point RGB values
RGBF (ColorCode,[A],[R],[G],[B])
Replace each component of the color code
RGBF ColorCode OUT R,G,B
RGBF ColorCode OUT A,R,G,B
Get RGB components from color code (floating point version)
HSV (Hue,Saturation,Value[,Transparency])
Calculate color code from HSV value
HSV ColorCode OUT Hue,Saturation,Value[,Transparency]
Convert color code to HSV value
HSVF (Hue,Saturation,Value[,Transparency])
Calculate color code from HSV value (floating point version)
HSVF ColorCode OUT Hue,Saturation,Value[,Transparency]
Convert color code to HSV value (floating point version)
GCLIP [StartPointX,StartPointY,EndPointX,EndPointY]
Specify the writing clipping area of the graphic page
GCLIP OUT StartPointX,StartPointY,EndPointX,EndPointY
Get the writing clipping area of graphic page
GCLS [ColorCode]
Fill the graphic page with the specified color
GPGET (CoordinateX,CoordinateY)
Get the color of the specified coordinates on the graphic page
GPSET CoordinateX,CoordinateY[,ColorCode[,DrawingMethod]]
Dots on the graphic page
GLINE StartPointX,StartPointY,EndPointX,EndPointY[,ColorCode[,DrawingMethod]]
Draw a straight line on the graphic page
GCIRCLE CenterPointX,CenterPointY,Radius[,ColorCode [,DrawingMethod]]
Draw a circle on the graphic page
GCIRCLE CenterPointX,CenterPointY,Radius,StartAngle,EndAngle,Flag[,ColorCode [,DrawingMethod]]
Draw an arc on the graphic page
GBOX StartPointX,StartPointY,EndPointX,EndPointY[,ColorCode[,DrawingMethod]]
Draw a rectangle on the graphic page
GFILL StartPointX,StartPointY,EndPointX,EndPointY[,ColorCode[,DrawingMethod]]
Draw a rectangle on the graphic page and fill it
GPAINT StartPointX,StartPointY[,FillColor]
GPAINT StartPointX,StartPointY[,FillColor,BorderColor]
Fill the graphic page
GCOPY [SourcePage,]StartPointX,StartPointY,EndPointX,EndPointY,TransferDestinationX,TransferDestinationY,DrawingMethod
Copy images from other graphic pages
GCOPY SourcePage,StartPointX,StartPointY,EndPointX,EndPointY,TransferDestinationX,TransferDestinationY,ColorCode,DrawingMethod
Copy images from other graphic pages
GSAVE [SourcePage,][X,Y,Width,Height,]DestinationArray
Copy image to array
GLOAD [X,Y,Width,Height,]ImageArray,DrawingMethod
GLOAD [X,Y,Width,Height,]ImageArray,ColorCode,DrawingMethod
Copy image data from array to graphic page
GLOAD [X,Y,Width,Height,]IndexImageArray,PaletteArray,DrawingMethod
GLOAD [X,Y,Width,Height,]IndexImageArray,PaletteArray,ColorCode,DrawingMethod
Copy image data to graphic page while converting color from index image array
GTRI X1,Y1,X2,Y2,X3,Y3[,ColorCode[,DrawingMethod]]
Draw a triangle on the graphic page and fill it
GPUTCHR X,Y,"String"[,FontType[,ColorCode[,DrawingMethod]]]
GPUTCHR X,Y,"String",FontType,ScaleX,ScaleY,ColorCode[,DrawingMethod]
Draw characters on the graphic page
GPUTCHRP X,Y,"String"[,FontType[,ColorCode[,DrawingMethod]]]
GPUTCHRP X,Y,"String",FontType,ScaleX,ScaleY,ColorCode[,DrawingMethod[,CharacterSpacing]]
Draw proportional characters on graphic pages
GPUTCHRP ("String"[,FontType[,ScaleX[,CharacterSpacing]]])
Calculate the drawing width when drawing a string with GPUTCHRP
GARRAY (GraphicPage)
Get an Int array representing the contents of a graphic page
GUPDATE GraphicPage[,StartPointX,StartPointY,EndPointX,EndPointY]
Reflect the contents written by GARRAY in the display
GSAMPLE GraphicPage,SamplingType
Set the sampling method for graphic pages
GSAMPLE (GraphicPage)
Get sampling method of graphic page
Sprites
SPSET SpriteNumber,DefinitionNumber[,DisplayFlag]
Create sprites (using definition templates)
SPSET SpriteNumber,U,V,W,H[,Attribute[,DisplayFlag]]
Create sprite (specify image attribute etc. directly)
SPSET (DefinitionNumber[,DisplayFlag])
Search for an available number, create a sprite, and return the number
SPSET (U,V,W,H,Attribute[,DisplayFlag])
Search for an available number, create a sprite, and return the number
SPSET (StartNumber,EndNumber,DefinitionNumber[,DisplayFlag])
Search for an available number, create a sprite, and return the number
SPSET (StartNumber,EndNumber,U,V,W,H,Attribute[,DisplayFlag])
Search for an available number, create a sprite, and return the number
SPCLR
Delete all sprites
SPCLR SpriteNumber
Delete the specified sprite
SPCLR SpriteNumber1,SpriteNumber2
Delete sprite in specified range
SPSHOW SpriteNumber
SPSHOW SpriteNumber,DisplayFlag
Display sprite
SPSHOW (SpriteNumber)
Get whether sprite is displayed
SPHIDE SpriteNumber
SPHIDE SpriteNumber,DisplayOffFlag
Hide sprite display
SPHIDE (SpriteNumber)
Get whether sprite is off
SPHOME SpriteNumber,CoordinateX,CoordinateY
Specify the sprite's home coordinate (coordinate reference point)
SPHOME SpriteNumber OUT HX,HY
Get home position of sprite
SPOFS SpriteNumber,[X],[Y][,Z]
Move the sprite
SPOFS SpriteNumber[,CoordinateSystemFlag] OUT X,Y[,Z]
Get display coordinates of sprite
SPROT SpriteNumber,Angle
Rotate the sprite
SPROT (SpriteNumber)
Get sprite rotation angle
SPSCALE SpriteNumber,MagnificationX,MagnificationY
Change the sprite scale (display magnification)
SPSCALE SpriteNumber OUT SX,SY
Get sprite display magnification
SPCOLOR SpriteNumber,ColorCode
Set the sprite display color
SPCOLOR (SpriteNumber)
Get the sprite display color
SPCHR SpriteNumber,DefinitionNumber
Change sprite character definition
SPCHR SpriteNumber,[U],[V],[W],[H],[Attribute]
Change sprite character definition
SPCHR SpriteNumber OUT U,V[,W,H[,ATR]]
Get sprite character definition attributes
SPCHR (SpriteNumber)
Get a sprite character definition number
SPPAGE SpriteNumber,GraphicPage
Set the reference graphic page of the specified sprite
SPPAGE (SpriteNumber)
Get the reference graphic page of the specified sprite
SPPAGE GraphicPage
Set the graphic page assigned to the sprite to be created
SPPAGE ()
Get the graphic page assigned to the sprite to be created
SPLAYER SpriteNumber,LayerID
Set the layer to which the specified sprite belongs
SPLAYER (SpriteNumber)
Get the layer to which the specified sprite belongs
SPLAYER LayerID
Set the layer to which the sprite to be created belongs
SPLAYER ()
Get the layer to which the sprite to be created belongs
SPDEF DefinitionNumber,U,V[,W,H[,OriginX,OriginY]][,Attribute]
Create a character definition template for sprites
SPDEF NumericArray[,DefinitionNumberOffset[,UOffset,VOffset]]
Create sprite character definition templates in batch from an array
SPDEF "@LabelString"[,DefinitionNumberOffset[,UOffset,VOffset]]
Create sprite character definition templates in batch from DATA column
SPDEF DefinitionNumber OUT U,V[,W,H[,HX,HY]][,A]
Get attribute on character definition template of sprite
SPDEF DefinitionNumber,SourceDefinitionNumber,[U],[V],[W],[H],[OriginX],[OriginY],[Attribute]
Copy the sprite character definition template
SPDEF
Return the sprite character definition template to the initial state
Link a sprite to another sprite
SPLINK (SpriteNumber[,LinkType])
Get the link number of the specified number sprite
Unlink sprites
SPANIM SpriteNumber,AnimationTarget,DataArray [,Loop]
Set animation for sprites
SPANIM SpriteNumber,AnimationTarget,"@LabelString"[,Loop]
Set animation to sprite (specified with DATA command)
SPANIM SpriteNumber,AnimationTarget,Time1,Item1[,Item2][,Time2,Item1[,Item2]]...[,Loop]
Set animation for sprites (specify as direct argument)
SPANIM SpriteNumber,AnimationDefinitionNumber
Set animation to sprite (specified by animation definition number)
SPANIM [SpriteNumber]
Clear sprite animation
SPSTOP [SpriteNumber]
Stop sprite animation
SPSTART [SpriteNumber]
Resume sprite animation
SPCHK (SpriteNumber)
Get animation state of sprite
SPVAR SpriteNumber,VariableKey,Value
Set sprite variables
SPVAR (SpriteNumber,VariableKey)
Read sprite variables
SPVAR SpriteNumber[,VariableKey]
Delete sprite variables
SPCOL SpriteNumber[,ScaleSupport]
Set sprite collision detection attribute
SPCOL SpriteNumber,[ScaleSupport],Mask
Set sprite collision detection attribute (with mask specification)
SPCOL SpriteNumber,StartPointX,StartPointY,Width,Height[,ScaleSupport]
SPCOL SpriteNumber,StartPointX,StartPointY,Width,Height,[ScaleSupport],Mask
Set sprite collision detection attribute (with range specification)
SPCOL SpriteNumber OUT ScaleSupport[,Mask]
Get sprite collision detection attribute (scale support and mask)
SPCOL SpriteNumber OUT StartPointX,StartPointY,Width,Height[,ScaleSupport[,Mask]]
Get sprite collision detection attributes (all)
SPCOLVEC SpriteNumber[,MovementAmountX,MovementAmountY]
Set the movement speed for sprite collision detection
SPHITSP (SpriteNumber[,StartID,EndID])
Return sprite collision detection result
SPHITSP (SpriteNumber,OpponentSpriteNumber)
Return sprite collision detection result with specified sprite
SPHITSP ()
Return the sprite collision detection result from the previously set information
SPHITRC (StartPointX,StartPointY,Width,Height[,[Mask],MovementAmountX,MovementAmountY])
Return collision detection result of moving rectangle and all sprites
SPHITRC (SpriteNumber,StartPointX,StartPointY,Width,Height[,[Mask],MovementAmountX,MovementAmountY])
Return collision detection result of specified sprite and rectangle
SPHITRC (StartID,EndID,StartPointX,StartPointY,Width,Height[,[Mask],MovementAmountX,MovementAmountY])
Return the result of collision detection between a sprite in the specified range and a rectangle
SPHITRC ()
Return the sprite collision detection result from the previously set information
SPHITINFO ()
Get the detailed information on collision detection results (collision time)
SPHITINFO OUT TM,X1,Y1,X2,Y2
Get the detailed information of collision detection results (collision time and coordinates)
SPHITINFO OUT TM,X1,Y1,VX1,VY1,X2,Y2,VX2,VY2
Get the detailed information of collision detection results (collision time, coordinates and velocity)
SPFUNC SpriteNumber, "@Label"
SPFUNC SpriteNumber,"UserDefinedCommandName"
Assign callback processing for each sprite
SPFUNC SpriteNumber
Clear callback processing assigned to sprite
SPUSED (SpriteNumber)
Check if specified sprite is used
Sound
BEEP [SoundEffectNumber[,[Pitch][,[Volume][,[Panpot]]]]]
Play simple warning and sound effects
BEEP ([SoundEffectNumber[,[Pitch][,[Volume][,[Panpot]]]]])
Play simple warning and sound effects
BEEPPAN Handle,Panpot
Change the sound effect panpot
BEEPPIT Handle,Pitch
Change the pitch of sound effects
BEEPSTOP [Handle[,FadeTime]]
Stop sound effects
BEEPVOL Handle,Volume
Change sound effect volume
BGMCLEAR [UserDefinedMusicNumber]
Delete user-defined music
BGMCONT [TrackNumber[,FadeTime]]
Resume music playback when paused
BGMPITCH [TrackNumber,]Pitch
Change the reference pitch of the music being played
BGMPLAY [TrackNumber,]MusicNumber[,Volume][,FadeTime]
Start playing the specified music
BGMPLAY MMLString
Start playing the specified MML data
BGMPAUSE [TrackNumber[,FadeTime]]
Pause music playback
BGMSET UserDefinedMusicNumber,MMLString
Define user-defined music
BGMSETD UserDefinedMusicNumber,@LabelString
Predefine user-defined music
BGMSTOP [TrackNumber[,FadeTime]]
Stop playing music
BGMVAR TrackNumber,VariableNumber,Value
BGMVAR TrackNumber,VariableNumber OUT Variable
Set and get BGM track variable values
BGMVOL [TrackNumber,]Volume
Set the volume of the specified track
BGMWET [TrackNumber,]Wet
Set the effector level for the specified track
EFCEN State
EFCEN OUT Variable
Set/get effector status
EFCSET PresetNumber
Set effectors (preset designation)
EFCSET ReflectionSoundMode,ReflectionSoundVolume,ReflectionSoundTime,EchoMode,EchoVolume,EchoTime,HighSoundAttenuationRate,EchoTone,InputVolume
Set effectors (detailed settings)
EFCWET BEEPWet,BGMWet,TALKWet,PCMWet
Set effector wetness
PCMCONT
Resume PCM playback
PCMPOS PlaybackPosition
Set the PCM playback position
PCMPOS OUT Variable
Get PCM playback position
PCMSTOP
Stop PCM playback
PCMSTREAM PCMDataArray[,SamplingFrequency]
Start PCM playback
PCMSTREAM PCMDataArrayL,PCMDataArrayR[,SamplingFrequency]
Start PCM playback
PCMVOL Channel,Volume[,NumberOfSamples]
Set the PCM volume
PCMVOL [Channel,]Volume
Set the PCM volume
PCMVOL OUT LeftVolume[,RightVolume]
Get PCM volume
RECCHK OUT State
Get recording status by RECSTART
RECDATA SamplePosition OUT Left,Right
Extract sample values recorded with RECSTART
RECLEN ()
Returns the number of buffer samples allocated by RECSTART
RECPOS ()
Returns the current sample position recorded with RECSTART
RECSAVE Array[,SampleNumber][,SamplePosition]
Extract sample values recorded with RECSTART into an array
RECSTART Time
Record sound played on BEEP/BGMPLAY/TALK
RECSTART
Record sound played on BEEP/BGMPLAY/TALK
RECSTOP
Stop recording with RECSTART
SNDMSBAL Balance[,FadeTime]
Set the volume balance of the main/sub interpreter
SNDMSBAL OUT Balance
Obtaine the volume balance of the main/sub interpreter
SNDMVOL Volume[,FadeTime]
Set the overall sound volume
SNDMVOL OUT Volume
Get the volume of the entire sound
SNDSTOP
Stop all sounds
TALK String
Start speech synthesis according to the given string
TALKSTOP
Stop speech synthesis
WAVSET InstrumentNumber,Attack,Decay,Sustain,Release,DefinitionString[,ReferencePitch]
Set the instrument sound waveform
WAVSETA InstrumentNumber,Attack,Decay,Sustain,Release,Array[,ReferencePitch][,WaveStart][,WaveEnd]
Set the instrument sound waveform
WAVSETA InstrumentNumber,Attack,Decay,Sustain,Release,Array,ReferencePitch,LoopStart,LoopEnd,SampleFrequency[,Offset][,BEEPLoopFlag]
Set the instrument sound waveform
BGMCHK [TrackNumber] OUT Variable
Return the music playback status of the specified track
CHKMML MMLString OUT Variable
Return whether the contents of the MML string can be correctly interpreted as MML
TALKCHK OUT Variable
Check the speech synthesis status
Source Code Operation
PRGEDIT ProgramSlot[,LineNumber]
Start source code operation on the editor
PRGEDIT ()
PRGEDIT OUT [ProgramSlot,]LineNumber
Get source code information in operation
PRGGET$ ([AutoSeekFlag])
Get one line of string for the current line
PRGSEEK [MovementDirection]
PRGSEEK([MovementDirection])
Move the current line back and forth one line
PRGSET String
Replace the contents of the current line with the specified string
PRGINS String [,Flag]
Insert a one line string into the current line
PRGDEL [NumberOfDeletedLines]
Delete the current line
PRGSIZE ([ProgramSlot[,ValueTypeToGet]])
Get the number of lines of source code
PRGNAME$ ([ProgramSlot])
Get program file name
Advanced Calculations
BIQUAD OutputArray(OUT),InputArray(IN),FilterCoefficientArray(FP)
Apply biquadratic filter
BQPARAM FilterCoefficientArray,FilterType,SamplingFrequency,CutoffFrequency,QValueOrBandwidth[, AmplificationFactor]
Calculate filter coefficients of biquadratic filter
FFT OutputRealPartArray,OutputImaginaryPartArray,InputRealPartArray,InputImaginaryPartArray[,WindowFunctionValueArray]
Perform Fourier transform on complex array
IFFT OutputRealPartArray,OutputImaginaryPartArray,InputRealPartArray,InputImaginaryPartArray
Perform inverse Fourier transform on complex array
FFTWFN Array,WindowFunctionType
Obtain window function value array
ARYOP OperationType,ResultStorageArray,Parameter1,Parameter2[,Parameter3]
Perform a batch operation on elements in an array
Subprogram
XSUBSCREEN DisplayOffsetX,DisplayOffsetY,Width,Height
Specify the display size of the subprogram display
XSUBSCREEN 0
Stop displaying the subprogram screen
XSUBSCREEN OUT DisplayOffsetX,DisplayOffsetY,Width,Height
Get the display offset of the subprogram display
ENVSTAT Status
Set the status of the main interpreter
ENVSTAT ()
Get the status of the main interpreter
ENVSTAT OUT Status,ExecutionSlot,EditSlot
Get the status of the main interpreter
ENVSTAT OUT Status,ErrorNumber,ErrorArgumentNumber,ErrorSlot,ErrorCharacterPosition,ErrorLine
Get the status of the main interpreter
ENVLOAD 0,MainID,SubID
Copy the contents of the program slot on the main interpreter to the program slot on the sub interpreter side
ENVLOAD 1,MainID,SubID
Copy graphic page data on the main interpreter to the sub interpreter
ENVLOAD 2,MainID,SubID
Copy the SPDEF definition on the main interpreter to the sub interpreter side
ENVSAVE 1,SubID,MainID
Copy graphic page data on the sub interpreter to the main interpreter
ENVSAVE 2,SubID,MainID
Copy the SPDEF definition on the sub interpreter to the main interpreter
ENVINPUT$ ([HistoryNumber])
Get the contents of console input line or input history of main interpreter
ENVTYPE ()
ENVTYPE OUT Type,Parameter
Get the interpreter on which the currently running program is operating
ENVFOCUS Flag
Get and transfer focus
ENVFOCUS ()
Get focus status
ENVPROJECT
Synchronize the sub interpreter work project with the main interpreter work project
PUSHKEY String
It is assumed that the specified string has been entered from the keyboard.
HELPINFO OUT CommandNameString,NumericArray
Information of help data at the cursor position
HELPINFO CommandNameString OUT NumericArray
Help data information for command names
HELPGET CommandNameString,PageNumber OUT LineStringArray,TagArray,AttributeNumericArray,CodeExampleString
Get help data
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
|