How to achieve unlimited text size in Get?

Post Reply
User avatar
gkuhnert
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands
Contact:

How to achieve unlimited text size in Get?

Post by gkuhnert »

Hi,

maybe I'm doing something wrong, but the method :LimitText() doesn't work in my example:

Code: Select all

#include "FiveWin.ch"

function main()
   local oWnd
   local oGet, cGet := "How to use unlimited length in this get?"

   DEFINE WINDOW oWnd TITLE "Test unlimited Get"
        @  2,1 GET oGet VAR cGet OF oWnd SIZE 300,24 UPDATE
   ACTIVATE WINDOW oWnd ON INIT (oGet:LimitText())

RETURN NIL
 
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands
Contact:

Re: How to achieve unlimited text size in Get?

Post by gkuhnert »

Enrico,

thanks for your answer. But I wonder for what purpose this method in tget exists then:

Code: Select all

   // Call this method to use unlimited text size
   METHOD LimitText() INLINE SendMessage( ::hWnd, EM_LIMITTEXT, 0, 0 )
 
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: How to achieve unlimited text size in Get?

Post by nageswaragunupudi »

This is the documentation of EM_LIMITTEXT from MSDN
Specifies the maximum number of characters the user can enter. If this parameter is zero, the text length is set to 0x7FFE (32,766) characters for single-line edit controls or 0xFFFF (65,535) characters for multiline edit controls. If this parameter is not zero, the maximum text length is 0x7FFE characters for single-line edit controls or 0x7FFFFFFE characters for multiline edit controls. These limits differ from the limits for Windows-based desktop platforms.
But in the case of Get in FWH, the (x)Harbour;s GET control limits the text to the length of the variable. Best way to enter longer text in single line GET of (x)Harbour is to Pad the variable with blanks to a large size and then trim the result after get. For obvious reasons, EM_LIMITTEXT is not useful in our environment.
Regards

G. N. Rao.
Hyderabad, India
Post Reply