home *** CD-ROM | disk | FTP | other *** search
- echo off
- echo.
- echo ┌───────────────────────────────────────────────────┐
- echo │ Poor man's FUnction evaluator utilizing gwbasic │
- echo │ By Prof. Timo Salmi, ts@chyde.uwasa.fi, 10-Jul-91 │
- echo └───────────────────────────────────────────────────┘
- echo.
-
- if "%1"=="" goto _help
- if not "%2"=="" goto _err1
-
- rem Check if (ram)disk r: exists, if not use the current directory
- if exist r:\nul set _file=r:\tmp.bas
- if not exist r:\nul set _file=tmp.bas
-
- rem Check that gwbasic.exe is available at path
- set _found=no
- if exist gwbasic.exe set _found=yes
- for %%d in (%path%) do if exist %%d\gwbasic.exe set _found=yes
- if "%_found%"=="no" goto _err2
-
- rem Make an appropriate basic program and call it
- echo 10 on error goto 50 > %_file%
- echo 20 let y=%1 >> %_file%
- echo 30 print "%1 = ";%1 >> %_file%
- echo 40 system >> %_file%
- echo 50 print "Error in your expression %1" >> %_file%
- echo 60 system >> %_file%
- gwbasic %_file%
- if exist %_file% del %_file% > nul
- goto _out
-
- :_err1
- echo No spaces are allowed in the expression
- goto _out
-
- :_err2
- echo You must have gwbasic.exe at your path (or the current directory)
- goto _out
-
- :_help
- echo Usage: FU [ExpressionToBeEvaluated]
- echo.
- echo Examples: FU 4/7 (FU 4D/7D for double precision)
- echo.
- echo To use this batch you need gwbasic.exe, which comes with MsDos,
- echo at your path (it usually already is there).
- echo.
- echo If you get an "Out of environment space" message, increase your
- echo environment space by using shell configuration in config.sys:
- echo MsDos 3.30 example: shell=c:\bin\command.com /e:1024 /p
- echo.
- echo The basic idea (pardon the pun) of combining batch and gwbasic
- echo programming is not really mine. I got it from the PC-Magazine.
- echo The code of this batch, however, is entirely due to yours truly.
- echo.
- echo And here cometh the "commercial". For a fully-fledged function
- echo evaluator and plotter get tsfunc13.arc (or whatever version
- echo number is the latest) e.g. from garbo.uwasa.fi archives.
-
- :_out
- set _file=
- set _found=
- echo on
-