home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-09-28 | 2.3 KB | 59 lines |
- '*************************************
- '* AMOS Professional Interface *
- '* *
- '* Communicating with Basic *
- '* *
- '* (c) Europress Software *
- '* *
- '* Ronnie Simpson *
- '*************************************
- '
- Load "AMOSPro_Tutorial:Tutorials/Interface/Example_resource.abk"
- Resource Bank 16
- Resource Screen Open 0,640,200,0
- Flash Off : Curs Off : Cls 0
- Palette ,,,,$534,$978,$DBC,$FFF
- Wait Vbl
- A$=A$+"BUtton 1,XB40+,18,56,14,0,0,1;[UN0,0,BP45+;PR12,3,'QUIT',8;][BR0;BQ;]"
- A$=A$+"BUtton 2,XB,18,56,14,0,0,1;[UN0,0,BP49+;PR12,3,'Line',8;][SetVar2,2VA1+;BR0;]"
- A$=A$+"BUtton 3,XB,18,56,14,0,0,1;[UN0,0,BP49+;PR16,3,'Bar',8;][SetVar3,3VA1+;BR0;]"
- A$=A$+"BUtton 4,XB,18,56,14,0,0,1;[UN0,0,BP49+;PR16,3,'Box',8;][SetVar4,4VA1+;BR0;]"
- A$=A$+"LIne 288,4,16,612;"
- A$=A$+"LIne 288,20,16,612;"
- A$=A$+"LIne 288,36,16,612;"
- A$=A$+"EXit;"
- B$=B$+"SetVar 2,1VA 0VA# !;"
- B$=B$+"SetVar 3,'Changing drawing mode';"
- B$=B$+"SIze 3VATW160+,60;"
- B$=B$+"BAse SWidth SX -2/,SHeight SY- 2/;"
- B$=B$+"SAve 2;"
- B$=B$+"BOx 0,0,1,SX,SY;"
- B$=B$+"POutline 3VACX,10,3VA,0,14;"
- B$=B$+"PRint 2VACX,YB4+,2VA,1;"
- B$=B$+"BUtton 1,SX80-,SY24-,56,14,0,0,1;[UN 0,0,BP47+;PR 20,3,'OK',12;][BQ;]"
- B$=B$+"BUtton 1,SX310-,SY24-,56,14,0,0,1;[UN 0,0,BP47+;PR 16,3,'OK',12;][BQ;]"
- B$=B$+"RUn 0,3;"
- B$=B$+"EXit;"
- Dialog Open 1,A$
- X=Dialog Run(1)
- Ink 7 : Box 0,58 To 639,199
- Paper 5 : Pen 4 : M=3 : Set Paint 1
- Do
- If M=2 Then Ink 0,0,Rnd(6)+1 : R1=Rnd(310)+5 : R2=Rnd(128)+60 : Bar R1,R2 To R1+320,R2+3
- If M=3 Then Ink Rnd(7)+8,0,0 : R1=Rnd(500)+5 : R2=Rnd(118)+60 : Bar R1,R2 To R1+80,R2+20
- If M=4 Then Ink 0,,Rnd(7)+8 : R1=Rnd(500)+5 : R2=Rnd(118)+60 : Bar R1,R2 To R1+40,R2+20
- Wait Vbl
- D=Dialog(1) : Exit If D<0
- On D Gosub BUTTON1,BUTTON2,BUTTON3,BUTTON4
- For V=2 To 4
- Locate 39,V*2-3
- Print "Number of times button";V;" called=";Vdialog(1,V);
- Next
- Loop
- Dialog Close
- Edit
-
- BUTTON1:
- BUTTON2: A=Dialog Box(B$,2,"You clicked on button number ") : M=2 : Return
- BUTTON3: A=Dialog Box(B$,3,"You clicked on button number ") : M=3 : Return
- BUTTON4: A=Dialog Box(B$,4,"You clicked on button number ") : M=4 : Return