home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / subroutines / request.amos / request.amosSourceCode
AMOS Source Code  |  1990-11-08  |  1KB  |  34 lines

  1. '
  2. Flash Off : Curs Off 
  3. Reserve Zone 36
  4. REQUEST[50,30,30,"Yes","No","exit ?"]
  5. Print Param
  6. '
  7. '
  8. '
  9. '************************************************************  
  10. '*                                                          *  
  11. '* stzone=use two zones starting with this number           *    
  12. '* pos$= positive button text : neg$= negative button text  *    
  13. '* prompt$=message                                          *    
  14. '*                                                          *    
  15. Procedure REQUEST[X,Y,STZONE,POS$,NEG$,PROMPT$]
  16. '  Returns 1 if positive answer else returns -1
  17.    Memorize X : Memorize Y 
  18.    WIDTH=(Len(POS$)+Len(NEG$)+10)*8
  19.    WIDTH2=(Len(PROMPT$)+2)*8
  20.    WIDTH=Max(WIDTH,WIDTH2)
  21.    X=(X/8)*8 : Ink 0
  22.    Get Cblock 1,X,Y,X+WIDTH,Y+64
  23.    Bar X+1,Y+1 To X+WIDTH-1,Y+63
  24.    Print At(X Text(X+8),Y Text(Y+8))+PROMPT$
  25.    Print At(X Text(X+16),Y Text(Y+40))+Border$(Zone$(POS$,STZONE),1);
  26.    Print At(X Text((X+WIDTH)-(16+(Len(NEG$)*8))),Y Text(Y+40))+Border$(Zone$(NEG$,STZONE+1),1);
  27. TESTZONE:
  28.    While Mouse Key=0 : Z=Mouse Zone : Wend 
  29.    If Z=0 Then Goto TESTZONE
  30.    If Z=STZONE : Z=1 : Else Z=-1 : End If 
  31.    Remember X : Remember Y 
  32.    Put Cblock 1
  33. End Proc[Z]
  34. '************************************************************