| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | long BTM file |
Hello Mark,
Responding to a post in the 4DOS area:
On Thursday December 11 2003 at 14:03,
Mark Lewis [1:3634/12] wrote to Jasen Betts,
about: long BTM file
JB>>> If you can't get diff to do it for you use fc.exe and I'll
JB>>> edit it in by hand.
ML>> ok, i'll see what i can come up with... so far, it seems to
ML>> work great ;-)
ML> ok, here's the fc dif file... i didn't worry about trying to use %=
ML> continuation lines and i'm sure that a few of these have wrapped...
ML> ===== sched.dif =====
ML> Comparing files SCHED.ORG and sched.btm
ML> ****** SCHED.ORG
ML> :! SCHED.BTM VERSION 1.0 dec-2003
ML> :!
ML> ****** sched.btm
ML> {at}echo off
ML> :! SCHED.BTM VERSION 1.0 dec-2003
ML> :!
ML> ******
Hmmmm. Take a look in your 4DOS.INI file... You can insert the following
directive (makes the need for "{at}echo off" in batch files totally
unnecessary):
=== Cut: 4DOS.INI ===
BatchEcho=NO
;[YES] Default batch file echo state Yes = BATCH's echoes until ECHO=OFF
;No = disables batch file echoing unless ECHO is explicitly set on.
=== Cut: 4DOS.INI ===
ML> :: logging addition by mfl
ML> :: Next command establishes the location of the variable "LOGFILE"
ML> :: (btm_name.LOG) [should be in the same directory as this BTM
ML> :: file...]
[snip]
ML> ===== end =====
Sorry for snipping your code Mark... (My editor wrapped everything so badly
that it was not very pretty to look at.)
ML> i hope its not too far off from what else may have already been
ML> altered... the spacing on the logfile entries is critical... here's a
ML> sample of what it looks like...
ML> ---------- Fri 5 Dec 03, SCHED Process
ML> 01:06:09 SCHED: Executing STEP_0.BTM...
ML> 01:06:09 SCHED: Executing STEP_1.BTM...
ML> 01:06:09 SCHED: Executing STEP_3.BTM...
ML> 01:06:09 SCHED: Executing BIRTHDAY.BTM /MARK...
ML> 01:06:11 SCHED: Executing MIDNIGHT.BTM...
ML> ---------- Wed 10 Dec 03, SCHED Process
ML> 08:24:12 SCHED: Executing STEP_0.BTM...
ML> 08:24:12 SCHED: Executing STEP_1.BTM...
ML> 08:24:12 SCHED: Executing MIDNIGHT.BTM...
ML> ---------- Thu 11 Dec 03, SCHED Process
ML> 13:07:44 SCHED: Executing STEP_0.BTM...
ML> 13:07:45 SCHED: Executing STEP_1.BTM...
ML> 13:07:45 SCHED: Executing STEP_2.BTM...
ML> 13:07:45 SCHED: Executing MIDNIGHT.BTM...
ML> ---------- Thu 11 Dec 03, SCHED Process
ML> ! 13:34:07 SCHED: Nothing to do because it's all been done!
ML> there should possibly be a log entry for the A rule and how it was
ML> answered for the program being asked about running... i haven't dug
ML> that far into it, though... still trying to figure out some of the
ML> syntax...
That's pretty good. I got similar results in my log.
Now, a challenge for you... Put it in the form of a RULE and modify the
batch accordingly.
Or, (this will probably be easier to do) use some IFF ... ELSE ... ENDIFF
statements for your logging with #something# such as:<<
:: logging addition by mfl
:: Next command establishes the location of the variable "LOGFILE"
:: (btm_name.LOG) [should be in the same directory as this BTM file...]
:: LOGGING=N means that logging is off
:: LOGGING=Y means that logging is on
set logging=Y
set logfile=%{at}path[%{at}search[%0]]%{at}upper[%{at}name[%0]].LOG
set dd= JanFebMarAprMayJunJulAugSepOctNovDec
set dy=%_dow %_day %{at}substr[%dd%,%{at}eval[%_month * 3],3]%=
%{at}substr[%_year,2,2]
and every place where you have logging statements, it could be in the form:
:: logging addition by mfl
:: start logging...
iff "logging" eq "Y" then
echo. >> %logfile
echo ---------- %dy, %{at}UPPER[%{at}FILENAME[%0]] Process >> %logfile
else
endiff
(BTW, you really don't need the trailing "%" at the end of your %logfile
variable...)
My reasoning for this suggestion is that once the batch file is fully
debugged and functional, you are likely not going to need or require your
log file any further. When you reach that point, it's just a simple matter
to change "set logging=y" to "set logging=n" and you
won't have to go
through the batch to comment out a bunch of code that you're not going to
use. If, at a later point, you require the log file again, then you only
have to change the "set logging" variable...
Also, in regards to the ASK query:
I haven't received confirmation from Jasen, but in my batch, I looked for
the following line:
if not "%X" ne "Y" .and. "%X" ne
"{at}28" return
commented it out and replaced it with the following:
iff "%X" eq "Y" .or. "%X" eq "{at}28" then
set item=%{at}inc[%item]
set run%item=%prog
set last=%RUNDATE
else
set last=%last
endiff
return
and this *_seems_* to be working for me. Please give it a try and report
any problems here. I'm going to run with this until I hear otherwise.
Cheers ... Gerald
... Experience enables you to recognize mistakes when you make 'em again.
--- GoldED+/DPMI32 v1.1.5-30512
* Origin: Nostalgia just isn't what it used to be. (1:342/512)SEEN-BY: 633/267 270 @PATH: 342/512 5 140/1 106/2000 633/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™.