updating an archive

updating an archive

Postby Silvio.Falconi » Mon Nov 14, 2022 12:31 pm

I have to update a archive on each Tuesday, Thursday, Saturday
I check the database and check if today is major of date of last record of archive
I not understood why it return me allways false
even if for example the date of the last record is equal to the number of today's day
example
archive date 12.11.2022 nday 6
date today saturday nday 6

How I can resolve ?
Code: Select all  Expand view
Function CheckEstrazione()
   local oDbf
   local dDataEstrazione
   local lOld:=.t.
   local oTimer

   local nTuesday: = 2
    Local nThursday: = 4
    local nSaturday: = 6
 

   local nDayarchive,nDaytoday

   oDbf:= TDatabase():Open( , "LOTTO", "DBFCDX", .T. )
   oDbf:setorder(1)  //data
   oDbf:GoBottom()

   dDataEstrazione:= oDbf:data
   oDbf:close()

   nDayarchive := DOW((dDataEstrazione)-1)
   nDaytoday   := DOW( date() -1  )


   IF nDaytoday = nTuesday
      lOld:=.t.
      IF nDayarchive < nDayToday
          lOld:=.f.
      Endif
   Endif

   IF nDaytoday = nThursday
      lOld:=.t.
       IF nDayarchive < nDayToday
          lOld:=.f.
      Endif
    Endif

    IF nDaytoday = nSaturday
       lOld:=.t.
       IF nDayarchive < nDayToday
          lOld:=.f.
      Endif
    Endif
   ?  lOld
  return lOld
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: updating an archive

Postby Jimmy » Mon Nov 14, 2022 1:25 pm

hi Silvo,

why do you "just" use DOW() and not DTOS() which give you "more" Information
you can ad "more" to DTOS() like Postcode of City to compare (use Number)
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: updating an archive

Postby Silvio.Falconi » Mon Nov 14, 2022 5:50 pm

Jimmy wrote:hi Silvo,

why do you "just" use DOW() and not DTOS() which give you "more" Information
you can ad "more" to DTOS() like Postcode of City to compare (use Number)



lottery drawings in Italy are drawn every week and precisely on Tuesdays, Thursdays and Saturdays

when the application is opened, the procedure must notify the end user that the archive is updated or not

to do this I had thought of checking the date of the last extraction in the archive and comparing it with the date of the day in which the application is opened (ie with the system date).

so I had thought of comparing the various days:

Tuesday day 2 of the week
Thursday day 4 of the week
Saturday day 6 of the week

for example to make you understand the mechanism:

last draw in archive 12.11.2022 is a Saturday
if I did the check today 14.11.2022 (Monday day 1 of the week) the procedure should not return the value false because the archive would be updated because the only valid date would be 12.11.2022 (Saturday) and the next valid date would still be tomorrow 15.11.2022 (Tuesday 2nd day of the week)


how could I translate this with a simple function?
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: updating an archive

Postby karinha » Mon Nov 14, 2022 8:17 pm

Mira se ayuda para crear algo mejor.

Code: Select all  Expand view

// C:\FWH\SAMPLES\SILOTTO.PRG - kapiabafwh@gmail.com

#Include "FiveWin.ch"

STATIC oDlg, oFont
STATIC lActualiza := .F.

