TIP: Click on subject to list as thread! ANSI
echo: 4dos
to: ALL
from: Gerald Miller
date: 2003-11-30 10:23:08
subject: dayboot1 question

Path: archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!upp1.onvoy!onvoy.com!hermes.visi.com!news-out.visi.com!petbe.visi.com!takemy.news.telefonica.de!telefonica.de!news.man.poznan.pl!news2.icm.edu.pl!news.atman.pl!news.intercom.pl!f124.n480!f127.n480!f112.n480!f200.n2432!f605.n774!f500.n123!f2000.n106!f1.n140!f5.n342!f512.n342!not-for-mail
Newsgroups: fido.4dos
Distribution: fido
From: Gerald Miller 
Date: Sun, 30 Nov 03 10:23:08 +0100
Subject: dayboot1 question
Message-ID: 
References: 
Organization: Condominiums are not effective birth control.
Lines: 109
Xref: archiver1.google.com fido.4dos:41

Hello Mark,

    On Wednesday November 26 2003 at 16:37,
    Mark Lewis [1:3634/12] wrote to Gerald Miller,
    about:  dayboot1 question

[snip]

 ML> i see... looks like i may have to do something similar to what i do in
 ML> some of my programs that require to know the day of the month...
 ML> hummm... then again, maybe not... 4DOS knows what the day of the month
 ML> is...

 ML>  @DAY[mm-dd-yy]       Day of the month

 ML> it should be possible to work that into dayboot1 so that one can use x
 ML> days between runs or certain day's of the month...

 ML> echo %_date
 ML> 11-26-03

 ML> echo %@day[%_date]
 ML> 26

 ML> looks right to me... now to figure out how to denote a specific date
 ML> in the .dat file... [looking] well... you use a + to show every X
 ML> days... maybe an = to denote the exact day of the month?

 ML> [** SAMPLE **]

 ML> PATH\PROGRAM TO RUN                 �AFTER�        �        �DAYS �
 ML>                                     � DAYS�LAST RUN�NEXT RUN� LEFT�ASK
 ML> ���� 001 ������� Time: 13:07:59 �����������MM-DD-YY�MM-DD-YY����������
 ML> STEP_0.BTM                          �1    �11-22-03�11-23-03�1    �N
 ML> STEP_1.BTM                          �1    �11-22-03�11-23-03�1    �N
 ML> STEP_2.BTM                          �+7   �11-16-03�11-23-03�1    �Y
 ML> STEP_3.BTM                          �+14  �11-09-03�11-23-03�1    �N
 ML> STEP_4.BTM                          �+14  �11-16-03�11-30-03�8    �
 ML> 26TH.BTM                            �=26  �11-26-03�12-26-03�30   �

 ML> [** END SAMPLE **]

 ML> hummm... looks like it would work to me? what about to you? i haven't
 ML> looked into the code and would have to learn it before attempting to
 ML> put this mod in... seems like it should be easy enough to do...

 ML> so, what do you say? add a great enhancement to an already good util?

I've got the flu and I'm taking a few days off....

If you don't want to enter 26th.btm into the data file twelve times (much
more accurate), then put it in once and call 26th.btm everyday (with the
following [_untried_] adjustments); until dayboot can be revised.

The "theory" of the following snippet is:
  if the current day of today's date is the 26th, then check to see if the
  flag file exists (don't want to run the batch more than once).  If the
  flag exists, then quit the batch; if the flag does NOT exist, then create
  the flag and run the batch.

  If the flag exists and if the current day of today's date is NOT the
  26th, then delete the flag and quit the batch.

=== Cut 26TH.BTM ===
::  The following *_should_* create a zero byte flag file in the same drive /
::  directory (named 26TH.FLG) as the 26TH.BTM file
  set flagfile=%@path[%@search[%0]]%@upper[%@name[%0]].FLG
    iff %_day[%date] == 26 then
::  or maybe the above line has to be "iff %@day[%_date] == 26 then" (both
::  #_may_# yield the same results) - /play/ with it.
      iff exist %flagfile then
        quit
      else
        goto Now
      endiff
    else
      iff exist %flagfile then
        goto Remov_flag
      else
        quit
      endiff
    endiff

:Now

  rem>%flagfile

goto Start

:Remov_flag
if exist %flagfile del/q %flagfile
::  The following should stop your batch from running after you remove the
::  flag when the day is NOT the 26th...
    iff %_day[%date] ne 26 then
::  or maybe the above line has to be "iff %@day[%_date] ne 26 then" (both
::  #_may_# yield the same results) - /play/ with it.
      quit
    else
    endiff

:Start
::  the rest of your batch after this....
=== Cut 26TH.BTM ===

Let me know if that works for you.

           Cheers ... Gerald

... Conservative: one who'd rather have 8% unemployment than 8% inflation.

SOURCE: echoes via archive.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.