TGet bug?

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

Postby Antonio Linares » Sun Feb 26, 2006 11:42 am

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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Sun Feb 26, 2006 11:45 am

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

Postby manuramos » Mon Feb 27, 2006 5:47 pm

Could we use:?
if .... .OR. (::oGet:type == "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)

Postby Antonio Linares » Mon Feb 27, 2006 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby manuramos » Thu Mar 02, 2006 4:20 pm

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)

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

Postby Antonio Linares » Thu Mar 02, 2006 6:35 pm

Manu,

Seguro que te entiende bien, gracias.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Thu Mar 02, 2006 8:41 pm

Antonio Linares wrote:Manu,

Seguro que te entiende bien, gracias.


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

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

Postby manuramos » Thu Mar 02, 2006 9:00 pm

OK
UN SALUDO
Nos Gusta Programar
manuramos
 
Posts: 219
Joined: Mon Dec 26, 2005 7:25 pm
Location: Jerez de la Frontera (Spain)

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 65 guests