A Course in BTRON MicroScript for Beginners

Virtual Object Operations


18.8

We open and close windows by operating virtual objects.

VOPEN [<segment> . . . ]

The VOPEN statement starts up a specified virtual object or utility. In a case where a virtual object segment has been specified, it starts up the double click startup application of the virtual object and opens a window. In a case where a character string has been specified, it starts up the corresponding utility by regarding the character string as the title of a utility. In a case where there is no corresponding utility, it is ignored.

The character string is compared with the utilities registered in the utility menu. A utility that has not been registered in the utility menu cannot start up.

In the specification of a <segment>, there are three methods: the method in which we directly specify the segment name, the method in which we specify a symbol constant in which we have stored a segment, and the method in which we specify a variable segment variable. We can specify segment names, symbol constants, and variable segment variables by respectively punctuating them with commas (,) and lining them up. In a case where the specification of a <segment> has been omitted, the VOPEN statement will be ignored. However, if such is inside a procedure that describes an event in regard to a virtual object segment, it will start up the double click startup application of that virtual object segment. For example, the DCLICK procedure below has been defined internally for a case where the virtual object segment "Virtual_Object1" exists.

ACTION Virtual_Object_Execution DCLICK Virtual_Object1
  VOPEN
END

In a case where the window of the specified virtual object or utility is already opened, that window will be put to the forefront. As for the size and location of a window opened through the VOPEN statement, even in a case where it has been closed, they will not be saved.

In the case of a MicroScript window, you can save the location and size of the self window using the WSAVE statement inside the microscript of that self.

It doesn't matter even if a double click startup application is a microscript. In this case, the PROLOGUE procedure of <virtual object> will be executed first. And then, the script that executed VOPEN and the script of <virtual object> that was newly started up will operate in parallel. Data can be exchanged among multiple microscripts by using the system variable $GV (p. 273) and messages (p. 324).

Applications started up through the VOPEN statement become independent processes to each virtual object of the startup source. Even if the script that includes the VOPEN statement terminates, these independent processes will remain without being terminated. In terminating a process, we use the VCLOSE statement.

VCLOSE [<segment> . . . ]

The VCLOSE statement terminates a specified virtual object or utility. In a case where a virtual object segment has been specified, it closes the window opened from that virtual object, and then terminates the application. In a case where a character string has been specified, it terminates the corresponding utility by regarding the character string as the title of a utility. In a case where there is no corresponding utility, it is ignored.

The character string is compared with the utilities registered in the utility menu. A utility that has not been registered in the utility menu cannot terminate.

In the specification of a <segment>, there are three methods: the method in which we directly specify the segment name, the method in which we specify a symbol constant in which we have stored a segment, and the method in which we specify a variable segment variable. We can specify segment names, symbol constants, and variable segment variables by respectively punctuating them with commas (,) and lining them up. In a case where the specification of a <segment> has been omitted, all the windows opened from the script that includes the VCLOSE statement will be closed. In this case, not just the windows opened with the VOPEN statement, but even windows the user opened with a double click operation of a virtual object will be included.

In a case where we have closed the window of another microscript, it becomes the same thing as having executed the FINISH statement inside that script. In a case where we have specified a utility, there are cases in which the VCLOSE statement will be ignored. In a case where we have executed in multiple the same utility, only the utility executed last will become the target. You cannot make a utility terminate that the user has started up from the utility menu. In a case where the specified virtual object or utility has not started up, the VCLOSE statement. will be ignored.

VWAIT [<segment> . . . ] [: <timeout expression>]

The VWAIT statement waits until a specified virtual object or utility terminates. In a case where a virtual object segment has been specified, it waits until the window opened from that virtual object is closed. In a case where a character string has been specified, it will regard the character string as the title of a utility, and then wait until the corresponding utility terminates. In a case where there is no corresponding utility, it is ignored.

The character string is compared with the utilities registered in the utility menu. A utility that has not been registered in the utility menu cannot terminate.

In the specification of a <segment>, there are three methods: the method in which we directly specify the segment name, the method in which we specify a symbol constant in which we have stored a segment, and the method in which we specify a variable segment variable. We can specify segment names, symbol constants, and variable segment variables by respectively punctuating them with commas (,) and lining them up. In a case where multiple targets have been specified, it will wait until all of the targets terminate. In a case where the specification of a <segment> has been omitted, all the windows opened from the script that includes the VCLOSE statement will be closed. In this case, not just the windows opened with the VOPEN statement, but even windows the user opened with a double click operation of a virtual object will be included.

In a case where a <timeout expression> has been specified, this statement will not wait beyond the specified time. We specify the <timeout expression> in units of seconds. This is the range of 0-86400 seconds (24 hours). In a case where 0 has been specified, it will not wait. In a case where you have omitted a <timeout expression>, it will wait until all the targets specified in <segment> terminate. Whether it has terminated through a timeout, or whether it has terminated by satisfying a condition can be judged with the system variable $ERR (p. 273).

In a case where we have executed in multiple the same utility, only the utility executed last will become the target.


Copyright © 1999 Personal Media Corporation

Copyright © 2011 Sakamura Laboratory, University Museum, University of Tokyo