TGet bug?

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

Post by Enrico Maria Giordano »

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:

Code: Select all

      elseif Empty( cText ) .or. RTrim( cText ) == "  /  /" .or. ;
         AllTrim( cText ) == "0" .or. ;
         RTrim( cText ) == "   -  -"
What do you think ?
Yes. Or just

Code: Select all

      elseif Empty( cText ) .or. cText = "  /  /" .or. ;
         AllTrim( cText ) == "0" .or. ;
         cText = "   -  -"
         ::nPos = 1
         ::SetPos( ::nPos )
EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

EnricoMaria wrote: Yes. Or just

Code: Select all

      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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Antonio Linares wrote:
EnricoMaria wrote: Yes. Or just

Code: Select all

      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
manuramos
Posts: 219
Joined: Mon Dec 26, 2005 7:25 pm
Location: Jerez de la Frontera (Spain)

Post by manuramos »

Could we use:?
if .... .OR. (::oGet:type == "D" .AND. (cText == "/ /" .OR. cText == "- -"))
Nos Gusta Programar
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Manu,

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

Antonio Linares
www.fivetechsoft.com
manuramos
Posts: 219
Joined: Mon Dec 26, 2005 7:25 pm
Location: Jerez de la Frontera (Spain)

Post by manuramos »

AND WHAT ABOUT ADD?
... .OR. (Valtype( ::Value ) = "D" .AND. (cText == "/ /" .OR. cText == "- -"))
Nos Gusta Programar
manuramos
Posts: 219
Joined: Mon Dec 26, 2005 7:25 pm
Location: Jerez de la Frontera (Spain)

Post by manuramos »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Manu,

Seguro que te entiende bien, gracias.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Antonio Linares wrote:Manu,

Seguro que te entiende bien, gracias.
Si, yo ho entiendido bastante (desculpame per mi espanol). :D

EMG
manuramos
Posts: 219
Joined: Mon Dec 26, 2005 7:25 pm
Location: Jerez de la Frontera (Spain)

Post by manuramos »

OK
UN SALUDO
Nos Gusta Programar
Post Reply