ST 4U 189: Reading the Command Line in VA Smalltalk
Today's Smalltalk 4 You looks at how your application can read the command line that started VA Smalltalk. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
You can also watch it on YouTube:
Today we'll continue looking at the command line for VA Smalltalk, focusing on reading the command line at runtime. Here's a command line with a (presumed) application argument, -k:
VA pays no attention that argument, but what if we want our application to do something with it? Simply do the following:
commandLine := System commandLine.
Try that in a workspace, and inspect the results - you should see something like this:
All arguments and argument names will be strings; you'll need to parse them yourself. It's pretty easy though - you can set up a simple streaming facility for that easily.
Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.
Technorati Tags: smalltalk, va smalltalk, tutorial
Enclosures:
[st4u189-iPhone.m4v ( Size: 3277889 )]