FUNCTION Main()

   LOCAL oGet1, oGet2, oGet3
   LOCAL oBtnX2, cTitle, aGrad, oSay1, oBtn, oActualiza
   LOCAL DtSorteo, DtConsulta, DtproxCons

   SET CENTURY ON
   SET DATE BRITISH
   SET EPOCH TO YEAR( DATE() ) - 30

   cTitle     := "último sorteo de Lotto"
   DtSorteo   := CTOD( "12/11/2022" )
   DtConsulta := CTOD( "14/11/2022" )
   DtProxCons := CTOD( "15/11/2022" )

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14

   DEFINE DIALOG oDlg SIZE 600, 200  PIXEL TRUEPIXEL RESIZABLE  ;
      TITLE cTitle COLOR CLR_BLACK, CLR_WHITE TRANSPARENT FONT oFont

   oDlg:lHelpIcon := .F.

   @ 12, 10 SAY oSay1 PROMPT "último sorteo en archivo:" SIZE 200, 16 PIXEL ;
      OF oDlg FONT oFont UPDATE

   @ 32, 10 GET oGet1 VAR DtSorteo SIZE 100, 24 PIXEL OF oDlg FONT oFont ;
      PICTURE "@D 99/99/9999" CENTER // VALID( ES_UN_SABADO( DtSorteo, oActualiza ) )

   @ 60, 10 SAY oSay1 PROMPT "Fecha(Date) de consulta:" SIZE 200, 16 PIXEL ;
      OF oDlg FONT oFont UPDATE

   @ 80, 10 GET oGet2 VAR DtConsulta SIZE 100, 24 PIXEL OF oDlg FONT oFont ;
      PICTURE "@D 99/99/9999" CENTER VALID( ES_UN_SABADO( DtSorteo, oActualiza ) )

   @ 106, 10 SAY oSay1 PROMPT "Fecha(Date) Proxima consulta:" SIZE 200, 16 PIXEL ;
      OF oDlg FONT oFont UPDATE

   @ 128, 10 GET oGet3 VAR DtProxCons SIZE 100, 24 PIXEL OF oDlg FONT oFont ;
      PICTURE "@D 99/99/9999" CENTER

   @ 050, 500 BUTTON oActualiza PROMPT 'Actualiza' SIZE 80, 50 PIXEL OF oDlg ;
      ACTION( ACTUALIZA_LOTTO() ) WHEN( lActualiza )

   @ 120, 500 BUTTON 'Close' SIZE 80, 50 PIXEL OF oDlg ACTION( oDlg:End() )  ;
      CANCEL

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE oFont

RETURN NIL

FUNCTION ES_UN_SABADO( cDate, oActualiza )

   // TU CONDICION(es) DE DIA O FECHA(Date).
   IF CDOW( cDate ) = "Saturday" .OR. ;
      CDOW( cDate ) = "Tuesday"

      lActualiza := .T.

      RETURN( .T. )

   ENDIF

RETURN( .F. )

FUNCTION ACTUALIZA_LOTTO()

RETURN NIL
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7766
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: updating an archive

Postby Silvio.Falconi » Tue Nov 15, 2022 10:57 am

karinha wrote:Mira se ayuda para crear algo mejor.

Code: Select all  Expand view

// C:\FWH\SAMPLES\SILOTTO.PRG - kapiabafwh@gmail.com

#Include "FiveWin.ch"

STATIC oDlg, oFont
STATIC lActualiza := .F.

