[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

3108.0. "OA$MAIL_RESET_DRAWER function and MAIN drawer prob." by TINNIE::SETHI (It's not wise to have wisdom teeth) Thu Aug 05 1993 08:18

    Hi All,
    
    I have come across a strange problem with the OA$MAIL_SET_DRAWER and
    OA$MAIL_RESET_DRAWER functions.  The OA$MAIL_RESET_DRAWER does *not* reset
    the drawer and document context to that in effect prior to an 
    OA$MAIL_SET_DRAWER function call, if you are in the MAIN drawer.  The
    behaviour of the function is best described as "colourfully random" at
    times :-).
    
    One of the things I can reproduce at will is :
    
    1. select any folder in the MAIN DRAWER from the EM menu make sure you 
       have a number of folders and documents.
    
    2. run the script below
    
    .label start
    !
    oa$mail_set_drawer
    get oa$mail_drawer
    get oa$mail_drawer_location
    get #em_prvdwr
    get #em_old_curmes
    form oa$view_messages
    mail create/edit
    get #qm_dispose = oa$form_dispose
    .if #qm_dispose eqs "0" then .goto finnish
    oa$mail_reset_drawer
    get oa$mail_drawer
    get oa$mail_drawer_location
    get #em_prvdwr
    get #em_old_curmes
    form oa$view_messages
    .exit
    
    .label finnish
    
    mail close_message
    oa$mail_reset_drawer
    
    3. create a message than watch the current block also look at the
       value of #em_old_curmes.  Than do the same from the WP menu and examine
       the value of #em_old_curmes.
    
    What happens at times is that reset doesn't reset #EM_OLD_CURMES when
    the #EM_PRVDRW was current.  What I did was to select say the
    INTERNATIONAL DICTIONARIES folder than I did an exit from the EMHEAD
    menu.  When the OA$MAIL_RESET_DRAWER is called it set's the folder to
    the OUTBOX.
    
    The customer has stated that OA$MAIL_RESET_DRAWER sets it to any folder
    in the MAIN DRAWER, I must admit that I have not been able to reproduce
    this.  I know this isn't a bug reporting conference, if it could be
    unofficially/officially confirmed I will SPR this.
    
    OA$MAIL_RESET_DRAWER works fine if another drawer is selected. 
    
    Regards,
    
    Sunil
T.RTitleUserPersonal
Name
DateLines
3108.1Use CABINET SET_DRAWER insteadMAULS::REDMONDThoughts of an Idle MindThu Aug 05 1993 13:3613
OA$MAIL_SET_DRAWER and its brother, OA$MAIL_RESET_DRAWER, are "shorthand" 
functions intended to go and do something quickly in the mail subsystem. If 
you want to retain control over drawer context use the CABINET SET_DRAWER 
function.

	For example:

	GET #OLD_DRAWER = OA$CURDWR
	CABINET SET_DRAWER OA$MAIL_DRAWER
	Do some mail operations
	CABINET SET_DRAWER #OLD_DRAWER

Tony
3108.2Is it a misfeature ?TINNIE::SETHIIt's not wise to have wisdom teethFri Aug 06 1993 04:529
    Hi Tony, 
    
    Thanks for your workaround.  The customer feels there is a bug in the
    functions and they would like to raise an SPR, I shall do this on
    Monday, unless it's already been reported.
    
    Regards,
    
    Sunil 
3108.3SIOG::T_REDMONDThoughts of an Idle MindMon Aug 09 1993 14:598
    I don't think there is a bug.  The documented method for navigating
    within drawers is the CABINET SET_DRAWER function.  That's what the
    customer should be using if they want their code to survive into the
    future.  Using shortcode functions that are built for the convenience
    of people developing (in this case the electronic mail) subsystems is a
    bad idea...
    
    IMHO, T
3108.4A bug by any other name...SCOTTC::MARSHALLSpitfire Drivers Do It ToplessTue Aug 10 1993 16:507
re .3

It's probably a documentation bug, as the books don't make it clear that these
functions are 'shorthand' designed for specific purposes, and to be used by
people who know what they're doing!

Scott
3108.5Example please, so we can all be in "The Know" :-)TINNIE::SETHIChin wagging at DECUS on MAILworksWed Aug 11 1993 06:2933
    Hi Scott,
    
    I liked your reply mate :-).  Well it's a bit of a catch 22 situation
    in some way.
                    
    If it's not documented correctly in "The book" how are people ment to
    know if they are doing the coding correctly ? So they cannot possibly
    be in a position to becoming people in the know :-).  As you said "to
    be used by people who know what they're doing!".  I am just having a
    bit of a laugh.  I sound like Mr. Appleby in "Yes Prime minister" :-).
    
    Could you or someone give us an example of the correct use of these
    functions so we can become people in the know.  Having read the
    documentation they aren't doing what they are suppose to as far as the
    customer is concerned.
    
    Tony I read your reply and I do agree with you in that the CABINET
    functions are probably easier to use.  However, if these function
    become unsupported/taken out in the future I feel that may not be a
    good idea because we will have some unhappy customers.  Reminds me of
    the NEWDIR function when I was involved in tailoring ALL-IN-1 2.%, we
    were told it would become an unsupported function !!!!  
    
    Sorry I am not having a dig at anyone, but it seems to me that the
    documentation and the fuctionality do not match.  I cannot go to a
    customer and tell them that's how it works unless they are "in the
    know". I am sure you would agree it doesn't sound right.  An example and an
    explaination would be very helpfull, I would hate to CLD a call for a
    trivial documentation problem as the customer has voiced his concerns.
    
    Regards,
    
    Sunil
