home *** CD-ROM | disk | FTP | other *** search
-
- Program: incr
- Programmer: George Kerber
- Written: 07/24/89 - 07/29/89
- Version: 1.01
- Application: AmigaDOS
- Purpose: This utility increment the value in a specified file by
- one or create the file and save an initial value of 0 if
- the file does not exist. incr will also display the
- stored value un-incremented or before/after.
-
- Requirements: AmigaDOS 1.3.
-
- SYNTAX: incr [[-a|-b|-d] TIMERNAME [NOLINE]]
-
- With no option, a help screen will be displayed.
- -a The stored value will be displayed after
- it has been incremented.
- -b The stored value will be displayed before
- incrementation.
- -d The stored value will be displayed, the value
- will not be incremented.
- NOLINE A newline will not be output after the elapsed
- time is displayed.
-
- Installation: Simply copy incr to your c: directory. Or execute
- the install script called incr.install.
-
- execute incr.install
-
- Directions: Execute incr with a filename. If this filename doesn't
- exist, incr will create the file and place a 0 in the file.
- If the filename exists and contains a numeric value, the
- value will be incremented and written back to the file.
-
- CAUTION: incr does not check if the file you give is a text
- or executable file. incr will simply read the first
- line of the file, convert the data to a numeric
- value and write the new value to the same file.
- What this really means is that if you specify
- a file you don't want changed, too bad....
-
- If you use the -d option, the value will simply be displayed
- and the file will remain unchanged. Using either the
- -a (after) or the -b (before) option will display the value
- either before or after it has been incremented.
-
- If the NOLINE option is used, a newline will not be
- performed after the value is displayed. This option
- works the same as the NOLINE option for the AmigaDOS echo
- command
-
- Examples: So what good is it?
-
- Try adding these lines to your startup-sequence.
-
- ....
- echo " You have booted from this disk " NOLINE
- incr -a s:bootcount NOLINE
- echo " times before.
- ....
-
-
- If you execute anything from a batch file, you can keep
- track of the number of times you have executed the file.
-
- -----------------------------------------------------------
-
- What if you want a batch file to execute something every
- 20 times you run it? Use the s:bootcount file you created
- in the last example.
-
- ....
- eval <s:bootcount >nil: to env:bootcount value2 20 op mod ?
- if $bootcount eq 0 VAL
- ....
- echo "it's time to do whatever you want done every"
- echo "twenty times this disk is booted up"
- ....
- endif
-
- -----------------------------------------------------------
-
- Get the idea.....
-
-
- Status: This is public domain, but please keep me as author and
- keep all the documentation intact. Anyway, if something
- is wrong with this program, I'm not responsible.....
-
-
-