TIP: Click on subject to list as thread! ANSI
echo: 4dos
to: ALL
from: Gerald Miller
date: 2003-12-11 19:56:18
subject: long BTM file

Path: internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!in.100proofnews.com!in.100proofnews.com!news.astercity.net!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: Thu, 11 Dec 03 19:56:18 +0100
Subject: long BTM file
Message-ID: 
References: 
Organization: Nostalgia just isn't what it used to be.
 2443/1181
Lines: 145
Xref: intern1.nntp.aus1.giganews.com fido.4dos:465

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> @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 "@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=%@path[%@search[%0]]%@upper[%@name[%0]].LOG
  set dd=   JanFebMarAprMayJunJulAugSepOctNovDec
  set dy=%_dow %_day %@substr[%dd%,%@eval[%_month * 3],3]%=
 %@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, %@UPPER[%@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 "@28" return

commented it out and replaced it with the following:

   iff "%X" eq "Y" .or. "%X" eq "@28" then
      set item=%@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.

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