Computing.Net > Forums > Disk Operating System > need a batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

need a batch file

Reply to Message Icon

Name: Raintree
Date: April 11, 2005 at 14:01:39 Pacific
OS: any ibm os
CPU/Ram: 33 to 280ghz
Comment:

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 computers

Thank you for reading.

Raintree



Sponsored Link
Ads by Google

Response Number 1
Name: dtech10
Date: April 11, 2005 at 15:31:38 Pacific
Reply:

Hi
There's loads of mileage in batch files they been around of years.
You've totally lost me.



0

Response Number 2
Name: Mechanix2Go
Date: April 11, 2005 at 16:11:30 Pacific
Reply:

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.


0

Response Number 3
Name: Valerie (by Garibaldi)
Date: April 11, 2005 at 16:13:48 Pacific
Reply:

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.



0

Response Number 4
Name: wizard-fred
Date: April 11, 2005 at 17:22:33 Pacific
Reply:

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.



0

Response Number 5
Name: Raintree
Date: April 12, 2005 at 14:16:56 Pacific
Reply:

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


0

Related Posts

See More



Response Number 6
Name: Raintree
Date: April 12, 2005 at 14:25:13 Pacific
Reply:

Ouch! wrong image....from wrong site. Have no software for sale so please do not ask.

Maybe admin can pop the pic.


Raintree


0

Sponsored Link
Ads by Google
Reply to Message Icon

how to concatenate 2 name... Installing Dos



Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: need a batch file

a batch file to rename certain files www.computing.net/answers/dos/a-batch-file-to-rename-certain-files/10372.html

Dos Commands in a batch file www.computing.net/answers/dos/dos-commands-in-a-batch-file/1258.html

New line in a batch file www.computing.net/answers/dos/new-line-in-a-batch-file/4750.html