1.

Solve : Calculating?

Answer»

How do you calculate in Dos
I want only + and -
Is this homework of some sort?

Hint: Set command.Yes it is
We don't write other people's homework.

I already gave you the command you need.


Hint2: In Command Prompt, set /?By the way, set arithmetic is only POSSIBLE in modern NT family command prompts, not "DOS".
or in visual BASIC make a new consle application and type
dim number1, number2, + sum
number1 = a number
number2 = a number
sum = number1 + number2
consle.writeline "the sum of" & number1.tostring() & " and " & number2.tostring() &
"is " & sum.tostring())I also have a calculating problem.
I would like to calculate how long some commands take.
For example:

@echo off
set old=%time%
echo %old%
rem some commands here
echo %old% %time%
set /A delay="%time% - %old%"
echo %delay%
pause

I get an error "MISSING operator" then on the next line I get an 18.
Can anyone help with this?
FrankFrank, I suggest you start a new topic. You will get more replies there.

Larssie111, he's got the answer to your question in his code. Quote from: Carbon Dudeoxide on August 11, 2008, 03:08:02 AM

Larssie111, he's got the answer to your question in his code.

but %time% is not a number.
I thought that "BATCH" might work with "time" as a number like some other PROGRAMS (eg. exel).

I started a new thread for my question (Calculating using time).
Frank


Discussion

No Comment Found