TIP: Click on subject to list as thread! ANSI
echo: 4dos
to: Jasen Betts
from: Gerald Miller
date: 2002-11-04 20:12:54
subject: XBOOT3.BTM

Hello Jasen,

    On Saturday November 02 2002 at 15:01,
    Jasen Betts [3:640/531.42] wrote to Gerald Miller,
    about:  XBOOT3.BTM

 JB> here's what I did to it.

 JB> *** no changes before here ***

 JB> ::  Next command establishes the location and name of the variable
 JB> ::  "tempfile" that holds the tempfileorary information while the
 JB> ::  action is performed.

 JB>   set tempfile=%{at}unique[%temp]

Agreed!  :))

 JB> ::  User input
 JB>   if [%1]==[-?] .or. [%1]==[/?] .or. [%1]==[?] goto USAGE

 JB> ::  Is the file XBOOT3.DAT there?  Where?
 JB>   iff not exist %bootfile then
 JB>     echo.
 JB>     color bri red on whi
 JB>     echo ERROR: %{at}path[%{at}search[%0]]%{at}name[%0].DAT not found!

Because the above line presented an "unpleasant" color effect, I
changed it to:

  echos ERROR: %{at}path[%{at}search[%0]]%{at}upper[%{at}name[%0]].DAT was not found!

and I wanted to maintain uppercase for the filename...

 JB>     color bri cya on bla
 JB>     echo.
 JB>     delay 5
 JB>     goto END
 JB>   endiff

 JB> ::  Set variables. If XBOOT3 did it's job today already or it's before
 JB> ::  00:01 am, do nothing. In this case, the "start" time is 00:01
 JB> ::  am....

 JB>   set lastdate=%{at}date[%{at}filedate[%bootfile]]
 JB>   set today=%{at}date[%_date]
 JB>   set dotime=00:01

  set country=%_country

The above line /*may*/ appear obvious, later...

 JB>   if %{at}eval[%lastdate - %today] eq 0 .or. %{at}eval[%{at}time[%_time] - %=
 JB> %{at}time[%dotime]] le 0 goto END

     %{at}time[%dotime]] le 0 (
     echo.
     color bri red on bri whi
     echos There is nothing to do today because it's all been done!
     color bri cya on bla
     echo. %+ echo. %+ delay 5 %+ goto END
     )

 JB> ::  Read XBOOT3.DAT, look at which progs to run today, copy info to
 JB> ::  XBOOT3.TMP and update XBOOT3.DAT
 JB>   set i=0
 JB>   echo.

 JB> set
 JB> df=%{at}replace[2,d,%{at}replace[20,yy,%{at}replace[1,m,%{at}makedate[14936]]]]
 JB> :: df is local date format.

 JB> text> %tempfile
 JB> PATH\PROGRAM TO RUN                      ³AFTER³        ³        ³DAYS
 JB> ³
 JB>                                          ³ DAYS³LAST RUN³NEXT RUN³
 JB> LEFT³ASK
 JB> endtext
 JB> echo ÄÄÄÄ 001

  echo ÄÄÄÄ %{at}format[3.3,%country]

 JB> %{at}repeat[Ä,32]ÅÄÄÄÄÄÅ%df%Å%df%ÅÄÄÄÄÄÅÄÄÄ >> %tempfile
 JB> set df=

  unset /q df

 JB>   do n=3 to %{at}lines[%bootfile]
 JB>     set prog=%{at}instr[0,41,%{at}line[%bootfile,%n]]
 JB>     set when=%{at}instr[42,5,%{at}line[%bootfile,%n]]
 JB>     set last=%{at}instr[48,8,%{at}line[%bootfile,%n]]
 JB>     set next=%{at}instr[57,8,%{at}line[%bootfile,%n]]
 JB>     set left=%{at}instr[66,5,%{at}line[%bootfile,%n]]
 JB>     set ask=%{at}instr[72,1,%{at}line[%bootfile,%n]]

 JB>     iff %{at}eval[%today-%{at}date[%last]] ge %when .and.
