home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 600-699 / ff634.lha / APIG / apig33.lzh / aslfile3.rexx < prev    next >
OS/2 REXX Batch file  |  1992-02-05  |  2KB  |  82 lines

  1. /* Example of using ASL Library FILE requester with tags */
  2.  
  3. /*  */
  4.  x = addlib("apig.library",0,-30,0)
  5.  
  6. call set_apig_globals()
  7.  
  8. freq = ALLOCASLREQUEST(ASL_FILEREQUEST,null())
  9.  
  10. portname = "aslfile3_port"     
  11.                              
  12. p = openport(portname)  
  13.  
  14. WaitForPort portname  
  15.  
  16. wintitle = "ASL FILE Requester Example"
  17.  
  18. winidcmp = CLOSEWINDOW 
  19.                              
  20. winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH+GIMMEZEROZERO
  21.  
  22. win = openwindow(portname,0,0,640,200,2,4,winidcmp,winflags,wintitle,null(),0,0,0)
  23.  
  24. asltags = makeasltaglist()   /* tags for the ASL Requester */
  25.  
  26. do forever   /* present requester until canceled */
  27.  
  28.    selectedfiles = ASLREQUEST(freq,asltags)
  29.  
  30.    if selectedfiles = null() then
  31.       leave
  32.    say selectedfiles
  33.  
  34. end
  35.  
  36. call FREEASLREQUEST(freq)
  37.  
  38. call CLOSEWINDOW(win)
  39.  
  40. exit
  41.  
  42. makeasltaglist:
  43.  
  44.     asltags = makepointer(freq,0,200,MEMF_CLEAR)  /* freq owns this memory */
  45.  
  46.     hailstring = makepointer(freq,0,80,MEMF_CLEAR)
  47.     call export(hailstring,"Select A File(s)... or CANCEL")
  48.  
  49.     oktext = makepointer(freq,0,80,MEMF_CLEAR)
  50.     call export(oktext,"ALRIGHT")
  51.  
  52.     canceltext = makepointer(freq,0,80,MEMF_CLEAR)
  53.     call export(canceltext,"NO WAY!")
  54.  
  55.     initpattern = makepointer(freq,0,80,MEMF_CLEAR)
  56.     call export(initpattern,"#?.rexx")
  57.  
  58.     initdir = makepointer(freq,0,80,MEMF_CLEAR)
  59.     call export(initdir,"ram:")
  60.  
  61.     call SETTAGSLOT(asltags,0,ASL_HAIL,'p',hailstring)
  62.     call SETTAGSLOT(asltags,1,ASL_LEFTEDGE,'n',20)
  63.     call SETTAGSLOT(asltags,2,ASL_TOPEDGE,'n',20)
  64.     call SETTAGSLOT(asltags,3,ASL_WIDTH,'n',540)
  65.     call SETTAGSLOT(asltags,4,ASL_HEIGHT,'n',190)
  66.     call SETTAGSLOT(asltags,5,ASL_OKTEXT,'p',oktext)
  67.     call SETTAGSLOT(asltags,6,ASL_CANCELTEXT,'p',canceltext)
  68.     call SETTAGSLOT(asltags,7,ASL_PATTERN,'p',initpattern)
  69.     call SETTAGSLOT(asltags,8,ASL_DIR,'p',initdir)
  70.  
  71.     /* aslfuncflags newidcmp, include pattern gadget, multiple file selection */
  72.     aslfuncflags = FILF_NEWIDCMP + FILF_PATGAD + FILF_MULTISELECT
  73.  
  74.     call SETTAGSLOT(asltags,9,ASL_FUNCFLAGS,'n',aslfuncflags)
  75.  
  76.     call SETTAGSLOT(asltags,10,ASL_WINDOW,'p',win)
  77.  
  78.     call SETTAGSLOT(asltags,11,TAG_DONE,'n',0)
  79.  
  80.  
  81. return asltags
  82.