home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 91 / af091a.adf / af91a3.lzx / prgs / Library / reqtools.b < prev    next >
Encoding:
Text File  |  1996-09-15  |  1.1 KB  |  41 lines

  1. REM An example of using reqtools.library functions.
  2. REM (reqtools.library must be in your LIBS: directory
  3. REM for this program to work). ReqTools.bmap is also
  4. REM required and has been supplied in ACEbmaps:.
  5.  
  6. #include <intuition/intuitionbase.h>
  7. #include <intuition/intuition.h>
  8. #include <graphics/gfxbase.h>
  9. #include <graphics/gfx.h>
  10. #include <libraries/reqtools.h> 
  11. #include <funcs/reqtools_funcs.h>
  12.  
  13. LIBRARY "reqtools.library"
  14.  
  15. DECLARE STRUCT rtReqInfo *myreq
  16. DECLARE STRUCT rtFileRequester *filereq
  17.  
  18. REM Message Requester
  19. myreq = rtAllocRequestA(RT_REQINFO,NULL)
  20. dummy$ = "This is a really"+CHR$(10)
  21. dummy$ = dummy$ + "neat message"+CHR$(10)
  22. dummy$ = dummy$ + "requester!"
  23. button$="Sure|Perhaps|No way"
  24. ret = rtEZRequestA(dummy$,button$,NULL,NULL,NULL)
  25. rtFreeRequest(myreq)
  26.  
  27. REM File Requester
  28. STRING fileBuffer, theDir
  29. filereq = rtAllocRequestA(RT_FILEREQ,NULL)
  30. ok = rtFileRequestA(filereq,fileBuffer,NULL,NULL)
  31. rtFreeRequest(filereq)
  32. theDir = CSTR(filereq->Dir)
  33. IF theDir <> "" AND RIGHT$(theDir,1) <> ":" THEN theDir = theDir+"/"
  34. IF ok THEN 
  35.   print "You chose: ";theDir;fileBuffer
  36. ELSE
  37.   print "Requester cancelled."
  38. END IF
  39.  
  40. LIBRARY CLOSE
  41.