home *** CD-ROM | disk | FTP | other *** search
/ Amiga Computing 57 / ac057a.adf / Demos / SysRequestors.bas < prev    next >
BASIC Source File  |  1989-07-04  |  1KB  |  39 lines

  1. ' An example showing how to keep system requestors in
  2. ' your own screen.
  3. ' A system requestor is something like 'Please insert volume xx'
  4. ' or 'Volume xx is write procected' etc.
  5. ' They normally appear in the Workbench screen but this can be
  6. ' a nuisance if your program is using its own screen and the user
  7. ' can get very confused when the program (s)he is using disappears.
  8. ' This works by attaching the requestors to a particular window
  9.  
  10. LIBRARY "exec"
  11. DECLARE FUNCTION FindTask&(who&) LIBRARY
  12.  
  13. SCREEN 1,640,200,2,2
  14. WINDOW 1,"Test Window",(10,100)-(500,150),,1
  15.  
  16. ' attach now
  17. SetSysReq WINDOW(7)
  18.  
  19. ' cause one to appear
  20. PRINT "Causing an error now - select Cancel"
  21. junk%=FEXISTS("Impossible:junk")
  22.  
  23. ' it is important that the system requesters are detached from
  24. ' a window before it is closed
  25. SetSysReq 0
  26. WINDOW CLOSE 1
  27.  
  28. SCREEN CLOSE 1
  29.  
  30.  
  31. ' pass this either WINDOW(7) to use the current window,
  32. ' or 0=Workbench screen, or -1=don't put them anywhere
  33. SUB SetSysReq(VAL w&)
  34. LOCAL me&
  35. me&=FindTask&(0)
  36. POKEL me&+184,w&
  37. END SUB
  38.  
  39.