home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / VOL8N11.ZIP / FUNCTEST.PRG < prev    next >
Text File  |  1989-02-20  |  1KB  |  38 lines

  1. * functest.prg RHS 2/20/89
  2. * This program demonstrates the use of a dBASEIV User-Defined Function
  3. * which you can use to create windowed error messages.
  4. * The function, wmsg() requires two parameters.
  5. * The first parameter is the message you wish to print.
  6. * The second parameter is used to prompt the user to press any key or a 
  7. * particular key. The function will return the keystroke pressed.
  8. *
  9. * For instance,
  10. *    choice = wmsg("Ready to re-index database.","Proceed? (Y/N)")
  11. *    if upper(choice) = 'Y'
  12. *        && reindex database
  13. *    endif
  14. *
  15. *
  16. * The only requirement for using the function, is that you must define the
  17. * msg_win window somewhere in your program code.
  18.  
  19.  
  20.  
  21. Define Window msg_win from 12,5 to 15,75 double color gr+/r
  22.  
  23. retval = wmsg("This error message appears in a window...","...Press any key")
  24. ?"Return value was ",retval
  25. return
  26.  
  27.  
  28.  
  29. Function wmsg
  30.     Parameters msg,prompt
  31.     Activate Window msg_win            && activate the window
  32.     @ 0,0 Say msg                && print main message
  33.     Wait prompt To retval            && print prompt, wait for key 
  34.     Deactivate Window msg_win            && deactivate window
  35.     Return retval                && return key
  36.     
  37.