Problem to Validate a data

Problem to Validate a data

Postby Silvio.Falconi » Wed May 22, 2019 8:21 am

on my app I dont use Dtpicker but two get ad you can see on picture

Image

and I use the XBrDtPicker of Rao to select a adate
as you can see I have problem to validate the get

Code: Select all  Expand view  RUN


 @ 23,144 GET aGet[4] VAR dDataFinale SIZE 120,14 PIXEL OF oFld:aDialogs[1] ;
    BITMAP  ".\bitmaps\cal.bmp" ;
    ACTION (dDataFinale:=XBrDtPicker(Conv_Textdate(dDataFinale,3) , "Seleziona una  data",0.1,,aGet[4] ),;
    IIF( dDataFinale=ctod(""),;
               aGet[4]:cText( "Selezionare una data"),;
               aGet[4]:cText(Convertidata(dDataFinale))),;
           aGet[4]:refresh(),;
           nGiorni:=(Conv_Textdate(dDataFinale,3)-Conv_Textdate(dDataIniziale,3) ),;
            oSay[1]:settext(str(nGiorni)),;
            oSay[1]:refresh(),;
            oSay[2]:refresh()) VALID ValidareData( Conv_Textdate(dDataIniziale,3), Conv_Textdate(dDataFinale,3) )


 




the conv_textDate is function to converte string date to date format made from Uwe on another post

Code: Select all  Expand view  RUN

FUNCTION ValidareData( dFechaIni, dFechaFin )
   IF ( dFechaIni > dFechaFin )
      alert( "La data finale deve essere  maggiore di quella finale " )
      RETURN( .F. )
   ENDIF
   RETURN( .T. )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7074
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem to Validate a data

Postby armando.lagunas » Wed May 22, 2019 12:53 pm

devuelve el valor .t. o .f. desde una variable local

Code: Select all  Expand view  RUN

FUNCTION ValidareData( dFechaIni, dFechaFin )
   IF ( dFechaIni > dFechaFin )
      alert( "La data finale deve essere  maggiore di quella finale " )
      RETURN( .F. )
   ENDIF
   RETURN( .T. )   <---- aqui el problema
 


solución:

Code: Select all  Expand view  RUN

FUNCTION ValidareData( dFechaIni, dFechaFin )
   LOCAL lValid := .T.

   IF ( dFechaIni > dFechaFin )
      alert( "La data finale deve essere  maggiore di quella finale " )
      lValid := .F.
   ENDIF
   RETURN  lValid
 
SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile

Re: Problem to Validate a data

Postby Silvio.Falconi » Wed May 22, 2019 3:48 pm

thanks
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7074
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem to Validate a data

Postby Enrico Maria Giordano » Thu May 23, 2019 7:25 am

[quote="armando.lagunas"]
Code: Select all  Expand view  RUN

   RETURN( .T. )   <---- aqui el problema


No problem here. It's a perfectly legal code.

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 35 guests