Get anomaly

Post Reply
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Get anomaly

Post by reds »

When entering data via gets in a Window the SETFOCUS seems to be ignored
if the variable is completely filled (not requiring an enter key) but works
OK when partially filled (requiring an enter key to continue)

It's the same result for character and numerical variables,adding SysRefresh didn't change it

Yet when using a Dialog it works fine !

What am I missing ?

Code: Select all

#include "FWCE.ch"
STATIC oGet[4]
function Main()
     
  local  cVar1 := cvar2 := cvar3 := cvar4 := space(4)

  local oDlg
  
   DEFINE WINDOW oDlg TITLE "get via window"
        
  @ 0,1 SAY "enter values" 
  
  @ 2,1 GET oGet[1]    VAR cVar1 OF oDlg        size 60,30

  @ 2,15 GET oGet[2]    VAR cVar2 OF oDlg                  UPDATE VALID  Reset(cVar2)     size 60,30

  @ 6,1 GET oGet[3]    VAR cVar3 OF oDlg                   UPDATE VALID  Reset(cVar3)     size 60,30 

  @ 6,15 GET oGet[4]    VAR cVar4 OF oDlg                  UPDATE VALID  Reset(cVar4)     size 60,30 
   
   @ 8, 2 BUTTON "End" ACTION oDlg:End() SIZE 80, 40

   ACTIVATE WINDOW oDlg   VALID MsgYesNo( "end ?" )
      
   Function Reset(var)

   oGet[1]:Setfocus()
SysRefresh()
   return .t.

 

Code: Select all

#include "FWCE.ch"
STATIC oGet[4]
function Main()
     
  local  cVar1 := cvar2 := cvar3 := cvar4 := space(4)
  local oDlg
  

   DEFINE DIALOG oDlg TITLE "get via dialog" SIZE 150,200     
   
  @ 0,1 SAY "enter values" 
  
  @ 3,1 GET oGet[1]    VAR cVar1 OF oDlg        size 20,10

  @ 3,5 GET oGet[2]    VAR cVar2 OF oDlg                  UPDATE VALID  Reset(cVar2)   size  20,10

  @ 4,1 GET oGet[3]    VAR cVar3 OF oDlg                   UPDATE VALID  Reset(cVar3)     size  20,10

  @ 4,5 GET oGet[4]    VAR cVar4 OF oDlg                  UPDATE VALID  Reset(cVar4)     size  20,10
   
   @ 4.5, 2 BUTTON "End" ACTION oDlg:End() SIZE 25, 15

   ACTIVATE DIALOG  oDlg  CENTERED  VALID MsgYesNo( "end ?" )
      
   Function Reset(var)

   oGet[1]:Setfocus()

   return .t.


 
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Get anomaly

Post by Antonio Linares »

Please try using:

SET CONFIRM ON | OFF
regards, saludos

Antonio Linares
www.fivetechsoft.com
reds
Posts: 50
Joined: Tue May 16, 2017 12:19 pm
Location: North London

Re: Get anomaly

Post by reds »

Thanks Antonio

I was hoping to avoid that to save user having to move cursor but it's not a big deal

Regards
Peter
Post Reply