Changes between Initial Version and Version 1 of Documentation/ARexxAPI/MAILWRITE


Ignore:
Timestamp:
Sep 23, 2013 8:20:28 PM (11 months ago)
Author:
AmigaPhil
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/ARexxAPI/MAILWRITE

    v1 v1  
     1== MAILWRITE 
     2 
     3'''NAME''' 
     4     MailWrite -- Open a new Write window or activate one already opened. (V1.3) 
     5 
     6'''TEMPLATE''' 
     7     VAR/K,STEM/K,WINDOW/N,QUIET/S 
     8 
     9'''FUNCTION''' 
     10     Opens a Write window to compose a new mail or activates one already 
     11     opened. 
     12 
     13     Except when replying/forwarding/bouncing email where only one 
     14     Write window is used, MAILWRITE is needed before trying to edit 
     15     any part of a new message. 
     16 
     17'''INPUTS''' 
     18     VAR/K      - alternative variable to put the results into instead of RESULT  (V2.0)\\ 
     19     STEM/K     - base name used for the stem where the returned data will be stored  (V2.0)\\ 
     20     WINDOW/N   - change the command behavior to just activate an already opened Write window, may be 0 or 1 (or 2, to refer to an invisible Write window)\\ 
     21     QUIET/S    - force the window to stay invisible  (V2.1)\\ 
     22 
     23'''RETURNS''' 
     24     VAR          - info returned by the command\\ 
     25     <STEM>WINDOW - number of the created/activated window, may be 0 or 1 (or 2, if QUIET is enabled)\\ 
     26 
     27     RC is set to 5 if WINDOW is used with a value referring to an 
     28     inexistant window, or to 10 if the window cannot be opened, maybe 
     29     because the limit of two Write windows has been reached. 
     30 
     31'''NOTES''' 
     32     Window slots are dinamically assigned as they are required until 
     33     all of them are occupied, and remain in use until the relevant window 
     34     is closed (an "invisible" Write window is also "open" within this 
     35     context).  The optional WINDOW parameter sets the '''active''' Write window, 
     36     upon which the [[rx_writeattach| WRITEATTACH ]], [[rx_writebcc| WRITEBCC ]], [[rx_writecc| WRITECC ]], [[rx_writeeditor| WRITEEDITOR ]] 
     37     [[rx_writefrom| WRITEFROM ]], [[rx_writeletter| WRITELETTER ]], [[rx_writemailto| WRITEMAILTO ]], [[rx_writeoptions| WRITEOPTIONS ]], 
     38     [[rx_writequeue| WRITEQUEUE ]], [[rx_writereplyto| WRITEREPLYTO ]], [[rx_writesend| WRITESEND ]], [[rx_writesubject| WRITESUBJECT]], and 
     39     [[rx_writeto| WRITETO ]] commands will act when called, though strictly speaking 
     40     this is only necessary when at least two Write windows are opened 
     41     at the same time - in that case, "MAILWRITE WINDOW x" should be 
     42     called before using any of these commands to ensure they act on 
     43     the window they are supposed to. 
     44 
     45     Regardless, note that manually activating a Write window using the 
     46     GUI does '''not''' magically make it the target of the above mentioned 
     47     commands. 
     48 
     49'''EXAMPLE''' 
     50         /* Enable result codes */ 
     51 
     52         OPTIONS RESULTS 
     53 
     54         /* Start a new mail */ 
     55 
     56         MAILWRITE STEM st.\\ 
     57         win1 = st.window\\ 
     58 
     59         /* Start yet another mail */ 
     60 
     61         MAILWRITE STEM st.\\ 
     62         win2 = st.window\\ 
     63 
     64         /* Edit the first Write window */ 
     65 
     66         MAILWRITE WINDOW win1\\ 
     67         WRITETO boss@example.com\\ 
     68         'WRITESUBJECT "I don't think I can go to work today"'\\ 
     69         WRITELETTER 'work:excuses.txt'\\ 
     70 
     71         /* Edit the second Write window */ 
     72 
     73         MAILWRITE WINDOW win2\\ 
     74         WRITETO peggy@example.org\\ 
     75         'WRITESUBJECT "Stuffed at work, I'll be late"'\\ 
     76 
     77         /* Put the first email in the Outgoing queue */ 
     78 
     79         MAILWRITE WINDOW win1\\ 
     80         WRITEQUEUE\\ 
     81 
     82         /* Start a new email using an invisible Write window */ 
     83 
     84         MAILWRITE STEM st. QUIET\\ 
     85         win3 = st.window\\ 
     86         WRITETO sales@example.com\\ 
     87         'WRITESUBJECT "Two with Mozzarella + lots of coke"'\\ 
     88         WRITELETTER 'dh5:priv/Snail_Linda.txt'\\ 
     89 
     90         /* Finish editing the second email and send it at once */ 
     91 
     92         MAILWRITE WINDOW win2\\ 
     93         WRITESEND\\ 
     94 
     95         /* Send the third email */ 
     96 
     97         MAILWRITE WINDOW win3\\ 
     98         WRITEOPTIONS DELETE   /* avoid leaving any traces */\\ 
     99         WRITESEND\\ 
     100 
     101'''BUGS''' 
     102     MAILWRITE would throw Enforcer hits if YAM was iconified and the 
     103     external editor was configured to be launched immediately, or when 
     104     the QUIET switch was used; this was fixed in V2.3. 
     105 
     106'''SEE ALSO'''