Translate

Thursday, February 6, 2014

Some starting fun with Command Prompt!

   Hello, my name is George Shkan, and I have the privilege of writing an article for the wonderful Madame Jellybean, the proprietor for this blog (:D thank you kindly for your patience Jelly). And as a student of 
computer programming, I’d like to take this time to teach you about the command prompt, or programming without a GUI interface. It is a little intimidating to move way from the button and task menu interface to pure typing, but worth learning both in the long run and good to know in the immediate term. And I will keep the introduction simple for this first article; learning is best done in part after all.
   I’m assuming you have Visual Studio 2010(VS for this article), as this is the version I will use; while older or newer versions might work as well, it would be best to review and make sure you know the keywords are still compatible with your version of VS. If you don’t have VS is installed, the regular command prompt will suffice for this tutorial, but I would look for the express version of VS2010 for the next group of tutorials.
   To start, why don’t you try a command I know you’ll find interesting – changing the color of the background and text with the ‘Color’ command. It is simple, the command takes two hexadecimal numbers from 0 – 9, or A, B, C, D, E, or F, like so Color 0A, or Color 5D. Experiment and get comfortable with this keyword, and adjust yourself as you like. Here is a quick table of values and the colors they make.
0 = Black               8 = Gray
1 = Blue                                9 = Light Blue
2 = Green            A = Light Green
3 = Aqua              B = Light Aqua
4 = Red                 C = Light Red
5 = Purple            D = Light Purple
6 = Yellow            E = Light Yellow
7 = White             F = Bright White
   Ok, with the command prompt the color to your liking, why don’t we go ahead and start with a basic program to learn how a file is written and compiled in the VS2010 command line. First, start with notepad filename, with the file name you would choose for this file. This will simply open a blank notepad file; this demonstrates how to open other applications using command prompt.
   In the short term future, I plan on teaching commands to navigate around the command prompt using text addresses, how to use the notepad files to write C and C++ code, and how to use the linker and compiler to build programs to demonstrate command line usage. See you around! :D

No comments:

Post a Comment