FUNCTION Main()

   LOCAL oGet1, oGet2, oGet3
   LOCAL oBtnX2, cTitle, aGrad, oSay1, oBtn, oActualiza
   LOCAL DtSorteo, DtConsulta, DtproxCons

   SET CENTURY ON
   SET DATE BRITISH
   SET EPOCH TO YEAR( DATE() ) - 30

   cTitle     := "último sorteo de Lotto"
   DtSorteo   := CTOD( "12/11/2022" )
   DtConsulta := CTOD( "14/11/2022" )
   DtProxCons := CTOD( "15/11/2022" )

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14

   DEFINE DIALOG oDlg SIZE 600, 200  PIXEL TRUEPIXEL RESIZABLE  ;
      TITLE cTitle COLOR CLR_BLACK, CLR_WHITE TRANSPARENT FONT oFont

   oDlg:lHelpIcon := .F.

   @ 12, 10 SAY oSay1 PROMPT "último sorteo en archivo:" SIZE 200, 16 PIXEL ;
      OF oDlg FONT oFont UPDATE

   @ 32, 10 GET oGet1 VAR DtSorteo SIZE 100, 24 PIXEL OF oDlg FONT oFont ;
      PICTURE "@D 99/99/9999" CENTER // VALID( ES_UN_SABADO( DtSorteo, oActualiza ) )

   @ 60, 10 SAY oSay1 PROMPT "Fecha(Date) de consulta:" SIZE 200, 16 PIXEL ;
      OF oDlg FONT oFont UPDATE

   @ 80, 10 GET oGet2 VAR DtConsulta SIZE 100, 24 PIXEL OF oDlg FONT oFont ;
      PICTURE "@D 99/99/9999" CENTER VALID( ES_UN_SABADO( DtSorteo, oActualiza ) )

   @ 106, 10 SAY oSay1 PROMPT "Fecha(Date) Proxima consulta:" SIZE 200, 16 PIXEL ;
      OF oDlg FONT oFont UPDATE

   @ 128, 10 GET oGet3 VAR DtProxCons SIZE 100, 24 PIXEL OF oDlg FONT oFont ;
      PICTURE "@D 99/99/9999" CENTER

   @ 050, 500 BUTTON oActualiza PROMPT 'Actualiza' SIZE 80, 50 PIXEL OF oDlg ;
      ACTION( ACTUALIZA_LOTTO() ) WHEN( lActualiza )

   @ 120, 500 BUTTON 'Close' SIZE 80, 50 PIXEL OF oDlg ACTION( oDlg:End() )  ;
      CANCEL

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE oFont

RETURN NIL

FUNCTION ES_UN_SABADO( cDate, oActualiza )

   // TU CONDICION(es) DE DIA O FECHA(Date).
   IF CDOW( cDate ) = "Saturday" .OR. ;
      CDOW( cDate ) = "Tuesday"

      lActualiza := .T.

      RETURN( .T. )

   ENDIF

RETURN( .F. )

FUNCTION ACTUALIZA_LOTTO()

RETURN NIL
 


Regards, saludos.



Sorry , I not understood


maybe I'm not explaining well:

I turn on the computer, today is Tuesday 15 2022

I open the application

in the main window at the bottom the application puts me a message " Archive not updated" or " Archive updated" in msgitem

the procedure to make me see this message must do a certain calculation:

I have as reference the last record of the archive which has the date 12.11.2022 which is a Saturday

Today is 15.11.2022 and the last valid draw before today was 12.11.2022

I have as a reference that the extractions take place on Tuesdays, Thursdays and Saturdays

today which is Tuesday 11.15.2022 at 11.00 am is a day of extraction but the extraction takes place after 21.00 therefore the message must report "archive updated" because even if today is Tuesday (day of extraction) the archive is updated to last valid day before today i.e. 12.11.2022



Karinha,

Enciendo la computadora, hoy es martes 15 2022

abro la aplicacion

en la ventana principal en la parte inferior la aplicación me pone un mensaje "Archivo no actualizado" o "Archivo actualizado" en msgitem

el procedimiento para mostrarme este mensaje debe hacer un cierto calculo:

tengo como referencia el ultimo registro del archivo el cual tiene fecha 12.11.2022 que es un sabado

Hoy es 15.11.2022 y el último sorteo válido antes de hoy fue el 12.11.2022

Tengo como referencia que los sorteos se realizan los martes, jueves y sábados

Hoy, que es martes 15.11.2022 a las 11:00, es el día de extracción, pero la extracción se realiza después de las 21:00, por lo tanto, el mensaje debe informar "archivo actualizado" porque incluso si hoy es martes (día de extracción), el archivo se actualiza a la última válido antes de hoy, es decir, 12.11.2022
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: updating an archive

Postby karinha » Tue Nov 15, 2022 3:12 pm

Google translator:

Silvio, see if I'm on the right path or not. If possible, correct this example where I made a mistake, please.

