Page 1 of 1
Which variable contains the entered data in combobox?
Posted: Mon Feb 13, 2006 9:16 am
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 | Expand
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
Re: Which variable contains the entered data in combobox?
Posted: Mon Feb 13, 2006 9:33 am
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 | Expand
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 | Expand
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
Posted: Mon Feb 13, 2006 10:20 am
by Marc Vanzegbroeck
Enrico,
Here is an example.
http://www.vms.be/FWTest/combotst.zipAs you can see, the previous entered data is displayed..
Marc
Posted: Mon Feb 13, 2006 1:11 pm
by Enrico Maria Giordano
This is a sample. But you have to handle control keys:
Code: Select all | Expand
#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
Posted: Mon Feb 13, 2006 1:44 pm
by Marc Vanzegbroeck
Thanks Enrico,
This is what I want.
Marc