Date: Mon, 11 Nov 1996 17:19:02 GMT
Server: NCSA/1.5
Content-type: text/html
Last-modified: Fri, 01 Nov 1996 17:44:32 GMT
Content-length: 7339
CS 110 Sections 1&2 - Description of commands
Short Description of things to do in DOS/Fortran
- Log on. If you've logged on before, skip the next step.
- At the Login prompt, type NEWUSER. At the password prompt, just hit enter. The computer will prompt you for other info. When it's done, wait five or ten minutes, and then log in normally (it will tell you how when newuser is running).
- You're now in Windows.Click on the picture that says "MS-DOS PROMPT". A new window will appear (in black). If this window disappears (is backgrounded), do *NOT* click on the Dos Prompt again (that creates a completely seperate window). Instead, hold down the ALT key...a new window will pop up. Still holding down ALT, keep pressing TAB until the DOS Prompt appears in the new window. Then let go of both keys.
- The black window should now say something like U:\>. This is your prompt. U is the name of the disk drive you're currently on. We're going to do all our work from R drive, so type R: and hit return. The prompt should now say R:\>.
- The \ tells us which directory we're in on R drive. What's a directory? Think of a disk as a large box. Rather than throwing every single program in the same box, we'd like to organize them somehow. So we can put smaller boxes inside the large box and label them. For example, we might have a box called "public" which will house all the programs that everyone can use. We might have another box called "handin", which is where to put all the programs to be handed in. So a directory is just a sort of "box" that holds programs and other directories.
- Let's go into the handin directory. Type cd \handin\tick\YourLoginName, where YourLoginName is whatever name you type at your login prompt. This is the directory where you'll hand everything in. In our box analogy, our disk r has a main box, /, inside which has a box handin. Inside handin is a bunch of boxes, one of which is tick, and again once box inside tick is YourLoginName. Note that you are now *in* this directory. You can tell because your prompt now says R:\public\tickYourLoginName/>.
- *If* my assignment tells you to copy something (for example, prog0.dat) from my public directory to use with your program then type copy \public\tick\DataName ., where DataName is the name of the data file you're supposed to copy (i.e. prog0.dat). Note the following: there is a space between dat and the period (yes, the period *IS* part of the line. *DO NOT FORGET THAT SECOND PERIOD*). copy is a command that copies a program from one place to another...the program in this case is prog0.dat, found in \public\tick\ (you have to use the full path name here...this will always be the directory for things I give you to use). The second argument tells which directory the program is to be copied into. The period is a shorthand which means "whatever directory you're in now." So typing copy \public\tick\prog0.dat \handin\tick\YourLoginName would do the exact same thing.
- GENERAL NOTE: type dir at any time, anywhere, will show you what's in the current directory. *IMPORTANT* All filenames and directories can have no more than 8 letters, no spaces...files also add a dot followed by three other letters (such as .dat in prog0.dat). When you type dir, the first 8 letters will show up in one column, followed by a second column which lists the last three. Directories will have DIR listed to the right of the name (they don't have 3 letter extensions).INSANELY IMPORTANT NOTE: One of the other columns shows the time your program was last modified. This is my indication of when you did your program. If you modify your program after 5 pm on the due date, I'll be able to tell.
- If you type dir | more , only one screen's worth will be printed at a time. Once you hit the keyboard, it'll print the next screen's worth of listings. Lastly, if you add a path name right after dir, it'll list that directory instead of the current one.
- Now you're ready to type up your program (i.e. prog0.for). Type edit ProgramName, where ProgramName is the name of the program you wish to write. NOTE: your program *MUST* end with the .for extension.
- You can now type on the blue screen, the same as if you were using a typewriter, which is effectively what this is. Remember Fortran's spacing rules (for example, using tabs to make sure no code line starts before column 7). When done, click on File, then click on the ssave option under File. Go up to file again, and select exit.
- You're back on the black screen (the command line). So now you've got a program written in Fortran. You need to translate it into machine language so the computer can run it, so now you've got to to compile. Type f programname to compile.
- If there are errors, (the screen will say some sort of errors or warnings), you must compile again. WARNING: There is one machine that is set up incorrectly, V70. It's located right next to the far dor in the lab. If you're using that machine, it will claim upon compiling that it can't find llibfore.lib so every time you compile on it, it will ask you where to find it...when it asks, type q:\fortran\lib\llibfore.lib and it should work fine.
- Doing a dir should reveal two new files were created. They have the same name as your program but with a .obj and a .exe extension. The .obj isn't important...it's machine language with some info missing (see wk1 notes for explanation). The .exe, however, is the finished machine-language program. You can now run it by typing in the programname (you can leave out the .exe if you wish).
- Errors may still occur, or the program may not be doing what you want. If so, you'll have to 1) edit the program again and 2) compile it again once you're done editing.
- If you wish to delete the .obj file (which you don't need), typedel prog0.obj In general, del file will delete a file. DON'T DELETE THE .FOR OR .EXE...you may need them for later programs, plus if your hard
copy gets lost we'll need the file. Lastly, we test your programs once they're
handed in, so they need to be there.
- To print something out, type print file. It will prompt you for which printer to print to...use LPT1 (located in rm 1359, on the opposite side of the hall).
- Type exit to get rid of the DOS window. Now exit windows to log out. DON'T FORGET TO DO THIS LAST STEP! If you do, you leave your account open to access by anyone, plus you're loading down the system.
Copyright © 1996 Jeff Lampert (tick@cs.wisc.edu). Last modified November 1, 1996.