home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / WordProcessors / BK-WW6E3.DMS / in.adf / Archive / WwRexx.lha / Encrypt_Message.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1996-06-25  |  1005 b   |  62 lines

  1. /*    Encrypt_Message
  2.  
  3.         Encrypts a message and saves it.
  4.  
  5.         Digita ARexx Script for Wordworth 5
  6.         Copyright ©1996, Digita International Ltd.
  7.         
  8.         Created: 25 June 1996
  9.         Author:  MJ
  10. */
  11.  
  12.  
  13. OPTIONS RESULTS
  14.  
  15.  
  16. RequestFile TITLE "Save encrypted file..."
  17. FileName = Result
  18.  
  19. If RC > 0 THEN
  20.     Exit
  21.  
  22. SaveAs ASCII NAME FileName
  23.  
  24. If Open('MyFile', FileName, R) THEN DO
  25.  
  26. oldport = Address()
  27.  
  28.     New
  29.     Address Value Result
  30.  
  31.     Document A4 "0.5in" "0.5in" "0.6in" "1.0in"
  32.     Zoom 100
  33.     Paragraph 0 0 0 LEFT AUTO SINGLE NONE NONE
  34.  
  35.     Font NAME "Shannon Book" SIZE 10 PLAIN
  36.  
  37.     DO Until EOF('MyFile')
  38.         MyLine = ReadLn('MyFile')
  39.         LengthLine = Length(MyLine)
  40.         Cache = ''
  41.         DO Num = 1 to LengthLine
  42.              MyChar = SubStr(MyLine, Num, 1)
  43.             Mychar = BitChg(Mychar, 1)
  44.             Cache = Cache || MyChar
  45.         END
  46.         Text Cache
  47.         NewParagraph
  48.     END
  49.  
  50.     Call Close('MyFile')
  51.  
  52.     SaveAs ASCII NAME FileName
  53.     Close FORCE
  54.  
  55. Address Value oldport
  56.  
  57.     RequestNotify PROMPT 'Message succesfully encrypted!'
  58.  
  59. END
  60. ELSE
  61.     RequestNotify PROMPT "Error: Unable to open file!"
  62.