home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
DEMON
/
AMSTRAD
/
ONDATE.ARC
/
ONDATE.DOC
< prev
next >
Wrap
Text File
|
1994-03-14
|
4KB
|
110 lines
ONDATE.COM J. Elliott, June 1993.
================================================================================
ONDATE is a conditional submit utility, similar to ONERL. However, it does not
need the GETERL extension to be loaded.
Its task is to run different programs on different dates, and is therefore
only of use if you set the computer's internal clock correctly. PCW users who
don't have SCA's Mk2 interface will have to put DATE SET in their PROFILE.SUB
files.
The syntax is rather different from normal programs. As ONDATE is meant for
use in .SUB files, most of its input is in lines from the .SUB file rather than
the command itself. Syntax is:
ONDATE {/Q}
<dd/mm/yy:command 1
<dd/mm/yy:command 2
.
.
<dd/mm/yy:command n
<
It should be pointed out that the < is a Submit marker and if you were typing
an ONDATE sequence at the keyboard you would not type this. Note that the date
is in the form dd/mm/yy, not mm/dd/yy as DATE.COM would have it.
Each of dd, mm and yy MUST have two digits. They can be ambiguous; the form
15/12/?? will work on 15th December (Anniversary of CP/M +) every year.
If YY is above 77, it will signify a date of the form 19XX - so 85 means 1985.
If YY is below 78, it will signify a date of the form 20XX - so 37 means 2037.
Ridiculous dates (eg 45/13/93) will never be used.
command is just any CP/M command. In a SUB file, only one command can be run
by ONDATE like this. If you want to do an involved routine, this command
should be SUBMIT SUPER2 or something similar, all your routine being in
the sub-SUB file. The exception to this rule is when ONDATE is the last
command in a SUB file.
Since SUBMIT removes any ! marks from a SUB file, if you want !
marks in an ONERL input you should use | (vertical bar) instead.
End all ONDATE inputs with a < (blank line). This tells ONDATE that there are
no more lines to input.
There now follows an example:
.
.
ONDATE /Q -The /Q(uiet) stops the following lines being shown on
<15/12/82:ECHO "%You haven't set the computer's clock" the screen
<15/12/??:ECHO "%C%P/%M+'s anniversary!" -run once a year
<01/??/??:ERASE *.BAK|ERASE *.OLD -run once a month
<?2/??/??:PIP BACKUPS.ARK=CURRENT.ARK -run 3 times a month
<31/12/77:ECHO "%Need new version of %O%N%D%A%T%E..." -last possible date.
< -End of input.
NEXTPROG
.
.
There are a number of things to note from this:
The numbers above are in order. This may be important with ambiguous lines
(see below).
If you are in the middle of a SUB file and you try to put in a multiple
command (something like <01/01/01:DIR *.COM|DIR *.SUB ) then the first command
will be executed; the second will be left over until the current SUB file comes
to an end, then executed. This can lead to problems.
ONDATE can't make program input of its own. You will have to use the sub-SUB
file trick for that. Eg: You can't have:
29/02/87:PIP|<m:=*.com|<m:=*.sub|<
Instead, use:
29/02/87:SUBMIT PIP001
and let PIP001.SUB read
PIP
<m:=*.com
<m:=*.sub
<
If there are two valid "<dd/mm/yy:command" lines in an ONDATE command, the
first is used. This means that the order that lines are in may be important.
For example:
<15/12/82:command1
<15/12/83:command2
<15/12/??:command3
will execute command1 on 15th December 1982; command2 on 15th December 1983 or
command3 for other 15th Decembers. But:
<15/12/??:command3
<15/12/82:command1
<15/12/83:command2
will execute command3 for all 15th Decembers.
Type ONDATE /H to be reminded of the syntax.
ONDATE accepts dates up to 31st December (20)77. However, DATE only goes up to
31st December (19)99. Furthermore, dates in ONDATE are in UK format (dd/mm/yy);
dates in DATE are in US format (mm/dd/yy). To convert DATE to work in UK
format up to 2077, use COMPAT (on this disc) with the file UKDATE.CMP:
COMPAT DATE UKDATE
and then DATE.COM will accept UK format dates up to 2077.
________________________________________________________________________________