Empty text variable in TGET

Empty text variable in TGET

Postby Natter » Fri May 26, 2023 10:24 am

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 view
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
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: Empty text variable in TGET

Postby nageswaragunupudi » Fri May 26, 2023 4:02 pm

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 view
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 view
  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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Empty text variable in TGET

Postby Natter » Fri May 26, 2023 4:30 pm

Thanks, I'll try! By the way, the Backspace is working incorrectly in TGET (for FWH 2210)
Natter
 
Posts: 1221
Joined: Mon May 14, 2007 9:49 am

Re: Empty text variable in TGET

Postby nageswaragunupudi » Sat May 27, 2023 9:41 am

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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 23 guests