BTRON MicroScript Reference Manual

Definitions and Declarations


_____
VERSION
Syntax
Function
_____This specifies the script version. For the present, please specify 2 as the version number.
_____Without fail, please make this description and put it in place at the beginning of the script.
_____In a case where the VERSION statement is not described, the script will run as an old version microscript. The VERSION statement has been prepared for the purpose of maintaining compatibility with old version scripts.
38

I Reference Section

DEBUG
Syntax
Function
_____This specifies the debug level at the time of script execution. It doesn't matter at which position it is in the script, but we recommend describing it and putting it in place at the beginning. The debug level is specified with a numerical value (expressions cannot be described).
_____When the debug level is 0, even if a program error occurs at execution time, execution will continue as is. This is the same as a state in which we do not use the DEBUG statement.
_____When the debug level is 1 or greater, if a program error occurs at the time of of execution, a panel will appear, and it will come about that you can select whether to suspend the script or continue it.
_____Program errors that become subject to this are ones of the types below. In particular, because an error check cannot be made prior to execution for general-purpose-type and symbol-type variables, there is a possibility that errors will occur at execution time.
_____
Illegal references and settings to variables
References and settings to illegal items
Array number specified in an array is illegal
Operation outside a numerical value
_____
Normally, when we are creating a program, we make it DEBUG 1, and once operation is confirmed, we make it DEBUG 0, and then use it.
Errors that Occur at Startup Time
The number is illegal
Negative values and variables cannot be specified in the debug level..

39

_____
DEFINE
Syntax
Function
_____The DEFINE statement declares that we will replace a "macro name" in a specified character string inside a script real object. We can also include a ' , ' or a space in the character string. When we define beforehand with DEFINE character strings, segments, and the like that we will use here and there, corrections and maintenance become easy.
_____Because even statements themselves can be replaced with DEFINE, when we write
    DEFINE LOG COMMENT
the LOG statements are all replaced with COMMENT statements.
_____If the DEFINE statement is prior to where we will use a macro name, then we can described it anywhere.
Errors that Occur at Startup Time
DEF name is already defined
You are trying to define once again a macro name that has already been defined. In a case where you are using multiple script real objects, please confirm whether you haven't tried to define a macro name defined in one script real object also in another script real object.
DEF name size has exceeded the limit
DEFINE statement definitions are too great in number. Please make them fewer.
DEF name nest expansion depth has exceeded the limit
We call referencing another macro name inside a DEFINE statement a nest; this has exceed 16 stages. Please make it so that it becomes a smaller nest.
40

I Reference Section

COMMENT
Syntax
Function
_____This is ignored as a comment. It is the same as #, but by combining it together with the LOG statement and the DEFINE statement, we can use it for an application of the type in which we make debug messages invalid.
_____
During testing ------- LOG statement is executed and a message appears.
DEFINE TestMsg LOG
TestMsg "Test Message"
Script completion ---- because it's COMMENT, nothing is done.
DEFINE TestMsg COMMENT
TestMsg "Test Message"
_____

41