"%prog" ne "" then
 JB>       iff "%ask" eq "Y" then
 JB>         beep 294 2 330 2 277 2 294 2 330 2 277 2 294 2 330 2 277 2 294
 JB> 2
 JB>         beep 330 2 0 2 139 2 165 2 196 2 233 2 277 2 466 2 554 2 659 2
 JB>         beep 784 2 932 2

 JB>         scrput %_row %{at}eval[17+%{at}len[%prog]] bri yel on bla `Y`
 JB>         inkey /c/K"YN[esc][enter]" `Execute
`%{at}upper[%prog]` [Y/N] ?`
 JB> %%ink
 JB>         echo.
 JB>         iff "%ink" eq "Y" .or. "%ink"
eq "{at}28" then
 JB>           set i=%{at}inc[%i]
 JB>           set run%i=%prog
 JB>           set last=%{at}makedate[%today]
 JB>         endiff
 JB>       elseiff "%ask" eq "N" .or.
"%ask" eq "" then
 JB>         set i=%{at}inc[%i]
 JB>         set run%i=%prog
 JB>         set last=%{at}makedate[%today]
 JB>       endiff

 JB>     elseiff "%prog" == "" then
 JB>             iterate
 JB>     endiff

 JB>     set nextdate=%{at}eval[%{at}date[%last]+%when]
 JB>     set daysleft=%{at}eval[%nextdate - %today]
 JB>     echo
 JB> %{at}format[-41.41,%prog]³%{at}format[-5.5,%when]³%{at}format[-8.8,%last %=
 JB>       ]³%{at}makedate[%nextdate]³%{at}format[-5.5,%daysleft]³%ask>>%tempfile

 JB>     unset /q prog daysleft nextdate
 JB>   enddo
 JB>   unset /q next,

The above has me a little baffled.  Why the comma and why not place it on the
line before ENDDO?  NEXT what?

 JB>   move /q/u %tempfile %bootfile >& nul
 JB>     iff "%i" ne "0" then
 JB>       do m=1 to %i
 JB>         echo. %+ echo.
 JB>         color bri whi on whi
 JB>         echos XBOOT3 Program Execution:
 JB>         color bri cya on bla
 JB>         echo  %{at}upper[%[run%m]]
 JB>         echo.
 JB>         call %[run%m]

If I am putting a CALL (before all the batch file names) in the DAT file, does
it not translate to "call call batchame"?  Or is one of the redundant CALLs
ignored?

 JB>         {at}echo off
 JB>       enddo
 JB>     endiff

 JB>     echo.
 JB>     color bri red on whi
 JB>     echos XBOOT3 END
 JB>     color bri cya on bla
 JB>     echo.

 JB> :END
 JB>     color bri cya on bla
 JB>     if exist %tempfile del /q %tempfile > nul
 JB>     endlocal
 JB>     color bri cya on bla
 JB>     quit

 JB> *** no changes after here ***

On the whole, I am very pleased with your input.  I had "hit"
upon the use of
the %{at}repeat[char[196],4] command when I had mentioned XBOOT32.BTM, but I
wanted to give you some time to digest what I had previously posted.

My notion of putting the %_country command near the beginning is because I am
planning to implement a check/change routine after the %_country command.

If the country code of the system running the batch does not match the
country code within the data file, then convert all the dates within the
data file to the correct format of that country.  It is a PITA to keep
changing the COUNTRY.SYS line and rebooting the computer.  Ideally, I
should have a second computer for the test country....

           Cheers ... Gerald

--- GoldED+/386 v1.1.5-21026
* Origin: If it ain't broke, don't fix it. (1:342/512)
SEEN-BY: 24/903 106/2000 120/544 123/500 140/1 342/5 512 400/300 633/104 260
SEEN-BY: 633/262 267 270 285 640/954 690/682 771/4020 774/605 2432/200
@PATH: 342/512 5 140/1 106/2000 123/500 774/605 633/260 285 267

SOURCE: echomail via fidonet.ozzmosis.com

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™.