home *** CD-ROM | disk | FTP | other *** search
/ Dream 46 / Amiga_Dream_46.iso / Amiga / Internet / Irc / ChatBox1_164.lha / Rexx / acceptdcc.cb next >
Text File  |  1997-10-24  |  2KB  |  52 lines

  1. /* setACCEPTDCC.gv   V1.1    ⌐1995 Michael J. Pounders   IRCnick=mjp        */
  2. /*                                                                          */
  3. /*   Code cleaned up by Tau, 5-30-95                                        */
  4. /*                                                                          */
  5. /* This program will add or remove names from the ACCEPTDCC environment     */
  6. /* variable from within Grapevine V1.365 or higher                          */
  7. /*                                                                          */
  8. /* RX setACCEPTDCC.rexx R/S=Remove nick NS/S= doesn't save ACCEPTDCC to     */
  9. /* ENVARC: <nick>                                                           */
  10.  
  11.  
  12. if ~show('l','rexxdossupport.library') then
  13.         call addlib("rexxdossupport.library",0,-30,2)
  14. if ~show('l','rexxdossupport.library') then
  15.         exit 10
  16.  
  17. TDCC = GetVar("ACCEPTDCC","G" )
  18.  
  19. ADCC = translate(TDCC,' ','|')
  20.  
  21. ADCC = translate(ADCC,'','(')
  22.  
  23. ADCC = translate(ADCC,'',')')
  24.  
  25. ADCC = strip(ADCC,'B')
  26.  
  27. parse arg args
  28.  
  29. if ~ReadArgs(args, "R/S,NS/S,Nick/A", "args.") then
  30.         exit 10
  31.  
  32. word = find(ADCC,args.Nick)
  33. if args.R then do
  34.         if word > 0 then
  35.                 SDCC = delword(ADCC,word,1)
  36. end
  37. else if word = 0 then
  38.         SDCC = ADCC args.Nick
  39. else
  40.         exit 10
  41.         
  42. SDCC = strip(SDCC,'B')
  43. SDCC = translate(SDCC,'|',' ')
  44. SDCC = '('SDCC')'
  45. SetVar("ACCEPTDCC",SDCC,"G")
  46.  
  47. if 0 = args.NS then Open(ACDCC,'ENVARC:ACCEPTDCC','W') WRITECH(ACDCC,SDCC)
  48. if ~args.NS & open('acdcc','ENVARC:ACCEPTDCC','W') then do
  49.         writech('acdcc',SDCC)
  50.         close('acdcc')
  51. end
  52.