Amos Professional Manual  Contents  Index

Advanced Control Panels


DIgit
Interface instruction: create a numeric editing zone
DI zone number,x,y,width,value,flag,paper,pen;

The DIgit instruction creates a special edit window for entering numbers. It is very similar to the previous EDit command, except for the fact that only the digits from zero to 9 may be entered, and anything else will be completely ignored by the Interface system.

Please refer to the EDit command to see how the zone number is specified first, followed by the x,y-coordinates that set the position of the zone on screen. The width of the window is then set, and it is rounded up to the next even number, in exactly the same way as with an EDit instruction.

The value parameter defines what the initial default value displayed in the edit window is to be. The flag parameter indicates whether the default is to be shown in the window, with a zero setting to make the default value invisible, and any other setting meaning that it will be displayed as normal. Finally, the paper and pen parameters are set by the colour index numbers to use for the input numeric characters.

The DIgit value can be read from the main AMOS Professional program with the RDIALOG function.

Here is a simple working example:

E> A$=A$+"BA 50,50; SI 200,90; SA 1;"
   A$=A$+"IN 5,0,0; GB 0,0,200,80;PR 16,10,'Enter your name human!',2;"
   A$=A$+"BU 1;150,70,40,10,0,0,16;"
   A$=A$+"[IN BPos 4+,0,0; GB 0,0,50,10; PR 2,0,' Quit',2;][BQ;] KY 13,0;"
   A$=A$+"ED 2,16,25,14,14,",0,2; text edit zone"
   A$=A$+"PR 16,40,'How old are you?',2;"
   A$=A$+"DIgit 3,16,50,4,30,0,0,2; numerical edit zone"
   A$=A$+"EXit;"
   Dialog Open 1,A$ : R=Dialog Run(1)
   Repeat
    D=Dialog(1) : Rem Wait for the user to enter the last item
   Until D<0
   Print "Hello ";Rdialog$(1,2) : Print "You are ";Rdialog(1,3); "years old"
   Dialog Close

Sliders and Selectors
One of the most powerful features of the Interface system is the facility to create a wide variety of sliders and selection boxes in AMOS Professional programs. The next part of this Chapter provides a detailed examination of the commands that make this possible.

HorizontalSlider
Interface instruction: create an animated horizontal slider bar
HS zone number,x,y,width,height,position,trigger,total,step;[changes]

The HS command draws an animated horizontal slider bar on the screen.

Back    Next
09.03.07