VerticalSlider
Interface instruction: create an animated vertical slider bar
VS zone number,x,y,width,height,position,trigger,total,step;[changes]
The VerticalSlider command generates a working vertical slider, as demonstrated by the standard AMOS Professional file selector. The parameters are exactly the same as for the HSlider command, and the position of the slider can be read by a call to the RDIALOG function, like this:
X> position=RDIALOG(channel number,zone number)
Once slider bars have been created, they can be used to produce attractive selector boxes. These allow you to scroll through a list of items directly on the screen, and select them individually using the mouse, again, as demonstrated by the AMOS Professional file selector.
Reading arrays
In order to generate an Interface selector, a method is needed of grabbing an entire list of items
from the AMOS Professional main program. A simple function is provided for transferring
complete arrays into an Interface routine.
ARRAY
function: load the address of an array into a program
address=ARRAY(list$(0))
The ARRAY function returns the address in memory of the first item in the specified list$ array. This string can contain any data at all, but if the array is to be accessed from an Interface program, each element in the array must be of exactly the same length.
After it has been returned, the address may now be installed into an Interface program using the VDIALOG function, as follows:
X> Vdialog(1,0)=Array(V$(0)) : Rem Loads 0 VA (channel 1) with the address of V$(0)
Once installed like that, the address can be accessed from an Interface program using the ArrayRead function.
ArrayRead
Interface function: read an element from an AMOS Professional array
item=address,element number AR
This function returns the specified item from a normal AMOS Professional array. The element to be returned must have been previously loaded into an Interface variable from the main program. The two parameters that must be specified are the address which holds the location of the first item in the array, followed by the number of the item in that array which is to be returned. Obviously, if the number of the specified element is higher than the dimension of the array, an error will be generated.