home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pcmagazi
/
1989
/
09
/
calc.bat
< prev
next >
Wrap
DOS Batch File
|
1988-11-22
|
653b
|
28 lines
ECHO OFF
REM CALC.BAT - BY: Randy J Guyan
CLS
IF "%1"=="" GOTO no_expression
IF "%2"=="" GOTO just_answer
IF "%2"=="#" GOTO show_equation
GOTO error
:just_answer
ECHO 1?"Ans= ";%1:SYSTEM>Q.X
GOTO continue
:show_equation
ECHO 1?"%1= ";%1:SYSTEM>Q.X
:continue
IF NOT EXIST Q.X GOTO error
BASICA Q.X
ERASE Q.X
GOTO end
:error
ECHO Sorry, an error has occurred --- please check your equation.
ECHO Max len= 100. If you enter '#' (w/o quotes) as a second
ECHO parameter, the maximum len= 50. You may not put any spaces
ECHO in your equation.
IF EXIST Q ERASE Q
GOTO end
:no_expression
ECHO No expression was specified!
:end