3108.6Use CABINET SET_DRAWER\SIOG::T_REDMONDThoughts of an Idle MindThu Aug 12 1993 17:0916
    As long as Digital insists on finishing documentation before products
    are frozen there are always going to be cases where the two don't
    match.  As long as there are software engineers there are going to be
    undocumented shortcuts.  For example, the Windows API...
    
    Customers should play safe and use documented functions.  I even say
    this about CABINET SET_DRAWER in my V3.0 book (page 168) when
    discussing the OA$MAIL_SET_DRAWER and OA$MAIL_RESET_DRAWER functions.
    There's an example of OA$MAIL_SET_DRAWER on the same page, but the
    caveat still applies.
    
    I guess if documentation was perfect all the time then people like me
    wouldn't get the chance to write books about some of the undocumented
    corners...
    
    Tony
3108.7BUSHIE::SETHIChin wagging at DECUS on MAILworksFri Aug 13 1993 05:0626
    Hi Tony, 
    
    Thanks for your advice as usual it was very helpful, I gave the
    customer the verbage from the book and he accpeted it.  I could
    not pursuade him to buy the book as he already had a copy.  The customer
    very casually said it must be Tony Redmond's book and accepted what I
    was saying :-).  I wish I could close my calls at the mention of my
    name :-).
    
    >Customers should play safe and use documented functions.
    
    The functions were documented !!!! Sorry I am just nit picking and
    having a bit of a laugh :-).
    
    I hope that you don't mind me quoting the botton line from your book so
    here it goes:
    
    "Do not use these functions when moving between nonmail drawers. Always
    use CABINET SET_DRAWER in case of doubt-or just to be sure.".
    
    And I'll add avoid them where ever possible the old trusted CABINET
    functions are robust.
    
    Thanks for your help and regards,
    
    Sunil
3108.8Circle closesSIOG::T_REDMONDThoughts of an Idle MindFri Aug 13 1993 11:489
    I'm glad the customer accepted the advice.  From a previous life
    (working in a support centre -- it seems so long ago now), I know that
    any and all weapons are useful when closing calls quickly. If my name
    (in any shape or form) helps to close a call then please don't hesitate
    to use it.  Kind of..... "if you don't accept my answer and close the
    call then the Redmond boogeyman will appear late and night and take
    you away to never-DSAB land...."
    
    Being happy, Tony