Amos Professional Manual  Contents  Index

Windows


Simply give the index numbers of the ink, paper, outline and pattern to be used for the slider bar, followed by the ink paper, outline and pattern to be used by the slider control box. If negative values are used for either pattern, a sprite image will be commandeered from the sprite bank, allowing even more spectacular effects. Try this example:

E> Centre "<Press a key>" : Curs Off
    Do
     A1=Rnd(15) : B1=Rnd(15) : C1=Rnd(15) : D1=Rnd(24)
     A2=Rnd(15) : B2=Rnd(15) : C2=Rnd(15) : D2=Rnd(24)
     Set Slider Al ,B1,C1,D1,A2,B2,C2,D2
     Hslider 10,10 To 300,60,100,20,25
     Vslider 10,60 To 20,190,100,20,25
     Wait Key
    Loop

Having set up your slider bars, you will want to activate them using the mouse. A simple routine to create working slider bars needs to be included in your main program. As always, remember to test out the ready-made example programs, for a working guide.

Displaying a text window
To end this Chapter, here is an extremely useful AMOS Professional feature that allows the display of a text file directly on screen. Text can be displayed in its own independent screen, it may be scrolled through at will, the display window can be dragged around the screen and there is even a facility to include a title line.

READ TEXT$
instruction: display a text window on screen
Read Text$ name$
Read Text$ name$,address, length

In its simplest form, the READ TEXT$ command reads the text held in a specified filename on disc, for example:

X> Read Text$ Fsel$("**")

You can move through the displayed text using scroll bars, the arrow icons or via the following key combinations:

Key Press                       Effect
[Up Arrow]/[Down Arrow]         Move up/down by one line
[Shift]+[Up Arrow]/[Down Arrow] Scroll up/down by one page
[Ctrl]+[Up Arrow]/[Down Arrow]  Jump directly to top/bottom of text
[Esc] or [Return]               Exit

To read some text from an address in memory, there is an alternative version of the READ TEXT$ command. In this case the name$ parameter refers to a title line that will be printed at the top of the viewing window. Address holds the address of the first line of the text to be read. Length specifies the length of the text to be read, in bytes.

Back    Next
05.07.06