Silvio, mira si estoy en el camino correcto o no. Si es posible, corrija este ejemplo donde cometí un error, por favor.

It sounds easy to do, but it's not.

Suena fácil de hacer, pero no lo es.

Code: Select all  Expand view

// C:\FWH1905\SAMPLES\SILOTTO2.PRG - Idea: Silvio Falconi.
// No comprendo perfecto aun. Inicio del Proyecto: 15/11/2022.

#Include "FiveWin.ch"

STATIC oDlg, oFont
STATIC lActualiza := .F.

FUNCTION Main()

   LOCAL oGet1, oGet2, oGet3, wHOR, wMIN, wSEG, cHora, cMensagem
   LOCAL oBtnX2, cTitle, aGrad, oSay1, oSay2, oSay3, oBtn, oActualiza
   LOCAL DtUltSort, DtUltReg, DtProxSort
 
   SET CENTURY ON
   SET DATE BRITISH
   SET EPOCH TO YEAR( DATE() ) - 30

   cTitle     := "último sorteo de Lotto"

   // último registro no BD que é um sábado.
   DtUltReg   := CTOD( "11/12/2022" )

   // último sorteio válido
   DtUltSort  := CTOD( "12/11/2022" )

   // Proximo sorteio válido 21:00 hs. Antes da 21:00 hs: "arquivo atualizado"
   // Depois das 21:00 hs: "Arquivo não atualizado"
   DtProxSort := CTOD( "15/11/2022" )

   // Hora do computador:
   cHora := Time()

   IF SubStr( cHora, 1, 2 ) <= "21" // PM

      // cHora := Str(Val(SubStr(cHora,1,2))+12,2)+SubStr(cHora,3,7)
      // ? SubStr( cHora, 1, 2 )

      cMensagem := "Archivo atualizado. No es 21:00 hs aun."

   ELSE // Silvio, e se for 11:00 hs, que tengo que hacer?

      cMensagem := "Archivo no atualizado. Es + de 21:00 hs"

      // Dias que tiene Sorteos? Es esto? Debe actualizar el arquivo(BD)?
      IF CDOW( DtProxSort ) = "Saturday" .OR. ;
         CDOW( DtProxSort ) = "Tuesday"  .OR. ;
         CDOW( DtProxSort ) = "Thursday"

         lActualiza := .T.

      ENDIF

   ENDIF

   wHOR := VAL(SUBSTR( cHora, 1, 2 ) )
   wMIN := VAL(SUBSTR( cHora, 4, 2 ) )
   wSEG := VAL(SUBSTR( cHora, 7, 2 ) )

   // ? wHOR, wMIN, wSEG

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 16

   DEFINE DIALOG oDlg SIZE 600, 200  PIXEL TRUEPIXEL RESIZABLE  ;
      TITLE cTitle COLOR CLR_BLACK, CLR_WHITE TRANSPARENT FONT oFont

   oDlg:lHelpIcon := .F.

   @ 12, 10 SAY oSay1 PROMPT "último sorteo en archivo:" SIZE 300, 16 PIXEL ;
      OF oDlg FONT oFont UPDATE

   @ 32, 10 GET oGet1 VAR DtUltSort SIZE 100, 24 PIXEL OF oDlg FONT oFont ;
      PICTURE "@D 99/99/9999" CENTER // VALID( ES_UN_SABADO( DtUltSort, oActualiza ) )

   @ 60, 10 SAY oSay1 PROMPT "Fecha(Date) Ult. Registro" SIZE 300, 16 PIXEL ;
      OF oDlg FONT oFont UPDATE

   @ 80, 10 GET oGet2 VAR DtUltReg SIZE 100, 24 PIXEL OF oDlg FONT oFont ;
      PICTURE "@D 99/99/9999" CENTER // VALID( ES_UN_SABADO( DtUltSort, oActualiza ) )

   @ 106, 10 SAY oSay2 PROMPT "Fecha(Date) Proximo Sorteo:" SIZE 300, 16 PIXEL ;
      OF oDlg FONT oFont UPDATE

   @ 128, 10 GET oGet3 VAR DtProxSort SIZE 100, 24 PIXEL OF oDlg FONT oFont ;
      PICTURE "@D 99/99/9999" CENTER

   @ 158, 10 SAY oSay2 PROMPT cMensagem  SIZE 400, 16 PIXEL ;
      OF oDlg FONT oFont UPDATE COLORS CLR_BLUE, CLR_HBLUE

   @ 050, 500 BUTTON oActualiza PROMPT 'Actualiza' SIZE 80, 50 PIXEL OF oDlg ;
      ACTION( ACTUALIZA_LOTTO() ) WHEN( lActualiza )

   @ 120, 500 BUTTON 'Close' SIZE 80, 50 PIXEL OF oDlg ACTION( oDlg:End() )  ;
      CANCEL

   ACTIVATE DIALOG oDlg CENTERED

   RELEASE oFont

