Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
arithmetic batch file
Name: Brian Curran Date: January 4, 1999 at 13:34:10 Pacific
Comment:
I need to create a batch file which will input numerical data from a file and perorm some mathematical operations, then send it to another file. I am new at batch files and have not found anything to do with arithmetic manipulation of data. If anyone can help, thanks a bunch.
Name: Justin Shriver Date: January 10, 1999 at 10:53:50 Pacific
Reply:
Batch files, in dos, are pretty limited. There are two approachs people have used. One is to create text stacks and push and pot things from them. The second is to actually write a little assembler program to handle the job. I think you can find some of these at PCmag's web cite.
0
Response Number 2
Name: Outsider Date: March 15, 1999 at 01:08:18 Pacific
Reply:
This was recently posted at alt.msdos.batch and it works great! ::::::::::::::::::::::::::::::::::::::::: :: CAL.BAT :: :: Syntax : CAL [env.var.=] Calculation :: :: e.g.: CAL test=3*4+7*12 :: (Result is stored in the EnvironmentVariable TEST) :: :: or : CAL 4*(42+7)*12 :: (Result is displayed on the screen, not stored) :: :: Referencing an Environment-Variable is possible not only :: within a batch but also from the command line: :: e.g.: CAL test=2+7 :: CAL xx=sin(%test%)+25*3 :: :: Note: - needs QBASIC :: - NO spaces within the "calculation" term! :: - within a batch use: CALL CAL [env.var.=] Calculation :: :: Edwin Schwartz, 03/1995 :::::::::::::::::::::::::::::::::::::::::::::::::::::::: @echo off echo set d1=%1> {cal}.bat echo set d2=%2>> {cal}.bat :: THERE must be NO spaces before the ">" and ">>" :: in the above lines !! call {cal}.bat if %2*==* echo ?"echo "+ltrim$(str$(1!*%d1%)) >> {cal}.bas if not %2*==* echo ?"set %d1%="+ltrim$(str$(1!*%d2%)) >> {cal}.bas echo ?a$:?"set d1=":?"set d2=":system >> {cal}.bas QBASIC /b/run {cal} > {cal}.bat call {cal}.bat for %%f in (s t) do del {cal}.ba%%f
Summary: Bitbyte's SCALC.COM is a great program, useful on batch files under DOS/Win9x. However, in NT systems such as Win 2000, the command prompt itself can do all it does (and much more). Here's a sample: s...
Summary: I need help with writing a batch file that returns an error code to another application (app1). My batch file is called by another application, when my batch file runs, it calls a VBS Script. This scr...