Clearing a Multi-Line Edit with the Cursor in the MLE

"Kurt Anderson" <kjanderson-GsknM9TLYgm1Z/[email protected]> Wed, 1 Aug 2007 16:19:24 -0500
Newsgroups gmane.comp.systems.as400.code
Message-ID <89C301922C81C24D866BF970E48B00C201251C24@HSMAIL01.highsmithnet.com>
I have some code where a user can enter a customer number.  When the
field loses focus, the multi-line edit field below is cleared and then
loaded with the address.  This has been working great, until, in a demo
of course, the focus was on the customer number field, and then I
clicked on the multi-line edit that displays that customer's address.
When I did that, it failed to clear the multi-line edit, but didn't
result in error, so the address loaded was appended to the existing
address.  In debug, I saw that after the Delete attribute was set to 1,
the text was still in the MLE.
 
I tried to move the focus off the MLE, thinking that was the issue with
the Delete, but the focus did not seem to go anywhere.  This code is
being executing during the LostFocus event.
 
Here's the clearing code.  Again, this code works in every program I
have an MLE.  This is the first time I've ever tried to clear the MLE
while the MLE had focus.
 
     D False           C                   0
     D True            C                   1
     D TextLength      S              3p 0
 
       //  Clear the Address.
       %setatr( %window: mlePart: 'READONLY' ) = False;
       %setatr( %window: mlePart: 'TEXTSTART' ) = 1;
       TextLength =  %getAtr( %window: mlePart: 'TEXTLENGTH' );
       %setatr( %window: mlePart: 'TEXTEND' ) = TextLength;
       %setatr( %window: mlePart: 'DELETE' ) = True;
       %setatr( %window: mlePart: 'READONLY' ) = True;
 
Any ideas?
 
Kurt Anderson
Application Developer
Highsmith Inc.
W5527 State Road 106, P.O. Box 800
Fort Atkinson, WI 53538-0800
TEL (920) 563-9571  FAX (920) 563-7395
EMAIL kjanderson-GsknM9TLYgm1Z/[email protected]
 
_______________________________________________
This is the CODE/400 Discussion &amp; Support (CODE400-L) mailing list
To post a message email: CODE400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/code400-l
or email: CODE400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/code400-l.

NOTE: WDSc for iSeries discussion has it's own mailing list.
Information can be found at http://lists.midrange.com/cgi-bin/listinfo/wdsci-l