RETURN NIL
// No + usado
FUNCTION ES_UN_SABADO( cDate, oActualiza )

   // TU CONDICION(es) DE DIA O FECHA(Date).
   IF CDOW( cDate ) = "Saturday" .OR. ;
      CDOW( cDate ) = "Tuesday"

      lActualiza := .T.

      RETURN( .T. )

   ENDIF

RETURN( .F. )

FUNCTION ACTUALIZA_LOTTO()

RETURN NIL

// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7766
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: updating an archive

Postby Silvio.Falconi » Tue Nov 15, 2022 4:44 pm

I tested your example
there is no reference to today
i.e. if I open the procedure today I have the last record saved on November 12th and I know that the next one is November 15th after 9pm, if I open it today at 3.11pm it could work
I give it a try, change the date to the system and put November 18, 2022, I have always saved the last record on November 12 in the archive and I know that the next draw after November 12 was November 15 and November 17.
Well changing the date of the system I have the same message with your test


Probé tu ejemplo
no hay referencia a hoy
es decir si hoy abro el procedimiento tengo el ultimo registro guardado el 12 de noviembre y se que el proximo es el 15 de noviembre despues de las 21 hs, si lo abro hoy a las 15.11 hs podria funcionar
Lo pruebo, cambio la fecha al sistema y pongo 18 de noviembre de 2022, siempre he guardado el último registro el 12 de noviembre en el archivo y sé que el próximo sorteo después del 12 de noviembre fue el 15 de noviembre y el 17 de noviembre.
Bueno cambiando la fecha del sistema me sale el mismo mensaje con tu prueba
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm

Re: updating an archive

Postby karinha » Tue Nov 15, 2022 7:55 pm

Silvio, this routine you need is very complicated to do. I am not able to create logic for her for now. I'll think about it some more. It's a big challenge.

Silvio, esta rutina que necesitas es muy complicada de hacer. No soy capaz de crear lógica para ella por ahora. Lo pensaré un poco más. Es un gran desafío.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7766
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: updating an archive

Postby karinha » Tue Nov 15, 2022 8:18 pm

Silvio, if the Date is "11/18/2022", what does the program have to do or say? Or, what does he have to do on each date?

Silvio, si la fecha es "18/11/2022", ¿qué tiene que hacer o decir el programa? O, ¿qué tiene que hacer en cada fecha/cita?

I'm really very confused.

Estoy realmente muy confundido.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7766
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: updating an archive

Postby Silvio.Falconi » Thu Nov 17, 2022 9:32 am

karinha wrote:Silvio, if the Date is "11/18/2022", what does the program have to do or say? Or, what does he have to do on each date?

Silvio, si la fecha es "18/11/2022", ¿qué tiene que hacer o decir el programa? O, ¿qué tiene que hacer en cada fecha/cita?

I'm really very confused.

Estoy realmente muy confundido.

