Computer Hope
Software => Computer programming => Topic started by: tommmy on March 15, 2005, 09:33:13 AM
-
hey,
I need some help with programming in ms-dos,
wich command is used to calculate stuf ???
thanx, Tom
-
MS-DOS is an operating system, not a programming language. Technically, you cannot program in MS-DOS.
Can you be more specific about what you are trying to do?
-
I know I know, but you can whrite command lines in word and save it as a .bat file, so the commands are executed by dos. my question was wich command is used to calculate stuf ( e.g. 3+2 ), so i can make formula's and echo the result
thanx in advance
tom
-
There are none that I am aware of without calling another program. Remember DOS is a Disk Operating System so most of the commands available in DOS, thus batch files, have to do with disk and file operations.
-
Batch files were never intended to do what you are requesting. In general they just run a series of commands that you could just as easily have typed at the command prompt. Branching and decision making in a batch file is fairly primitive.
One good language for DOS is REXX. REXX runs on everything from mainframes, DOS, Windows, and Linux. The best part is that it's free.
REXX is easy to learn, can read records from a file, manipulate the data and produce formatted output. You can run DOS commands and other programs from within REXX. REXX also has specialized function libraries (download separately) for database access, system functions, high-level math, and communications.
You can download REXX from:
http://kilowattsoftware.com/r4page.htm
If you need any REXX libraries try this site:
http://www.borg.com/~jglatt/rexx/win32/rxusrw32.htm
Good luck.
8)
-
There are various DOS batch extender applications, including some that do calculations. You might check the batch utilities here: http://garbo.uwasa.fi/pc/
-
Could use Q basic. Found on older windows cd's, can be run thru dos.
Marty
-
hello,
save this under c:\test.bat
@echo off
set /A result=%1%2%3%4%5%6%7%8%9
echo resultat : %result%
then type test 5+2*9 at command prompt of c:\
and get the result
:P
-
sorry just need to use :
@echo off
set /A result=%1
echo resultat : %result%
-
HeY ..
I tried to install REXX .. but it doesnt work with me! :-/
anYone can helP Plz??
thanks
-
Ocean,
Sorry the REXX didn't work out. It's really a good language but I failed to realize the complications of setting it up from a zip file. Also there were variations from Classic Rexx.
Maybe you should try QBasic. You can download here for free:
http://www.geocities.com/TimesSquare/Arena/5451/qbasic/downloads/
If you get QBasic, you should be able to find any tutorials and documentation on the net.
Good luck.
8)
-
Thanks Sidewinder :)
I'll trY it when comin back from universitY ..but
can't i find a Rexx not in a ziP file ? am reallY interested in ::)
-
Hello,
I remember i found a rexx/windows software on the net, few years ago, i can't remember the link but the name was Winrexx.
-
Ocean,
I was able to find Object Rexx at:
http://sourceforge.net/project/showfiles.php?group_id=119701
Download the file name ooRexx300.exe. It will run on Windows (32 bit) and contains both Classic Rexx and Object Rexx. The documentation download file is oorexx-docs-3.0.0.zip on the same page. Complete details of the product are at: http://www.oorexx.org/
If you need to run this on a DOS machine, you can download Classic Rexx from:
http://sourceforge.net/project/showfiles.php?group_id=28102
Download the file name regina33.exe. The Documentation file is regina33.pdf on the same page. Complete details can be found at http://regina-rexx.sourceforge.net/index.html
Personally I would download the Object Rexx version. You can still write simple Rexx programs with the option to venture into the world of objects. The best part is both versions are free.
Good luck.
8)
-
Thank You Sidewinder 8)
I'll read the documentation .. and trY to be Good at it ..
-
more|more >>>here.http://www.perl.com/
-
Here a little code that runs under a DOS and prompt for a operation to compute (works fine only without comas and small numbers :-/ )
@echo off
title Little calc -- Enter a operation to compute (ex 5+2) -- Exit : Enter
prompt $B$S
:debut
set /P result="compute ? : "
if "%result%"=="" goto :EOF
set /A result="%result%"
echo Result : %result%
set result=
goto :debut
-
i think you were talking about the batch files in msdos.
though they contain basic programming techniques, i dont think you can really perform addition or any such things using msdos.
if you are really interested in knowing about batch files
and how are they created, you can follow the link below.
http://home.att.net/~gobruen/progs/dos_batch/dos_batch.html
please post if you know anything else about programming in dos.
bye
;)
-
If you want to do what you said Microsoft Visual Studio.NET is one of my favorite software to do it in. Or Excel is also easy but not exactly writing commands or code.
-
it is great to see some one else also knows the value of MS-DOS.
With every MS-DOS disk set (3.5" floppy disks) there is a utility called debug.
you can create programs using this utility.
It is clumsy, awkward and you have to design it on paper using pseudocode and translate it manually to assembly code and then type it in debug to assemble it into a .com file.
Pseudocode(an imaginary language that you define some rules for yourself) is needed for understandability but it is possible to do what you wish completely in MS-DOS alone.
I used MS-DOS 5.0.
Batch processing combined with redirected input, debug , and your own assemble language routine is clumsy and slow but it is flexible and free (well at least not an extra cost.)
This requires knowledge of your computers CPU instruction set. you should be able to download some reference from the manufacturer( intel[/url] ftp://download.intel.com/design/processor/manuals/ [/url] has some manuals for the x86 family)
I don't have any links to MS-DOS reference material.
have lots of fun!!!!
-
UnAssembler, i am glad to see that there are still some people who know about proper programming!
-
<sigh>
-
UnAssembler, i am glad to see that there are still some people who know about proper programming!
what is "proper programming" , by your definition. just curious
-
UnAssembler, i am glad to see that there are still some people who know about proper programming!
what is "proper programming" , by your definition. just curious
Don't folks do irony where you come from?
-
u guud at programming?? cos i got this assignment n i'm really finding it hard to solve it.......
task 3...20 marks
the administration staff and manager will access this system via an initial system entry screen with a password- this will give access to a main menu screen. the main menu will provide a choice of access to the following screens:
a. add /delete nurse
b. update nurse details
c. add nursing hours worked
d. add/delete institution
e. update institution details
f. add request for nurse
g. search available staff/ complete request
h. print report (manager only)
i. exit
(i) using pseudocode, write the top level code for a module showing how the various screens can be accessed.
note the pseudocode for add, delete, update , search, print and exit procedures is not required.
(ii) Draw a flowchart for the above module in part (i)