So what do you do with a computer? What is a program? How do you want to use that computer?
We will first take a good look at the good old command prompt that is extremely useful for programmers. Learning a few basic commands will help you in the long run. Modern computer users are spoiled by the UI.
We will look at a few helpful command prompt commands for file and directory handling. Start->Run->cmd
- HELP - Provides Help information for Windows commands.
- DIR - Displays a list of files and subdirectories in a directory.
- CLS - clears the screen
- CD (or CHDIR) - Displays the name of or changes the current directory.
- DEL - Deletes one or more files.
- RMDIR - Removes a directory.
- REN - Renames a file or files.
- SET - Displays, sets, or removes cmd.exe environment variables.
- ECHO - Displays messages, or turns command echoing on or off.
- MD (or MKDIR) - Creates a directory.
- PATH - Displays or sets a search path for executable files.
- TYPE - Displays the contents of a text file.
- VER (also WINVER) - Displays the Windows version.
Just what does "C:" stand for (one previous student of mine guessed 'computer' and that's not right...).
Know how to launch a browser and launch notepad.exe.
Our first program... is a batch file. Save the following as test.bat. This is DOS batch file language... a bit weird and limited.
set /p yourname=What is your name? echo Hello %yourname%
Unfortunately the command prompt is very limiting and things live inside a prompt... (powershell is a lot more powerful but we won't go there).
Modern versions of Windows have Visual Basic script built in. You can do some basic programming with it. Call it testvbs.vbs
name = InputBox ("What is your name?","hey")
MsgBox "Hi " +name
See glorious details in here and here.
That is just an intro about what kind of programming can you can do out-of-box, without downloading or buying anything. So far it is a bit un-interesting. Visual Basic is easy, but now all has changed with .NET.... and it runs on Windows only.
So in this class we'll program the browser, with the benefit of able to run on various devices, so we need to know how to create an html file.
Get to know the file protocol. file:///
Next we will get to know some HTML...