DC_VarToListBox function sets my PC Slow

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
digitsoft
Posts: 461
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

DC_VarToListBox function sets my PC Slow

#1 Post by digitsoft »

Hi Roger
DC_VarToListBox function sets my PC Slow

Paulino Nolberto
A cordial greeting
Nolberto Paulino
Regards

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: DC_VarToListBox function sets my PC Slow

#2 Post by Auge_Ohr »

digitsoft wrote:DC_VarToListBox function sets my PC Slow
how big is you Array ;)
hide Listbox when "fill" will speed up a lot.
greetings by OHR
Jimmy

User avatar
digitsoft
Posts: 461
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: DC_VarToListBox function sets my PC Slow

#3 Post by digitsoft »

Auge_Ohr wrote:
digitsoft wrote:DC_VarToListBox function sets my PC Slow
how big is you Array ;)
hide Listbox when "fill" will speed up a lot.
Hi Jimmy
It is an array of 10 Items to Maximo
The slow when I give presents him several times to load the DCCOMBOBOX Array

Paulino Nolberto
Regards
Nolberto Paulino
Regards

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_VarToListBox function sets my PC Slow

#4 Post by rdonnay »

I looked at the code and there is nothing there that looks unusual.
This may be a behavior of the XbpComboBox.
I have seen other problems with that class in the past.
It didn't generate events correctly.

Code: Select all

FUNCTION DC_VarToListBox( oXbp, aVar, aMarked )

LOCAL bVar, aArray, i, oListBox, aArrayLeft, aArrayRight

IF oXbp:isDerivedFrom('XbpComboBox')
  oListBox := oXbp:XbpListBox
ELSEIF oXbp:isDerivedFrom('XbpListBox')
  oListBox := oXbp
ELSEIF oXbp:isDerivedFrom('DC_XbpPickList')
  oXbp:leftListBox:clear()
  oListBox := oXbp:leftListBox
  IF Valtype(aVar) = 'A'
    aArrayLeft := aVar
  ELSE
    bVar := oXbp:leftAnchor
    aArrayLeft := Eval(bVar)
  ENDIF
  oXbp:rightListBox:clear()
  oListBox := oXbp:rightListBox
  IF Valtype(aMarked) = 'A'
    aArrayRight := aMarked
  ELSE
    bVar := oXbp:dataLink
    aArrayRight := Eval(bVar)
  ENDIF
  oXbp:SetData(aArrayLeft,aArrayRight)
  RETURN nil
ELSE
  RETURN nil
ENDIF
oListBox:clear()
IF Valtype(aVar) = 'A'
   aArray := aVar
ELSE
  bVar := oXbp:listBlock
  aArray := Eval(bVar)
ENDIF
IF Valtype(aArray) = 'A'
  FOR i := 1 TO LEN(aArray)
    oListBox:Additem(aArray[i])
  NEXT
  IF oXbp:isDerivedFrom('XbpPickList')
    oXbp:SetData(aArray)
  ELSEIF Valtype(aMarked) = 'A' // Preset the list
    oListBox:setData(aMarked, .T.)
    DC_VarFromListBox(oXbp)
  ENDIF
ENDIF

RETURN nil
The eXpress train is coming - and it has more cars.

User avatar
digitsoft
Posts: 461
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: DC_VarToListBox function sets my PC Slow

#5 Post by digitsoft »

Thanks Roger
I check the code and when it reaches this line oListBox: clear ()
remains firzado

if the annulus using *** oListBox: clear () on the line the combo box
limpra not the array but is not frizzy.

Paulino Nolberto
Best Regards
rdonnay wrote:I looked at the code and there is nothing there that looks unusual.
This may be a behavior of the XbpComboBox.
I have seen other problems with that class in the past.
It didn't generate events correctly.

Code: Select all

FUNCTION DC_VarToListBox( oXbp, aVar, aMarked )

LOCAL bVar, aArray, i, oListBox, aArrayLeft, aArrayRight

IF oXbp:isDerivedFrom('XbpComboBox')
  oListBox := oXbp:XbpListBox
ELSEIF oXbp:isDerivedFrom('XbpListBox')
  oListBox := oXbp
ELSEIF oXbp:isDerivedFrom('DC_XbpPickList')
  oXbp:leftListBox:clear()
  oListBox := oXbp:leftListBox
  IF Valtype(aVar) = 'A'
    aArrayLeft := aVar
  ELSE
    bVar := oXbp:leftAnchor
    aArrayLeft := Eval(bVar)
  ENDIF
  oXbp:rightListBox:clear()
  oListBox := oXbp:rightListBox
  IF Valtype(aMarked) = 'A'
    aArrayRight := aMarked
  ELSE
    bVar := oXbp:dataLink
    aArrayRight := Eval(bVar)
  ENDIF
  oXbp:SetData(aArrayLeft,aArrayRight)
  RETURN nil
ELSE
  RETURN nil
ENDIF
oListBox:clear()
IF Valtype(aVar) = 'A'
   aArray := aVar
ELSE
  bVar := oXbp:listBlock
  aArray := Eval(bVar)
ENDIF
IF Valtype(aArray) = 'A'
  FOR i := 1 TO LEN(aArray)
    oListBox:Additem(aArray[i])
  NEXT
  IF oXbp:isDerivedFrom('XbpPickList')
    oXbp:SetData(aArray)
  ELSEIF Valtype(aMarked) = 'A' // Preset the list
    oListBox:setData(aMarked, .T.)
    DC_VarFromListBox(oXbp)
  ENDIF
ENDIF

RETURN nil
Nolberto Paulino
Regards

User avatar
digitsoft
Posts: 461
Joined: Thu Jan 28, 2010 1:33 pm
Location: Republica Dominicana
Contact:

Re: DC_VarToListBox function sets my PC Slow

#6 Post by digitsoft »

Hi Roger
The problem was not the COMBOBOX Table or Database had a register in Blanc and the system to stay Very Slow

Thanks for your help
Paulino Nolberto
Regards
Nolberto Paulino
Regards

Post Reply