The input box is an object that can input one line's worth of a character. "Input" instruction is used. The character input to confirm the variable of the first parameter is substituted.
pos 150,100 // position
// set buffer size (256 byte)
sdim data,256
// default string on input box
data="inputbox of HSP"
// put inputbox
input data,200,20
button "Check",*kakunin
stop
*kakunin
mes ""+data+""
stop
The input box can be input by default for the character string only by 64 bytes. Please set the size of the buffer beforehand by the "sdim" instruction.
The "objprm" instruction is used to change the display character string from the script after the input box is arranged.
pos 150,100
sdim data,256
data="inputbox of HSP"
input data,200,20
button "Change",*henko
stop
*henko
objprm 0,"changed by objprm"
stop
After characters are united mutually, it is reflected by "objprm" instruction to add the character string behind a present character string.
pos 150,100
sdim data,256
data="inputbox of HSP"
input data,200,20
button "More",*tuiki
stop
*tuiki
data+=" more"
objprm 0,data
stop
The message box is an object that can input the character of two or more lines. "mesbox" instruction is used. The fourth parameter displays, exists, and specifies none of a state that can be edited, a state that cannot be edited, and a horizontal scroll bar by the style. It is reflected in the message box by "objprm" instruction reading the text file. Used note~ instruction.
sdim data,4048
mesbox data,500,400,5
button "Load",*load
stop
*load
// file select dialog
dialog "txt",16,"Text"
if stat=0:stop
// memory notepad
notesel data
noteload refstr
// reflect in message box
objprm 0,data
< Prev | Next >
Welcome to HSP sun. Here is a site to introduces HSP, a free script language system.