Page 1 of 1

Problem with Browse

Posted: Fri Nov 06, 2009 2:47 pm
by Mario Mansilla
Hola :
Les envio un ejemplo simple en la cual se puede ver el comportamiento extraño del browse .
El problema es que el browse no se posiciona en el primer registro .
Esto sucede cuando la funcion Busca2_articulo() esta en el evento onchange del combo_2 . Sacando esta funcion del evento onchange o bien colocandola en el onenter el browse se posiciona correctamente .
Otro comportamiento extraño sucede en el textbox que muestra el precio . Cuando el precio es cero el textbox aparece en blanco salvo que el precio sea mayor a cero (0.00) .
Ahora bien una vez que el textbox muestra un precio superior a cero , a partir de alli muestra el cero correctamente .

No se si estoy cometiendo algun error o bien es un bug .
HMG 3.0

Saludos .
Mario Mansilla

Hi:
I sent a simple example which you can see the strange behavior of the browse.
The problem is that the browser no stand on the first record.
This happens when Busca2_articulo function () is in the onchange event of combo_2. Taking this function onchange event or placed on the OnEnter the browse is positioned correctly.
Another strange behavior happens in the textbox that shows the price. When the price is zero, the textbox is blank unless the price is greater than zero (0.00).
But once the textbox shows a price greater than zero, from zero shows correctly there.

Do not know if I'm doing something wrong or is it a bug.
HMG 3.0

Greetings.
Mario Mansilla

Re: Problem with Browse

Posted: Sat Nov 07, 2009 9:01 pm
by mol
Hola Mario!
I think Your problem lays in function:

Code: Select all

*--------------------------
Procedure Buscar2_Articulo()
*--------------------------

Posicion := Main.Combo_2.Value

Plu->(DbSeek(Strzero(Posicion,2)))

Main.Browse_1.Value := Recno()
Main.Browse_1.Refresh

Return
During init time, this function is called and searches Main.Combo_2.Value which is equal to 1 - so strzero(Posicion,2) gives "01" . This action moves Browse_1 pointer to record 010000 ASD

Re: Problem with Browse

Posted: Sat Nov 07, 2009 9:11 pm
by mol
Mario Mansilla wrote: Another strange behavior happens in the textbox that shows the price. When the price is zero, the textbox is blank unless the price is greater than zero (0.00).
But once the textbox shows a price greater than zero, from zero shows correctly there.
Mario Mansilla

I think you should define Main.Text_4.Value to 0.00 (or any other numeric value, eg. 100.11) to initialize this control.

Besides, it's interesting, why numeric fields need initialization.

(I think, Roberto can answer it....)

Best regards, Marek

Re: Problem with Browse

Posted: Sat Nov 07, 2009 10:16 pm
by Roberto Lopez
mol wrote:
Mario Mansilla wrote: Another strange behavior happens in the textbox that shows the price. When the price is zero, the textbox is blank unless the price is greater than zero (0.00).
But once the textbox shows a price greater than zero, from zero shows correctly there.
Mario Mansilla

I think you should define Main.Text_4.Value to 0.00 (or any other numeric value, eg. 100.11) to initialize this control.

Besides, it's interesting, why numeric fields need initialization.

(I think, Roberto can answer it....)

Best regards, Marek
I must to test deeply to give an opinion and I had not enough time to do it yet.

Re: Problem with Browse

Posted: Sun Nov 08, 2009 7:18 am
by mol
It's good this problem is localized and the solution is easy - it's enough to define value and everything works OK.

Re: Problem with Browse

Posted: Sun Nov 08, 2009 1:35 pm
by Mario Mansilla
Hola Mol :
Muchas gracias por tu ayuda , no comprendia que ocurria , no evalue lo que ocurria en el instante inicial .
Lo solucione modificando la funcion para que solo se ejecute cuando la busqueda sea por ese item .

En cuanto al TextBox numerico inicializare los valores con cero .

Saludos cordiales
Mario Mansilla


Hello Mol:
Thank you very much for your help, did not understand that does not assess what happened in the initial instant.
I solved by changing the function to only run when the search is for that item.

As for the TextBox inicializare numeric values with zero.

Best regards
Mario Mansilla

*--------------------------
Procedure Buscar2_Articulo()
*--------------------------

If Main.Combo_1.Value = 2
Posicion := Main.Combo_2.Value

Plu->(DbSeek(Strzero(Posicion,2)))

Main.Browse_1.Value := Recno()
Main.Browse_1.Refresh
Endif

Return