[↑]
SmileBASIC4 Replica Reference
DIALOG
1. Display the dialog and wait until the button is pressed

DIALOG DisplayString[,SelectionType[,CaptionString[,TimeoutPeriod]]]

・Pressed button information can be obtained with the RESULT function.
・1: OK, -1: Cancel, 0: Timeout

Argument

DisplayString

String to be displeday in the dialog

・Up to 256 characters can be displayed.
・If there is CHR$(10) or CHR$(13) in the display string, a line break will occur.

SelectionType

0 OK (Default)
1 No / Yes
2 Back / Next
3 Cancel / OK
4 Cancel / Execute
5 Next

・If not specified, it's 0.

CaptionString

String to be displayed in the caption field at the top of the dialog

・If the caption string is longer than 46 characters, only 46 characters are displayed.
・If not specified, "DIALOG" is displayed in the caption column.

TimeoutPeriod

Number of seconds before closing the dialog automatically

・If a negative value is specified, it is specified in frame count units.
・If 0 is specified, it waits until the user operates.
・If not specified, it's 0.

Example

DIALOG "Let's get started",5,"Scenario",-120
2. Display dialog and wait until touch or hardware button is pressed

DIALOG(DisplayString,ButtonType[,CaptionString[,TimeoutPeriod]])

Argument

DisplayString

String to be displayed in the dialog

・Up to 256 characters can be displayed.
・If there is CHR$(10) or CHR$(13) in the display string, a line break will occur.

ButtonType

bit0 X Button
bit1 B Button
bit2 Y Button
bit3 A Button
bit4 Up Button
bit5 Down Button
bit6 Left Button
bit7 Right Button
bit8 L Button
bit9 R Button
bit10 ZL Button
bit11 ZR Button
bit12 Press the L Stick
bit13 Press the R Stick
bit14 Any from A/B/X/Y Button
bit15 Any from Up/Down/Left/Right Button
bit16 Any button other than press the Stick
bit17 Touch Screen

・Specify the OR of the above bit values.
・Specifying zero causes an error.

CaptionString

String to be displayed in the caption field at the top of the dialog

・If the caption string is longer than 46 characters, only 46 characters are displayed.
・If not specified, "DIALOG" is displayed in the caption column.

TimeoutPeriod

Number of seconds before closing the dialog automatically

・If a negative value is specified, it is specified in frame count units.
・If 0 is specified, it waits until the user operates.
・If not specified, it's 0.

Return Value

Depending on the button pressed, it returns the value which becomes 1 corresponding to a bit value of the button type argument.

・Except for touch, the same value as BUTTON() is returned.
・0 is returned in case of timeout.

Example

R=DIALOG("ABXYLR/DirectionalKey/Touch",(1 << #B_ANY) OR (1 << 17),"Special",0)
3. Display a dialog dedicated to file name input

DIALOG(InitialString,CaptionString[,MaximumNumberOfCharacters])

Argument

InitialString

File name string set in advance as an input value

・An error occurs if characters that cannot be used in the file name are used.

CaptionString

The string to display in the caption

・If the caption string is longer than 39 characters, only 39 characters are displayed.

MaximumNumberOfCharacters

Up to 32 characters

Return Value

Obtained string

・If the return value of the RESULT function is -1, it'll be canceled (string invalid).

Example

T$=DIALOG("NEWNAME0","SAVE",14)
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
|