Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am in need of a batch file that will generate
days and milage.
Set the odometer and then read it at the end of the year. Seems to do my taxes I needed to do a day to day report. Bummer.Don't intend to cheat on the milage.
I need a batch file that will do a random milage from 40 miles to 130.. 320 days and have a total of 32148 miles.
Started to try this myself but got lost in varibles and someting about random seeds.
I really need some help here.
If the OS matters,I have dos1.1 to 2000 and win 1.1 to xp on different computersThank you for reading.
Raintree

Hi Raintree,
This should get you started. It's got plenty of rough edges.
::** requires w2k
@echo off > quit.bat@echo off > log
@echo off > rawmiles
set /a total=0:main
for /L %%D in (1,1,320) do call :mpd
goto :eof
:mpd
:new
set /a miles=%random:~0,2%
if %miles% LSS 40 goto :new
if %miles% GTR 70 set /a miles=%miles% + 3
echo %miles%>>log
set /a total=%total%+%miles%:eof
::**M2
If at first you don't succeed, you're about average.

Dos batch progs are not renowned for the ability to do arithmetic calculations although there a few complex progs available from some sites. I doubt if they would do what you want.

How do you know the total without the detail?
You're going to get caught in the detail. The numbers are not that random.
Next time get a diary like everyone else.

Thank you all. I do know a little (just a little) about batch files so the example does make sense. I think with some trial and error and a little hair pulling I can get a decent looking record.
A Diary? Well yes...that too makes for a fair argument. LOL!
Sorry my request may have been hard for some to follow.
Thank you again,Robin
Raintree

Ouch! wrong image....from wrong site. Have no software for sale so please do not ask.
Maybe admin can pop the pic.
Raintree

![]() |
how to concatenate 2 name...
|
Installing Dos
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |