Empty text variable in TGET

Post Reply
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Empty text variable in TGET

Post by Natter »

Hi,

Is it possible to make it possible to enter text into an empty text variable in TGET (a la Excel)

Code: Select all | Expand

function Main()
local oDlg, [b]cText := ""[/b]

  DEFINE DIALOG oDlg   FROM 2, 2 TO 20, 50    TITLE "Example"
     TGet():New( 2, 2, bSETGET( cText ), oDlg, 100,,   [b]replicate("X",10)[/b] )
  ACTIVATE DIALOG oDlg CENTERED
return
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Empty text variable in TGET

Post by nageswaragunupudi »

We advise you to use Edit control, which is very similar to Get control. Edit control allows input of variable length.

Code: Select all | Expand

 cVar2 := ""
  @  60,20 EDIT oEdit VAR cVar2 SIZE 200,20 PIXEL OF oDlg
 
In case of Unicode applications, (when FW_SetUnicode( .t. )), we can use Get control also with the clause "VARCHAR n"

Code: Select all | Expand

   local oDlg, oGet, oEdit
   local cVar1 := ""
   local cVar2 := ""

   FW_SetUnicode( .F. )

   DEFINE DIALOG oDlg SIZE 300,300 PIXEL TRUEPIXEL

   @  20,20 GET oGet VAR cVar1 SIZE 200,20 PIXEL OF oDlg ;
      VARCHAR 20

   @  60,20 EDIT oEdit VAR cVar2 SIZE 200,20 PIXEL OF oDlg

   @ 100,20 BUTTON "CHECK" SIZE 100,40 PIXEL OF oDlg ;
      ACTION MsgInfo( "|" + cVar1 + "|" + CRLF + "|" + cVar2 + "|" )

   ACTIVATE DIALOG oDlg CENTERED
 
For ANSI applications, it is a good idea to use EDIT control
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Empty text variable in TGET

Post by Natter »

Thanks, I'll try! By the way, the Backspace is working incorrectly in TGET (for FWH 2210)
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Empty text variable in TGET

Post by nageswaragunupudi »

Natter wrote:Thanks, I'll try! By the way, the Backspace is working incorrectly in TGET (for FWH 2210)
Can you please explain this more clearly to help us to locate the problem, if any?
Regards

G. N. Rao.
Hyderabad, India
Post Reply