home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 28
/
amigaformatcd28.iso
/
-seriously_amiga-
/
comms
/
other
/
aemail151
/
files.lha
/
ARexx.lha
/
Form.aem
< prev
next >
Wrap
Text File
|
1998-03-20
|
4KB
|
141 lines
/* AEMail Form Processing */
OPTIONS RESULTS
FIRST
endmsg = RESULT
IF (endmsg = 0) THEN DO
OKAY1 "No messages in Folder"
EXIT
END
OKAY2 "YES|NO" "Do You Want to Add to Address Book?"
ADDTOAB = RESULT
IF (ADDTOAB = 1) THEN DO
OK = 0
DO UNTIL OK = 1
GETSTRING '"Enter Group Nickname"'
grpname = RESULT
IF (grpname = "") THEN ADDTOAB = 0
IF (ADDTOAB = 0) THEN LEAVE
ADDRESS_BOOK GET grpname TYPE
addrtype = RESULT
IF (addrtype = -1) THEN DO
OKAY2 '"Create It|Enter New Name|Cancel"' "Group Nickname Does Not Exist"
IF (RESULT = 1) THEN DO
GETSTRING '"Enter a Group Description"'
grpdesc = RESULT
OK = 1
OKAY2 "YES|NO" "Do you want to send header only?"
IF (RESULT = 0) THEN sndho = ""
ELSE sndho = "SHO"
END
ELSE IF (RESULT = 2) THEN OK = 0
ELSE IF (RESULT = 0) THEN exit
END
IF (addrtype = 0) THEN DO
OKAY2 '"Re-enter Name|Cancel"' "Nickname is already used for an Individual"
IF (RESULT = 1) THEN OK = 0
IF (RESULT = 0) THEN exit
END
IF (addrtype = 1) THEN OK = 1
END
END
IF ~ SHOW("PORTS","FINALD.1") THEN
DO
ADDRESS COMMAND "Run >NIL: FinalData:FinalData"
ADDRESS COMMAND "WaitForPort FINALD.1"
IF ~ SHOW("PORTS","FINALD.1") THEN
DO
OKAY1 "Final Data Did Not Load"
EXIT
END
END
ADDRESS "FINALD.1" ScreenToFront
ADDRESS "FINALD.1" Open
DO UNTIL endmsg = 0
SUBJECT
subj = RESULT
subjform = SUBSTR(subj,1,9)
subjform = UPPER(subjform)
IF(subjform = "FORM POST") THEN DO
MESSAGE READ
MESSAGE DELETE
MESSAGE SELECT
SAVE TEXT NOLF
FORMSTRING=RESULT
DO UNTIL FORMSTRING = ""
PARSE VAR FORMSTRING FORMLINE '&' FORMSTRING
PARSE VAR FORMLINE HEAD '=' DATA
DATA = TRANSLATE(DATA, " ", "+")
DO UNTIL DATA2 = ""
PARSE VAR DATA DATA1 '%' DATA2
IF DATA2 ~= "" THEN DO
CDATA = SUBSTR(DATA2,1,2)
DATA2 = SUBSTR(DATA2,3)
CDATA1 = X2C(CDATA)
DATA = DATA1 || CDATA1 || DATA2
END
END
IF (HEAD = "subject") THEN DO
DATE MDY
dater = RESULT
ADDRESS "FINALD.1" NEWROW
ADDRESS "FINALD.1" NUMROWS
ROW = RESULT
ADDRESS "FINALD.1" GETCOLUMNPOSITION NAME 'datercvd'
COL = RESULT
ADDRESS "FINALD.1" SELECTCELL COL ROW
ADDRESS "FINALD.1" INSERT dater
END
ELSE DO
IF (HEAD = "homepage") then DO
IF (DATA = "http://www.") THEN DO
DATA = ""
END
END
ADDRESS "FINALD.1" NUMROWS
ROW = RESULT
ADDRESS "FINALD.1" GETCOLUMNPOSITION NAME HEAD
COL = RESULT
ADDRESS "FINALD.1" SELECTCELL COL ROW
ADDRESS "FINALD.1" INSERT DATA
IF (HEAD = "email") THEN DO
IF (DATA ~= "") THEN DO
IF (ADDTOAB = 1) THEN DO
IF (addrtype = -1) THEN DO
cmd = "ADDRESS_BOOK CREATE GROUP " grpname sndho DATA grpdesc
addrtype = 1
END
ELSE cmd = "ADDRESS_BOOK ADD TO GROUP " grpname DATA
cmd
END
END
END
END
END
END
NEXT
endmsg = RESULT
END
ADDRESS "FINALD.1" QUIT
AEMAIL TO FRONT
GETFILENAME '"File to Save Messages"'
if RESULT = "" THEN QUIT
savefile = RESULT
SAVE SELECTED MESSAGES TO '"'savefile'"'
MESSAGE SELECT NONE