_____
VARIABLE
Syntax
Function
_____This defines global variables. It doesn't matter where the VARIABLE statement is in a script, but it is necessary to define it prior to using the variable.
_____0 is set as the initial value.
_____Type specifications can be made in a variable. For types, there are byte type, character type, integer type, floating point type, symbol type, and general-purpose type. When you don't specify anything, the variable becomes general-purpose type. We recommend explicitly defining types outside of the general-purpose type in order to lessen program mistakes. For details, please refer to the explanation on type specification.
_____Array variables also can be defined. For the number of elements, we can specify the values 1`1048576.
_____
_____It is possible to share all or a portion of the data in other array variables, and we can use them with other variable names and other types. We call this array sharing.
_____In defining array sharing, we make a specification of the array variables to be shared after the normal array definition. In a case where we do not specify the elements of the array variable to be shared and specify only the array name to be entered, this will be the same as a case in which we have specified 0 in the array element number, and there will be sharing from the beginning of the array. We cannot share an array smaller than the data size of the array variable we define.
_____In a case of sharing arrays of different types, it is necessary for the element number of the array to be shared to indicate the correct data boundaries. For example, in a case where we will share that with an integer-type array in a state where a byte-type array has been specified, it is possible to specify only multiples of 4 in the shared start element number of the byte array.
_____
_____With the sharing of different arrays, if you do not use them with sufficient consideration to their internal data structures, then there will be instances of unforeseen results.
Errors that Occur at Startup Time
The item is already defined
The variable name has already been defined by another.
Please specify the array
Please specify the array in the shared variable definition.
The location of the beginning of the shared array does not match the boundaries of the array elements
In the case of a different type of sharing, it is necessary to make the data boundaries match.
The size of the array is illegal or it has exceeded the limits
The number of array elements is illegal or has exceeded the limits.
The size of the array to be shared is illegal.
Please specify the size of the array with integers
Please use integers in the specification of the size of the array.
42, 43

_____
LOCAL
Syntax
Function
_____This defines a local variable. In doesn't matter where it is located inside a procedure, but it is necessary to define it prior to using it. 0 will be set as the initial value.
_____Using the same name as a global variable in a local variable is possible, but, in that case, it will come about that we can't use a global variable of that name inside the procedure.
_____Differing with the VARIABLE statement, array sharing is not possible. Also, there cannot be sharing among threads.
_____Array element numbers are values from 1 to 4096.
_____Concerning the methods for type specification and array specification, they are the same as the VARIABLE statement. Please refer to the VARIABLE statement (p. 42) and TYPE SPECIFICATION (p. 45).
Errors that Occur at Startup Time
The item is already defined
The variable name has already been defined by another.
The size of the array is illegal or it has exceeded the limits
The number of array elements is illegal or has exceeded the limits.
Please specify the size of the array with integers
Please use integers in the specification of the size of the array.
44

I Reference Section

TYPE SPECIFICATION
Function
_____Numerical values, symbols, and the like can be stored in variables, but we specify which among these we will store by means of a "type specification." We use type specifications in variable declarations based on the VARIABLE statement and the LOCAL statement, and in argument declarations based on the FUNC statement, the ACTION statement, and the MACTION statement.
_____As for the type specifications, there are the types below. For details, please refer to the respective item.
_____
_____Types that can store numerical values (characters)
    : B (byte type)
    : C (character type)
    : I (integer type)
    : F (floating point type)
_____Type that can store symbols (segments, character strings, array variable names)
    : S (symbol type)
_____Type that can store numerical values, symbols, segments, or whatever
    : G (general-purpose type)
_____
_____Also, concerning array variables, please refer to the item [:] (p. 52).

45

_____
: B
Syntax
Function
_____: B indicates that a variable or argument is byte type. We use this in variable declarations based on the VARIABLE statement and the LOCAL statement, and in argument declarations based on the FUNC statement, the ACTION statement, and the MACTION statement.
_____Byte type can store integers within the range of 0`255. Serial port input/output (RSGET statement, RSGETC statement, RSGETN statement, RSPUT statement, RSPUTC statement, RSPUTN statement) and file operations (FREAD, FWRITE), etc., are carried out utilizing byte-type arrays (refer to [:] [p. 52).
_____Concerning other types, please refer to "TYPE SPECIFICATION" (p. 45).
46

I Reference Section

: C
Syntax
Function
_____: C indicates that a variable or argument is character type. We use this in variable declarations based on the VARIABLE statement and the LOCAL statement, and in argument declarations based on the FUNC statement, the ACTION statement, and the MACTION statement.
_____Character type can store integers within the range of 0`65535. Because character codes can be expressed with integers within this range, it becomes possible to store one arbitrary character in a character-type variable.
_____Concerning other types, please refer to "TYPE SPECIFICATION" (p. 45).

47

_____
: F
Syntax
Function
_____: F indicates that a variable or argument is floating point type. We use this in variable declarations based on the VARIABLE statement and the LOCAL statement, and in argument declarations based on the FUNC statement, the ACTION statement, and the MACTION statement.
_____Floating point type can store real numbers within the range of -1e300`1e300 (1e300 is the 300th power of 10). Significant digits are about 14 places. This is a floating point expression, but 5.2e3 becomes 5200 in 5.2 x 1000. Also, 4.1e-2 becomes 0.041in 4.1 x 0.01.
_____Concerning other types, please refer to "TYPE SPECIFICATION" (p. 45).
48

I Reference Section

: G
Syntax
Function
_____: G indicates that a variable or argument is general-purpose type. We use this in variable declarations based on the VARIABLE statement and the LOCAL statement, and in argument declarations based on the FUNC statement, the ACTION statement, and the MACTION statement.
_____General-purpose type can store can store any contents of integer type (: I), floating point type (: P), and symbol type (: S). Furthermore in a case where you haven't specified the type at all, the type becomes general-purpose type.
_____With general-purpose type, there is the advantage of being able to create scripts without worrying about types, but because script errors can quickly be discovered if the types have been specified, we recommend creating scripts by specifying types as much as possible.
_____Concerning other types, please refer to "TYPE SPECIFICATION" (p. 45).

49

_____
: I
Syntax
Function
_____: I indicates that a variable or argument is integer type. We use this in variable declarations based on the VARIABLE statement and the LOCAL statement, and in argument declarations based on the FUNC statement, the ACTION statement, and the MACTION statement.
_____Integer type can store integers in the range of -2147483648`2147483647 (in hexadecimal, 0x80000000`0x7fffffff), but -2147483648 (0x80000000) comes to mean an illegal value. Integers that exceed this range can be handled in variables of the floating point type (refer to : F [p. 48]), but it is necessary to specify the array elements (refer to [] [p. 52]) in the integer type.
_____What we call an illegal value refers to a value that returns in a case where an error occurred in a function, an array referencing, or an operation; concerning the details, please refer to the "Errors that Return an Illegal Value" item of the individual functions, etc. In investigating whether or not something is an illegal value, we use the valid function.
_____Concerning other types, please refer to "TYPE SPECIFICATION" (p. 45).
50

