Computer Hope

Software => Computer programming => Topic started by: tommmy on March 15, 2005, 09:33:13 AM

Title: msdos programming
Post 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
Title: Re: msdos programming
Post by: gussery on March 15, 2005, 12:19:29 PM
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?
Title: Re: msdos programming
Post by: tommmy on March 16, 2005, 09:18:03 AM
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
Title: Re: msdos programming
Post by: gussery on March 16, 2005, 11:14:17 AM
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.
Title: Re: msdos programming
Post by: Sidewinder on March 16, 2005, 12:50:41 PM
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)
Title: Re: msdos programming
Post by: johnwill on March 19, 2005, 03:21:12 PM
There are various DOS batch extender applications, including some that do calculations.  You might check the batch utilities here: http://garbo.uwasa.fi/pc/
Title: Re: msdos programming
Post by: martinweston on March 21, 2005, 05:53:19 AM
Could use Q basic. Found on older windows cd's, can be run thru dos.

Marty
Title: Re: msdos programming
Post by: ludo on April 01, 2005, 02:48:13 PM
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
Title: Re: msdos programming
Post by: ludo on April 01, 2005, 02:58:35 PM
sorry just need to use :
@echo off
set /A result=%1
echo resultat : %result%
Title: Re: msdos programming
Post by: ocean on April 05, 2005, 10:20:20 AM
HeY ..

I tried to install REXX .. but it doesnt work with me! :-/

anYone can helP Plz??

thanks
Title: Re: msdos programming
Post by: Sidewinder on April 05, 2005, 07:10:06 PM
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)
Title: Re: msdos programming
Post by: ocean on April 05, 2005, 10:48:26 PM
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  ::)
Title: Re: msdos programming
Post by: Ludo on April 06, 2005, 07:43:59 AM
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.
Title: Re: msdos programming
Post by: Sidewinder on April 06, 2005, 08:08:16 AM
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)
Title: Re: msdos programming
Post by: ocean on April 07, 2005, 08:38:08 AM
Thank You Sidewinder  8)

I'll read the documentation .. and trY to be Good at it ..

 
Title: Re: msdos programming
Post by: merlin_2 on April 09, 2005, 03:09:37 PM
more|more >>>here.http://www.perl.com/
Title: Re: msdos programming
Post by: Ludo on April 10, 2005, 06:11:22 PM
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
Title: Re: msdos programming
Post by: shashank on April 21, 2005, 11:47:46 AM
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
;)
Title: Re: msdos programming
Post by: WarGames on August 21, 2005, 08:59:33 AM
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.
Title: Re: msdos programming
Post by: UnAssembler on April 05, 2008, 09:44:04 PM
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!!!!
Title: Re: msdos programming
Post by: Dias de verano on April 07, 2008, 03:39:58 PM
UnAssembler, i am glad to see that there are still some people who know about proper programming!
Title: Re: msdos programming
Post by: Sidewinder on April 07, 2008, 06:35:56 PM
<sigh>
Title: Re: msdos programming
Post by: ghostdog74 on April 12, 2008, 08:31:57 PM
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
Title: Re: msdos programming
Post by: Dias de verano on April 13, 2008, 01:11:24 AM
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?

Title: Re: msdos programming
Post by: aliph on April 20, 2008, 01:55:30 PM
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)