Regards, saludos.



Confusion. muy confondido

Please try this test ( changing the date and time of your computer), but also not run ok!!
Code: Select all  Expand view

#include "fivewin.ch"

REQUEST DBFCDX
REQUEST HB_Lang_IT

// Animations using Icons and Timers with checks draws

#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

   SET DATE FORMAT "dd-mm-yyyy"
   SET DELETED     ON
   SET CENTURY     ON
   SET EPOCH TO    year( date() ) - 20
   SET MULTIPLE    OFF

   DEFINE WINDOW oWnd FROM 1, 1 TO 20, 60 ;
      TITLE "msgitem"

   SET MESSAGE OF oWnd ;
      TO "test" CENTER NOINSET  2015

      DEFINE MSGITEM oMsgItem1;
         OF oWnd:oMsgBar ;
         BITMAPS "MSG_LOTUS2", "MSG_LOTUS2";
         SIZE 170             ;
         ACTION NIL

   ACTIVATE WINDOW oWnd ;
      ON INIT DisplayIcons(oMsgItem1,oWnd)

return nil

//----------------------------------------------------------------------------//
function DisplayIcons(oMsgItem1,oWnd)
   local oIco, oTimer
   local lAggiornato:= CheckEstrazione()

   static nFrame := 1

   ?lAggiornato

   IF  !lAggiornato
    oMsgItem1:cMsg:="Archivio non aggiornato"
   DEFINE TIMER oTimer OF oWnd ;
      INTERVAL 400 ;
      ACTION ( nFrame := If( ++nFrame > 2, 1, nFrame ) , ;
               oMsgItem1:setBitmap( "warning" + AllTrim( Str( int(nFrame) ) )+".bmp" ) )
   ACTIVATE TIMER oTimer
else
   oMsgItem1:setBitmap( "check2.bmp")
   oMsgItem1:cMsg:="Archivio aggiornato"
Endif
return nil
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------//
Function CheckEstrazione()
   local oDbf
   local dDataEstrazione
   local lUpdate:=.f.
   local oTimer

   local nMartedi:= 2
   Local nGiovedi:= 4
   local nSabato := 6

   local nDayarchive,nDaytoday
   local ndays,dDataToday

   oDbf:= TDatabase():Open( , "LOTTO", "DBFCDX", .T. )
   oDbf:setorder(1)  //data
   oDbf:GoBottom()

   dDataEstrazione:= oDbf:data
   oDbf:close()
   nDayarchive := DOW( dDataEstrazione -1  )
   dDataToday  := date()
   nDaytoday   := DOW( date() -1  )
   nTime       := left(Time(),2)



   IF dDataEstrazione < dDataToday    // is minor?
          //if it is smaller, the archive may be old

      ndays:= (dDataToday-dDataEstrazione) // count the ndays

         //   if it is Saturday, 3 days must pass for a draw
         //   if it is Tuesday or Thursday, 2 days must pass for a draw

      IF ndays = 1  .OR.  ndays = 2  .and. nDayarchive = 6  //saturday
       //  If the day of archive saturday  today can be sunday or monday
                         return .T.  //   update
       Endif

            // Msginfo(ndays,str(nDayarchive))

            If ndays >= 3 .and. nDayarchive >= 2

              IF nDaytoday = nMartedi  .or.;   //days of draws
                 nDaytoday = nGiovedi  .or.;
                 nDaytoday = nSabato

                 //Msginfo(nDaytoday)

                    //check the Time of computer
                       IF val(nTime) < 21
                            lUpdate:= .T.    // update
                           else
                             lUpdate:= .F.   // not update
                          ENDIF


                       ENDIF

         ENDIF
   ENDIF

  return lUpdate
 



the test need also some bmps,(converte all images to bmp because postimage converte into png)

warning2.bmp
Image

warning1.bmp
Image

check2.bmp
Image
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: 7004
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 28 guests