I Reference Section

: S
Syntax
Function
_____: S indicates that a variable or argument is symbol type. We use this in variable declarations based on the VARIABLE statement and the LOCAL statement, and in argument declarations based on the FUNC statement, the ACTION statement, and the MACTION statement.
_____In the symbol type, we can store segment names (including virtual object segment names), procedure names, and array variable names. For example, in a case where we have created a function of the type that makes a segment flicker (refer to FUNC [p. 61]), something such as not directly describing the segment inside a function, but rather specifying the segment using a symbol-type argument from outside the function, becomes possible.
_____Also, by using symbol-type array variables and storing other array variable names inside them, we can also handle multi-dimensional arrays. For example, when we make
_____
LOCAL A0:I[10]
LOCAL A1:I[10]
LOCAL B:S[2]
_____
B[:]=A0, A1
_____
and put it in place, a description such as B[0][5]=2 becomes possible.
_____Concerning other types, please refer to "TYPE SPECIFICATION" (p. 45).

51

_____
[] [:]
Syntax
Function
_____[] and [:] are used in the declaration and referencing of array variables. Array variable refers to a contrivance in which we can reference multiple elements (actual contents) with a single variable name (concerning a single variable, please refer to "TYPE SPECIFICATION"). In referencing the elements, we come to specify the array name and the numbers of the elements (which we call the index). Furthermore, there is also a function called an array section through which we can use a portion of an array variable as a separate array variable.
_____The declaration of array variables is carried out with the VARIABLE statement and the LOCAL statement. The form in this case becomes array variable name [number of elements]. The number of elements is an integer value 1`1048576, and expressions and variables cannot be used.
_____In referencing an array variable, we use the form array variable name [index expression]. In the index expression, we specify an expression with a range of 0` number of elements -1. For example, in the array variable declared with VARIABLE A[3], three elements, A[0], A[1], and A[2] can be used.
_____We can also reference a portion of an array variable as a separate array variable. We call this an array section, and we use the format of array variable name [start index expression : number of elements]. For example, concerning the array variable declared with VARIABLE A:I[5], when we make it A[2:2], we can reference it as an array variable possessing the two elements A[2] and A[3]. In a case where we have omitted the start index, it becomes array variable name [ : number of elements], and thus it becomes the same as array variable name [0 : number of elements] (in other words from the beginning). In a case where we have omitted the number of elements, it becomes array variable name [start index : ], and thus it becomes the same as array variable name [start index : number of elements-start index] (in other words, up to the end). In a case where both have been omitted, it becomes [ : ], and thus it becomes the entire array. However, what the array section can be used with are only the SET statement, the TEXT statement, the MESG statement, the LOG statement, the FREAD statement, the FWRITE statement, the RSPUT statement, the RSPUTC statement, and the RSPUTN statement.
_____In a case where you would like to receive an array variable in a function, you make it either FUNC function (array:S) or FUNC function (array:I[]). In the case of array : S, you receive it as a symbol variable, and in the case of array : I[], you receive it as an integer string. For both the operations are exactly the same, but in the case of array : I[], because you are specifying a type, the discovering of errors becomes easier. As for calling up the functions, we simply make it in the manner of CALL function (array). Specifying an array section is not possible.
52, 53

