Which variable contains the entered data in combobox?

Post Reply
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Which variable contains the entered data in combobox?

Post by Marc Vanzegbroeck »

Hello,

Can anyone tell me the variable with the entered data in combobox?
If I use something like this:

Code: Select all

REDEFINE COMBOBOX vGetlist[16] VAR vpara[ 1] ITEMS vparameters ID 201 OF oDlg picture '@!' STYLE CBS_DROPDOWN ON EDIT CHANGE tpsgpar(vGetlist[16]:oGet:ctext)

func tpsgpar(vpara)
   msginfo(vpara)
return nil
I allways see the previous entered data and NOT the last entered character

Thanks,
Marc
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Which variable contains the entered data in combobox?

Post by Enrico Maria Giordano »

Marc Vanzegbroeck wrote:Hello,

Can anyone tell me the variable with the entered data in combobox?
If I use something like this:

Code: Select all

REDEFINE COMBOBOX vGetlist[16] VAR vpara[ 1] ITEMS vparameters ID 201 OF oDlg picture '@!' STYLE CBS_DROPDOWN ON EDIT CHANGE tpsgpar(vGetlist[16]:oGet:ctext)

func tpsgpar(vpara)
   msginfo(vpara)
return nil
I allways see the previous entered data and NOT the last entered character

Thanks,
Marc
Try

Code: Select all

ON EDIT CHANGE ( vGetlist[16]:oGet:Assign(), tpsgpar(vGetlist[16]:oGet:ctext) )
If this doesn't help then please post a reduced and self-contained sample showing the problem.

EMG
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post by Marc Vanzegbroeck »

Enrico,

Here is an example.

http://www.vms.be/FWTest/combotst.zip
As you can see, the previous entered data is displayed.. :cry:

Marc
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

This is a sample. But you have to handle control keys:

Code: Select all

#INCLUDE "fivewin.CH"
FUNCTION test()
   local oDlg, oFld
   local vgetlist:=array(79)
   local vparameters := haalallpar()
   local vpara := array(10)
   vpara[1] = space(10)

   DEFINE DIALOG oDlg RESOURCE "TPSQUERY"

   REDEFINE COMBOBOX vGetlist[16] VAR vpara[ 1];
            ITEMS vparameters;
            ID 201 OF oDlg;
            picture '@!';
            STYLE CBS_DROPDOWN

   vGetlist[16]:oGet:bChange = { | nKey | tpsgpar( RTrim( vGetlist[16]:VarGet() ) + CHR( nKey ) ) }

   ACTIVATE DIALOG oDlg CENTERED ON RIGHT CLICK oDlg:end()
RETURN nil

FUNCTION haalallpar()
   local ret_val := {}
   aadd(ret_val,'NAME'   )
   aadd(ret_val,'PTDESC' )
   aadd(ret_val,'KEYWORD')
   aadd(ret_val,'EUDESC' )
   aadd(ret_val,'UNIT'   )
   aadd(ret_val,'NODENUM')
   aadd(ret_val,'MODNUM' )
RETURN ret_val


func tpsgpar(vpara)
   msginfo(vpara)
return nil
EMG
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post by Marc Vanzegbroeck »

Thanks Enrico,

This is what I want.

Marc
Post Reply