× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.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@xxxxxxxxxxxxx


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.