_____
SCRIPT
Syntax
Function
_____In a case where we will use a procedure name as a symbol type and argument for calling up a procedure, it is necessary for the procedure to be registered beforehand.
_____We declare procedures and functions with the ACTION, MACTION, and FUNC statements, but because procedure names and function names have not yet been declared in front of this location, when we try to substitute them for a symbol variable, it becomes an error. By using the SCRIPT statement at the beginning of the script and then declaring the procedure names and function names, it will come about that we can substitute procedure names and function names for a symbol variable.
_____In the case of the CALL statement and the EXECUTE statement, where it is clear that it is a procedure name that is a procedure call inside an expression, it is not particularly necessary to make a declaration in advance with the SCRIPT statement.
Errors that Occur at Startup Time
`procedure or item has not been defined
Procedure declared with SCRIPT has not been defined.
54

I Reference Section

SEGMENT
Syntax
Function
_____This defines a variable segment variable. It doesn't matter where it is in the script, but it is necessary to define it prior to using it. Because null is set as the initial value, we use it after setting the segment contents with the SETSEG statement and the COPYSEG statement. Furthermore, a variable segment variable can be referenced from that entire script. We cannot prepare a variable segment variable for each procedure.
_____In a case where we have made an array, a variable segment variable will be created by a name to which we attach a number in order from 0 at the end of the segment name. And then, a symbol-type array variable will be prepared with the name of the segment name, and the variable segment variables of just a while ago will be substituted in order in the array variable. For example,
_____
SEGMENT a[3]
will come to mean the same as the following.
SEGMENT a0,a1,a2
VARIABLE a:S[3]
a[0]=a0
a[1]=a1
a[2]=a2
_____
You can specify a value from 1 up to 500 for the number of elements in an array.
Errors that Occur at Startup Time
The item is already defined
The variable name has already been defined by another.
The size of the array is illegal or it has exceeded the limits
The number of array elements is illegal or has exceeded the limits.
Please specify the size of the array with integers
Please use integers in the specification of the size of the array.

55

_____
PROLOGUE
Syntax
Function
_____This defines the procedure used in initial processing. When a MicroScript window has opened, it is executed only once.
_____The PROLOGUE procedure can be defined only once inside a script. Normally, inside the PROLOGUE procedure, it will come about that we will carry out the initial display and various types of initialization processing. If it is not necessary to do anything at startup time, the PROLOGUE procedure is not necessary; in that case, there will be in a state in which nothing is displayed inside the the work region of the window.
_____END must be described at the end of the initial procedure. The contents enclosed by PROLOGUE and END become the initial procedure contents.
_____Differing with a normal procedure, the PROLOGUE procedure cannot be called up from something else with such things as the CALL statement and the EXECUTE statement. It is only called up automatically at startup time.
Errors that Occur at Startup Time
There is no END at the end of the procedure
Please use PROLOGUE in opposition to END.
The item is already defined
Only one PROLOGUE procedure can be defined in one script.
56

I Reference Section

EPILOGUE
Syntax
Function
_____This defines the procedure used in termination processing. When a MicroScript window closes, it is executed only once.
_____The EPILOGUE procedure can be defined only once inside a script. Normally, inside the EPILOGUE procedure, it will come about that we will carry out various types of termination processing. If it is not necessary to do anything at termination time, then it is not necessary to create an EPILOGUE procedure.
_____END must be described at the end of the EPILOGUE procedure. The contents enclosed by EPILOGUE and END become the termination procedure contents.
_____Differing with a normal procedure, the EPILOGUE procedure cannot be called up from something else with such things as the CALL statement and the EXECUTE statement. It is only called up automatically at termination time.
_____When the EPILOGUE procedure starts up, all other threads are forcefully terminated, and then the EPILOGUE procedure executes. The execution of the EXECUTE statement is not possible inside the EPILOGUE procedure (it is ignored). Moreover, termination takes place immediately without waiting, even if we execute a statement that enters waiting in the manner of the WAIT statement, the VWAIT statement, the RSWAIT statement, and the SLEEP statement. There is also no starting up of event-specific procedures.
Errors that Occur at Startup Time
The is no END at the end of the procedure
Please use EPILOGUE in opposition to END.
The item is already defined
Only one EPILOGUE procedure can be defined in one script.

57

_____
ACTION
Syntax
Function
_____This defines a procedure that needs to execute as an independent thread, and which does not need to perform multi-execution. The defined procedure is started up by a specified event or the EXECUTE statement.
_____When there is a state in which a procedure defined with ACTION has already started up, startup as an independent thread (based on the EXECUTE statement or an event occurrence) in regard to that procedure is ignored.
_____Procedures defined with ACTION also can execute by means of the CALL statement and a procedure call inside an expression, but if that procedure is one that executes only with CALL or a procedure call, we recommend defining it with FUNC, and not ACTION.
_____
_____For argument definitions, specify them in the same manner as variable names and types in variable definitions.
_____Argument names are to be usable only inside that procedure. In a case where the same name has been defined as a global variable, that global variable cannot be used inside the procedure.
_____Arguments can also be used as local variables.
_____Array variables as arguments can also be specified (array sections cannot be specified). In that case, because the array itself is not a copy of the variable of the call up source, value changes become value changes of the array at the call up source.
_____Up to a total of 256 arguments and local variables inside a procedure can be used.
_____
_____When we specify an event name, a thread will be started up by an occurrence of that event. In segment specification, a segment name or a variable segment variable can be used.
_____For the event names, there are PRESS, CLICK, DCLICK, QPRESS, MENU, and KEY. Regarding the details of each event, please refer to the explanation in EVENT NAMES (p. 63).
_____
_____Event-specific procedures that can be defined for one segment are one only per each event.
_____The screen region to cope with the event becomes the minimal square region that includes all the elements, excluding the segment character strings of the specified segments. Even in places that in appearance are not on top of a segment, they are recognized as events, and threads are started up.
_____A thread starts up by an event only when a specified segment is in display status.
_____In the case of a virtual object, it is not necessary to explicitly define a procedure in order to start up an application, because a procedure that starts up applications in response to DCLICK has been defined. You can define a procedure in a case where you would like to carry out other processing in response to the double clicking of a virtual object.
Errors that Occur at Startup Time
There is no END at the end of the procedure
We use ACTION and END in opposition to each other.
The item is already defined
A procedure, variable, or segment with the same name has already been defined.
A procedure that starts up from the segment has already been defined
A procedure that corresponds to the specified segment and event has already been defined.
Please specify the segment name
A symbol variable cannot be used in specifying a segment.
The specified segment has not been defined.
The number of menu procedures has exceeded the limit
Only up to eight procedures that start up via the menu can be defined.
A KEY procedure has already been defined
Only one procedure that starts up via a KEY event can be defined.
58, 59

_____
MACTION
Syntax
Function
_____We call multiple threads starting up from one procedure multi-startup. We define a procedure through which this multi-startup is possible with MACTION.
_____Leaving aside the point that it can start up multiple threads, it is the same as ACTION. Please refer to ACTION (p. 58).
Errors that Occur at Startup Time
There is no END at the end of the procedure
We use MACTION and END in opposition to each other.
The item is already defined
A procedure, variable, or segment with the same name has already been defined.
A procedure that starts up from the segment has already been defined
A procedure that corresponds to the specified segment and event has already been defined.
Please specify the segment name
A symbol variable cannot be used in specifying a segment.
The specified segment has not been defined.
The number of menu procedures has exceeded the limit
Only up to eight procedures that start up via the menu can be defined.
A KEY procedure has already been defined
Only one procedure that starts up via a KEY event can be defined
60

I Reference Section

FUNC
Syntax
Function
_____This defines a procedure that is executed by the CALL statement and a procedure call inside an expression.
_____In regard to the argument definition, it is the same as the ACTION statement. Please refer also to the ACTION statement (p. 58).
Errors that Occur at Startup Time
There is no END at the end of the procedure
We use FUNC and END in opposition to each other.
The item is already defined
A procedure, variable, or segment with the same name has already been defined.

61

_____
END
Syntax
Function
_____This is used together with PROLOGUE, EPILOGUE, FUNC, ACTION, or MACTION, and it shows the termination of the definition of one procedure.
Errors that Occur at Startup Time
Cannot describe outside the procedure
A procedure that corresponds to END does not exist.
62

I Reference Section

EVENT NAMES
Syntax
Function
_____Event names are used in order to define procedures that start up based on events with ACTION and MACTION.
PRESS CLICK DCLICK
QPRESS MENU KEY
_____Please refer to the explanation of each event name regarding the respective effect.
_____Please refer also to the explanation of ACTION (p. 58) regarding the definition of procedures that start up by events.
_____
_____Concerning PRESS, CLICK, QPRESS, and DCLICK, the timing of the startup of the threads becomes subtly different on whether or not one has defined a respectively corresponding event-specific procedure.
_____PRESS, CLICK, QPRESS, and DCLICK mean press, click, quick press, and double click of the respective segment. Concerning their operations, press is included in click, click is included in quick press, and quick press is included in double click. For that reason, in a case where a procedure has been defined for multiple events for a certain segment, it will come about that the startup of the thread will be delayed until it is made clear which event actually occurred.
_____For example, when a procedure for PRESS and CLICK has been defined in regard to a certain segment, in a case where a press operation has been carried out for the segment, if it is immediately released, it becomes a click, and if that is not the case, it becomes a press. Accordingly, in a case where only a procedure for PRESS has been defined for a certain segment, and a case where a procedure for CLICK also has been defined, the thread will start up with timing in which the former is slightly faster when the event has actually occurred.

63

_____
CLICK
Syntax
Function
_____In ACTION and MACTION, this defines a procedure that starts up by a click on a specified segment.
_____The arguments below are handed over to the thread that has started up.
_____
1st: Segment where the event occurred
2nd: Number of the segment where the event occurred (number when we make the segment series beginning specified at the end of the event name 0)
3rd: X coordinate where the event occurred (relative coordinate value when we make the upper left coordinate values of the window (0,0))
4th: Y coordinate where the event occurred (relative coordinate value when we make the upper left coordinate values of the window (0,0))
_____
_____Event-specific procedures that can be defined for one segment are one only per each event.
_____The thread starts up by the event only when the specified segment is in display status. The screen region to cope with the event becomes the minimal square region that includes all the elements, excluding the segment character strings of the specified segments. Even in a place that in appearance is not on top of the segment, it is recognized as an event, and the thread is started up.
_____Please refer also to ACTION (p. 59) and EVENT NAMES (p. 63).
64

I Reference Section

DCLICK
Syntax
Function
_____In ACTION and MACTION, this defines a procedure that starts up by a double click on a specified segment.
_____The arguments below are handed over to the thread that has started up.
_____
1st: Segment where the event occurred
2nd: Number of the segment where the event occurred (number when we make the segment series beginning specified at the end of the event name 0)
3rd: X coordinate where the event occurred (relative coordinate value when we make the upper left coordinate values of the window (0,0))
4th: Y coordinate where the event occurred (relative coordinate value when we make the upper left coordinate values of the window (0,0))
_____
_____Event-specific procedures that can be defined for one segment are one only per each event.
_____The thread starts up by the event only when the specified segment is in display status. The screen region to cope with the event becomes the minimal square region that includes all the elements, excluding the segment character strings of the specified segments. Even in a place that in appearance is not on top of the segment, it is recognized as an event, and the thread is started up.
_____Please refer also to ACTION (p. 59) and EVENT NAMES (p. 63).

65

_____
MENU
Syntax
Function
_____In ACTION and MACTION, this defines a procedure for when a menu has been selected, after one has registered in the [Control] menu the menu items of specified menu character strings. Up to a maximum of eight can be registered in the menu.
_____When a menu item has been selected, the thread starts up. Differing with PRESS, etc., an argument is not handed over to the thread.
_____When the beginning of the menu item character string is @, one character immediately after @ becomes the menu character. By pressing the menu character key while pressing the command key, it will come about that you have selected that menu. Please specify upper case letters of the alphabet for the menu key.
_____Please refer also to ACTION (p. 59) and EVENT NAMES (p. 63).
66

I Reference Section

KEY
Syntax
Function
_____In ACTION and MACTION, this defines a procedure for when a key has been pressed in a state where the MicroScript window is active. In a case where it is in a state for character segments to be input by means of the INPUT statement and the KINPUT statement, it starts up only when a key other than a character key, back space, or delete (tab key, enter, etc.) has been pressed.
_____The arguments below are handed over to the thread that has started up.
1st: Character code of the key that has been pressed (same as the system variable $KEY)
2nd: State of the meta key (same as the system variable $KSTAT)
_____As for procedures that can start up with KEY, only one can be defined in a script.
_____Please refer also to ACTION (p. 59) and EVENT NAMES (p. 63).

67

_____
PRESS
Syntax
Function
_____In ACTION and MACTION, this defines a procedure that starts up by a press on a specified segment.
_____The arguments below are handed over to the thread that has started up.
_____
1st: Segment where the event occurred
2nd: Number of the segment where the event occurred (number when we make the segment series beginning specified at the end of the event name 0)
3rd: X coordinate where the event occurred (relative coordinate value when we make the upper left coordinate values of the window (0,0))
4th: Y coordinate where the event occurred (relative coordinate value when we make the upper left coordinate values of the window (0,0))
_____
_____Event-specific procedures that can be defined for one segment are one only per each event.
_____The thread starts up by the event only when the specified segment is in display status. The screen region to cope with the event becomes the minimal square region that includes all the elements, excluding the segment character strings of the specified segments. Even in a place that in appearance is not on top of the segment, it is recognized as an event, and the thread is started up.
_____Please refer also to ACTION (p. 59) and EVENT NAMES (p. 63).
68

I Reference Section

QPRESS
Syntax
Function
_____In ACTION and MACTION, this defines a procedure that starts up by a quick press on a specified segment.
_____The arguments below are handed over to the thread that has started up.
_____
1st: Segment where the event occurred
2nd: Number of the segment where the event occurred (number when we make the segment series beginning specified at the end of the event name 0)
3rd: X coordinate where the event occurred (relative coordinate value when we make the upper left coordinate values of the window (0,0))
4th: Y coordinate where the event occurred (relative coordinate value when we make the upper left coordinate values of the window (0,0))
_____
_____Event-specific procedures that can be defined for one segment are one only per each event.
_____The thread starts up by the event only when the specified segment is in display status. The screen region to cope with the event becomes the minimal square region that includes all the elements, excluding the segment character strings of the specified segments. Even in a place that in appearance is not on top of the segment, it is recognized as an event, and the thread is started up.
_____Please refer also to ACTION (p. 59) and EVENT NAMES (p. 63).

69


The above contents of BTRON MicroScript Reference Manual were translated and loaded onto this Web page with the permission of Personal Media Corporation.

Copyright (c) 1997 Personal Media Corporation

Copyright (c) 2009 Sakamura Laboratory, University Museum, University of Tokyo