FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TGet bug?
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TGet bug?
Posted: Sun Feb 26, 2006 11:40 AM
Antonio Linares wrote:Enrico,

The problem is that if a PICTURE is used that has a "/" or a "-" in the front, then the code will be wrong, as ::nPos should not be set to 1.

This may be the right code:
      elseif Empty( cText ) .or. RTrim( cText ) == "  /  /" .or. ;
         AllTrim( cText ) == "0" .or. ;
         RTrim( cText ) == "   -  -"


What do you think ?


Yes. Or just

      elseif Empty( cText ) .or. cText = "  /  /" .or. ;
         AllTrim( cText ) == "0" .or. ;
         cText = "   -  -"
         ::nPos = 1
         ::SetPos( ::nPos )


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TGet bug?
Posted: Sun Feb 26, 2006 11:42 AM
EnricoMaria wrote:
Yes. Or just
      elseif Empty( cText ) .or. cText = "  /  /" .or. ;
         AllTrim( cText ) == "0" .or. ;
         cText = "   -  -"
         ::nPos = 1
         ::SetPos( ::nPos )



No, because if there are spaces after the last "/" or "-" then ::nPos will not be set to 1 as it should.

Edit: Or, you mean that because "=" just compare a portion. Anyhow, I prefeer to use RTrim() to notice what is done there.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TGet bug?
Posted: Sun Feb 26, 2006 11:45 AM
Antonio Linares wrote:
EnricoMaria wrote:
Yes. Or just
      elseif Empty( cText ) .or. cText = "  /  /" .or. ;
         AllTrim( cText ) == "0" .or. ;
         cText = "   -  -"
         ::nPos = 1
         ::SetPos( ::nPos )



No, because if there are spaces after the last "/" or "-" then ::nPos will not be set to 1 as it should.

Edit: Or, you mean that because "=" just compare a portion. Anyhow, I prefeer to use RTrim() to notice what is done there.


Ok.

EMG
Posts: 219
Joined: Mon Dec 26, 2005 07:25 PM
TGet bug?
Posted: Mon Feb 27, 2006 05:47 PM

Could we use:?
if .... .OR. (::oGet:type == "D" .AND. (cText == "/ /" .OR. cText == "- -"))

Nos Gusta Programar
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TGet bug?
Posted: Mon Feb 27, 2006 06:24 PM

Manu,

Este valor: " - -" no es para fechas. Suele usarse en números de teléfono internacionales.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 219
Joined: Mon Dec 26, 2005 07:25 PM
TGet bug?
Posted: Thu Mar 02, 2006 04:20 PM

AND WHAT ABOUT ADD?
... .OR. (Valtype( ::Value ) = "D" .AND. (cText == "/ /" .OR. cText == "- -"))

Nos Gusta Programar
Posts: 219
Joined: Mon Dec 26, 2005 07:25 PM
TGet bug?
Posted: Thu Mar 02, 2006 04:28 PM

Excuse me Enrico it's a bug.
perdona la repetición Antonio, creí que no había mandado ese texto, no leí la página 2.
De todas formas, yo lo utilizo para las fechas, pues hice algunas modificaciones para que el cursor se sitúe tras el último carácter de cada Get (no al final del todo) sólo cuando entro en él o al principio del todo si está vacio, y utilizo ese trozo de código.
Siento la confución, pensé que Enrico hablaba de fechas, no de carácteres. Te importaría traducirselo a él, pues mi inglés no dá para tanto y no quisiera que se mosquee por esta intrusión en castellano.

Nos Gusta Programar
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TGet bug?
Posted: Thu Mar 02, 2006 06:35 PM

Manu,

Seguro que te entiende bien, gracias.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
TGet bug?
Posted: Thu Mar 02, 2006 08:41 PM
Antonio Linares wrote:Manu,

Seguro que te entiende bien, gracias.


Si, yo ho entiendido bastante (desculpame per mi espanol). :-)

EMG
Posts: 219
Joined: Mon Dec 26, 2005 07:25 PM
TGet bug?
Posted: Thu Mar 02, 2006 09:00 PM

OK
UN SALUDO

Nos Gusta Programar

Continue the discussion