home *** CD-ROM | disk | FTP | other *** search
- /* Save_Address
- A Macro by Steven. R. Giovenella, 5823 Dutchess Dr., Colorado Springs, CO 80918.
- © Copyright 1994 Steven. R. Giovenella, All rights reserved.
- This macro is my gift to the Amiga community. It may be given away free to
- anyone, but it may NOT be sold in any way, shape, or form, not even for the cost of
- reproduction, downloading, shipping, or handling, without express written
- permission from the author listed above. Any person or company who violates the
- content of the previous sentence, agrees to pay Steven R. Giovenella $1,000 (US) for
- each copy of this macro sold. This macro may NOT be added to any disk which is to
- be sold for any price or fee, to include shipping and handling. The ONLY way this
- macro may be distributed is on a disk which is given away 100% free of all charges,
- or on via telecommunications networks which do not charge any additional fee as a
- result of a user downloading this particular macro. This macro may only be
- reproduced in its entirety, including all comment lines and code. The individual
- user may alter this macro for personal use, but may not then distribute the macro
- in any modified form. If you wish, feel free to send me some cash, a Christmas card,
- some other piece of software, or absolutely nothing as a gift for creating this macro.
- The author of this software is not responsible for any data loss or damage to
- computer equipment as a result, direct or indirect, of the use of this macro. */
-
- Options Results
-
- /* Check to see if no document is open */
- Status FileName
- IF Result = "" THEN flag = 1
-
- /* Initialize*/
- type " "
- backspace
-
- /* Open DataFile */
- RequestText '"Save Address" "Enter destination Data File..."
- "Address_DataFile.ASCII"'
- datafile = Result
- file = "FWDocs/" || datafile
- Open file
- altdown
- ctrldown
- cursor down
-
- /* Switch ARexx Addresses */
- Status PortName
- port = Result
- portnumber = RIGHT(port,1) + 1
- newport = "FINALW." || portnumber
- /* IF flag=1 THEN newport="FINALW.1" */
- ADDRESS VALUE newport
-
- /* Goto to end of file */
- AltDOWN
- CtrlDOWN
- Cursor DOWN
- AltUP
- CtrlUP
-
- /* Get ending linenumber */
- Status LinePos
- Coords = Result
- PARSE VAR Coords Line Pos
-
- EnterAddress:
- /* Input record */
- RequestText '"SAVE Address" "Persons name. (Line 1 of 8)" ""'
- Address.1 = Result
- RequestText '"SAVE Address" "Company name. (Line 2 of 8)" ""'
- Address.2 = Result
- RequestText '"SAVE Address" "Street address, line one. (Line 3 of 8)" ""'
- Address.3 = Result
- RequestText '"SAVE Address" "Street address, line two. (Line 4 of 8)" ""'
- Address.4 = Result
- RequestText '"SAVE Address" "City name. (Line 5 of 8)" ""'
- Address.5 = Result
- RequestText '"SAVE Address" "State. (Line 6 of 8)" ""'
- Address.6 = Result
- RequestText '"SAVE Address" "Zip Code. (Line 7 of 8)" ""'
- Address.7 = Result
- RequestText '"SAVE Address" "Phone Number. (Line 8 of 8)" ""'
- Address.8 = Result
-
- /* Format record (remove commas) */
- DO j=1 to 8
- DO i=1 to LENGTH(address.j)
- IF RIGHT(LEFT(address.j , i) , 1) = "," THEN DO
- fronthalf = LEFT(address.j , (i-1))
- backhalf = RIGHT(address.j , LENGTH(address.j) - i)
- address.j = fronthalf || " " || backhalf
- END
- END
- END
-
- /* Confirmation */
- ShowMessage 1 0 '"Confirm that you wish to save this address." "" "" "Save" "
- Re-Input Address " " Cancel "'
- IF Result=2 THEN Call EnterAddress
- IF Result=3 THEN DO
- Close Force
- Exit
- END
-
- /* Insert Record */
- DO i=1 to 8
- type address.i
- type ","
- END
- Backspace
- newparagraph
-
- /* Select from line 2 position 0 to end-1 */
- MoveToLine 2 0
- ShiftDOWN
- CtrlDOWN
- AltDOWN
- Cursor DOWN
- AltUP
- CtrlUP
- Cursor UP
-
- /* Sort */
- Sort LowToHigh
-
- /* Deselect */
- Cursor DOWN
- AltUP
- CtrlUP
- ShiftUP
- MoveToLine 2 0
-
- /* Set ASCII Preferences */
- ASCIIPrefs paranewline NO parablankline YES insertnewline NO insert
- blankline YES
-
- /* Save ASCII */
- Save ASCII "FWDocs/Address_DataFile.ASCII"
-
- /* Close DataFile */
- Close FORCE
-