Subj : Revisions ... To : all From : Gerald Miller Date : Mon Oct 14 2002 07:18 am Hello All, Sunday October 06 2002 06:13, Gerald Miller wrote to All: GM> I've been "playing" with Klaus Meinhard's XBOOTEX.BTM file.... Here is my "revised" version, with the objectives at the end of this message. === Cut Begin: XBOOT2.BTM === :START *setlocal *unalias * on error (qedit /n%_batchline %@search[%0] %+ quit) on break goto END if "%temp" eq "" set temp=C:\ :: Next command establishes the location of the variable "_BOOTFILE" :: (XBOOT2.DAT) [should probably be in the same directory as this BTM :: file...] set _bootfile=%@path[%@search[%0]]%@name[%0].DAT set _temp=%temp\%@name[%0].TMP :: User input if [%1]==[-?] .or. [%1]==[/?] .or. [%1]==[?] goto USAGE :: Is the file XBOOT2.DAT there? Where? iff not exist %_bootfile then echo. color bri red on whi echo ERROR: %@path[%@search[%0]]%@name[%0].DAT not found! color bri cya on bla echo. delay 5 goto END endiff :: Set variables. If XBOOT2 did it's job today already or it's before :: 00:01 am, do nothing. set _lastdate=%@date[%@filedate[%_bootfile]] set _today=%@date[%_date] set _dotime=00:01 if %@eval[%_lastdate - %_today] eq 0 .or. %@eval[%@time[%_time] - %= %@time[%_dotime]] le 0 goto END :: Read XBOOT2.DAT, look at which progs to run today, copy info to :: XBOOT2.TMP and update XBOOT2.DAT set i=0 echo. echo %@line[%_bootfile,0] > %_temp echo %@line[%_bootfile,1] >> %_temp do n=2 to %@lines[%_bootfile] set _prog=%@instr[0,41,%@line[%_bootfile,%n]] set _when=%@instr[42,10,%@line[%_bootfile,%n]] set _last=%@instr[53,8,%@line[%_bootfile,%n]] set _next=%@instr[62,8,%@line[%_bootfile,%n]] set _ask=%@instr[71,1,%@line[%_bootfile,%n]] iff %@eval[%_today-%@date[%_last]] ge %_when .and. "%_prog" ne "" then iff "%_ask" eq "Y" then beep 294 2 330 2 277 2 294 2 330 2 277 2 294 2 330 2 277 %= 2 294 2 330 2 0 2 139 2 165 2 196 2 233 2 277 2 466 2 554 2 659 2 %= 784 2 932 2 scrput %_row %@eval[17+%@len[%_prog]] bri yel on bla `Y` inkey /c/K"YN[esc][enter]" `Execute `%@upper[%_prog]` %= [Y/N] ?` %%_ink echo. iff "%_ink" eq "Y" .or. "%_ink" eq "@28" then gosub include echo %@format[-41.41,%_prog]³%@format[-10.10,%_when]³%= %@makedate[%_today]³ ³%_ask >> %_temp else echo %@format[-41.41,%_prog]³%@format[-10.10,%_when]³%= %_last³ ³%_ask >> %_temp endiff endiff iff "%_ask" eq "N" .or. "%_ask" eq "" then gosub include echo %@format[-41.41,%_prog]³%@format[-10.10,%_when]³%= %@makedate[%_today]³ ³%_ask >> %_temp endiff elseiff "%_prog" ne "" then echo %@format[-41.41,%_prog]³%@format[-10.10,%_when]³%= %_last³ ³%_ask >> %_temp endiff unset /q _prog enddo move /q/u %_temp %_bootfile >& nul iff "%i" ne "0" then do m=1 to %i echo. echo. color bri whi on whi echos XBOOT2 Program Execution: color bri cya on bla echo %@upper[%[_run%m]] echo. %[_run%m] @echo off enddo endiff echo. color bri red on whi echos XBOOT2 END color bri cya on bla echo. :END color bri cya on bla if exist %_temp del /q %_temp > nul color bri cya on bla quit :USAGE color bri cya on bla text +------------------------------------------------------------------------+ | XBOOTEX ------- Once a day programm execution with many options | | (selectable intervals, ask before execution). | | | | XBOOTEX.DAT is the data file XBOOTEX.BTM, where | | you can enter your progs and parameters. It | | _must_ be in your path or the root dir of your | | boot drive. | | | | XBOOTEX should be _called_ from autoexec.bat | | | | Syntax: XBOOTEX /? -? Syntax (this screen) | +------------------------------------------------------------------------+ endtext delay 5 goto END :include set i=%@inc[%i] set _run%i=%_prog return === Cut End: XBOOT2.BTM === === Cut Begin: XBOOT2.DAT === PATH\PROGRAMM TO RUN |AFTER DAYS|LAST RUN|NEXT RUN|ASK -----------------------------------------+----------+MM-DD-YY+MM-DD-YY+--- c:\windows\remind.btm |1 |10-14-02| |N call c:\btm\cortime.btm /s |1 |10-14-02| |Y call C:\4d\4x\STEP_2.BTM |14 |10-05-02| |N call C:\4d\4x\STEP_3.BTM |28 |10-05-02| |N === Cut End: XBOOT2.DAT === As you can see, I wish to add another "field" to the DAT file - "NEXT RUN". I was presuming that one could simply add "AFTER DAYS" to "LAST RUN" (integer) and obtain the "NEXT RUN" value, which I had tried to do in the INCLUDE subroutine. I found that it wasn't quite as simple.... Can someone provide some insight on how I may insert the other "field"? Cheers ... Gerald --- GoldED+/386 v1.1.5-21006 * Origin: Buy land now. It's not being made any more. (1:342/512) .