Page 2 of 2

PostPosted: Sun Feb 26, 2006 11:40 am
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  Expand view
      elseif Empty( cText ) .or. RTrim( cText ) == "  /  /" .or. ;
         AllTrim( cText ) == "0" .or. ;
         RTrim( cText ) == "   -  -"


What do you think ?


Yes. Or just

Code: Select all  Expand view
      elseif Empty( cText ) .or. cText = "  /  /" .or. ;
         AllTrim( cText ) == "0" .or. ;
         cText = "   -  -"
         ::nPos = 1
         ::SetPos( ::nPos )


EMG

PostPosted: Sun Feb 26, 2006 11:42 am
by Antonio Linares
EnricoMaria wrote:Yes. Or just
Code: Select all  Expand view
      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.

PostPosted: Sun Feb 26, 2006 11:45 am
by Enrico Maria Giordano
Antonio Linares wrote:
EnricoMaria wrote:Yes. Or just
Code: Select all  Expand view
      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

PostPosted: Mon Feb 27, 2006 5:47 pm
by manuramos
Could we use:?
if .... .OR. (::oGet:type == "D" .AND. (cText == "/ /" .OR. cText == "- -"))

PostPosted: Mon Feb 27, 2006 6:24 pm
by Antonio Linares
Manu,

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

PostPosted: Thu Mar 02, 2006 4:20 pm
by manuramos
AND WHAT ABOUT ADD?
... .OR. (Valtype( ::Value ) = "D" .AND. (cText == "/ /" .OR. cText == "- -"))

PostPosted: Thu Mar 02, 2006 4:28 pm
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.

PostPosted: Thu Mar 02, 2006 6:35 pm
by Antonio Linares
Manu,

Seguro que te entiende bien, gracias.

PostPosted: Thu Mar 02, 2006 8:41 pm
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

PostPosted: Thu Mar 02, 2006 9:00 pm
by manuramos
OK
UN SALUDO