home *** CD-ROM | disk | FTP | other *** search
- /* $Revision Header built automatically *************** (do not edit) ************
- **
- ** © Copyright by Dirk Federlein
- **
- ** File : importadm.dfa
- ** Created on : Friday, 01.04.94 12:29:21
- ** Created by : Dirk Federlein
- ** Current revision : V2.0
- **
- **
- ** Purpose
- ** -------
- **
- ** If you've used ADM (what a shame:-)) up to now to manage
- ** your addresses, this script will help you to switch to DFA
- ** without loosing any data or even reentering all of your
- ** addresses!
- **
- ** It imports all addresses currently available from a running
- ** ADM application.
- **
- **
- ** This script should be binded to a function key of DFA, but
- ** will work as well, if you start it from the shell using the
- ** 'rx' command of Arexx, i.e. 'rx importadm.dfa'. Of course, you
- ** have to make sure that DFA _and_ ADM are currently running!
- **
- ** Please note that it is not possible to import the addresses
- ** 1:1 as not all fields exist in ADM _and_ DFA. The following
- ** translation is made:
- **
- ** -------------------------------------------------------------
- ** ADM --> DFA
- ** --- ===
- ** SALUTATION + COMPANY SALUTATION
- ** REMARK1 + REMARK2 COMMENT
- ** <empty> EMAIL3
- ** ADDRESS Line # 1 STREET
- ** ADDRESS Line # 2 CO
- ** ID <empty>
- ** <empty> STATE
- ** -------------------------------------------------------------
- **
- ** The other strings are taken 1:1
- **
- ** Please notice that the <empty> string above means that either
- ** ADM or DFA does not support this field and it is not imported
- ** into DFA, i.e. for example that the 'EMail3' field of DFA will
- ** stay empty! Of course you may modify the translation described
- ** above to fit you needs.
- **
- ** Group flags 1-8 of ADM are put into DFA. Flags 9 and 10 of ADM
- ** are not imported.
- **
- **
- ** Revision V2.0
- ** --------------
- ** created on Friday, 01.04.94 12:29:21 by Dirk Federlein. LogMessage :
- ** --- Initial release ---
- **
- *********************************************************************************/
-
- options results
-
- cr = '0A'X
- quote = '22'X
-
- if ~show(ports, DFA) then
- exit 10
-
- if ~show(ports, ADM.1) then
- exit 20
-
-
- /* --- ADM: Get number of addresses available ----------------------- */
-
- ADDRESS 'ADM.1' ADDRINMEM
-
- numadr = RESULT
-
- /* --- ADM: Activate first entry ------------------------------------ */
-
- ADDRESS 'ADM.1' ACTIVATEFIRST
-
- DO FOR numadr
-
- /* --- ADM: Get current address and put it into 'ADMADDRESS' ---- */
-
- ADDRESS 'ADM.1' GETADDRESS ADMADDRESS
-
- /* --- DFA: Insert new address ---------------------------------- */
-
- ALLFLAGS = ADMADDRESS.FLAGS
-
- /* --- Cut flag 9 and 10 if set in ADM as DFA only supports up -- */
- /* --- to 8 flags ----------------------------------------------- */
-
- if (ALLFLAGS % 512) = 1 then
- ALLFLAGS = ALLFLAGS - 512
-
- if (ALLFLAGS % 256) = 1 then
- ALLFLAGS = ALLFLAGS - 256
-
- /* --- Build 'flags' string from ADM's 'flags' field ------------ */
- /* --- NB: ADM uses a _VERY_ inconvenient way to store its ------ */
- /* --- group flags. --------------------------------------------- */
-
- FLAGSTRING = ""
-
- if (ALLFLAGS % 128) = 1 then
- do
- ALLFLAGS = ALLFLAGS - 128
- FLAGSTRING='GROUP8'
- end
-
- if (ALLFLAGS % 64) = 1 then
- do
- ALLFLAGS = ALLFLAGS - 64
- FLAGSTRING=FLAGSTRING 'GROUP7'
- end
-
- if (ALLFLAGS % 32) = 1 then
- do
- ALLFLAGS = ALLFLAGS - 32
- FLAGSTRING=FLAGSTRING 'GROUP6'
- end
-
- if (ALLFLAGS % 16) = 1 then
- do
- ALLFLAGS = ALLFLAGS - 16
- FLAGSTRING=FLAGSTRING 'GROUP5'
- end
-
- if (ALLFLAGS % 8) = 1 then
- do
- ALLFLAGS = ALLFLAGS - 8
- FLAGSTRING=FLAGSTRING 'GROUP4'
- end
-
- if (ALLFLAGS % 4) = 1 then
- do
- ALLFLAGS = ALLFLAGS - 4
- FLAGSTRING=FLAGSTRING 'GROUP3'
- end
-
- if (ALLFLAGS % 2) = 1 then
- do
- ALLFLAGS = ALLFLAGS - 2
- FLAGSTRING=FLAGSTRING 'GROUP2'
- end
-
- if (ALLFLAGS % 1) = 1 then
- do
- ALLFLAGS = ALLFLAGS - 1
- FLAGSTRING=FLAGSTRING 'GROUP1'
- end
-
- ADDRESS 'DFA' 'NEW' 'SALUTATION='quote||ADMADDRESS.SALUTATION ADMADDRESS.COMPANY||quote 'NAME='quote||ADMADDRESS.LASTNAME||quote 'FIRST='quote||ADMADDRESS.FIRSTNAME||quote 'CO='quote||ADMADDRESS.ADDRESS2||quote 'STREET='quote||ADMADDRESS.ADDRESS1||quote 'ZIP='quote||ADMADDRESS.POSTCODE||quote 'CITY='quote||ADMADDRESS.CITY||quote 'BIRTHDAY='quote||ADMADDRESS.BIRTHDAY||quote 'PHONE='quote||ADMADDRESS.TELEPHONE||quote 'FAX='quote||ADMADDRESS.FAX||quote 'EMAIL1='quote||ADMADDRESS.EMAIL1||quote 'EMAIL2='quote||ADMADDRESS.EMAIL2||quote 'COMMENT='quote||ADMADDRESS.REMARK1 ADMADDRESS.REMARK2||quote FLAGSTRING
-
- /* --- ADM: Next entry ------------------------------------------ */
-
- ADDRESS 'ADM.1' ACTIVATENEXT
-
- END
-
- EXIT
-