Send to Printer


ST 4U 189: Reading the Command Line in VA Smalltalk

February 3, 2012 12:00:41.632

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:

command line.

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:

Starting VA

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:

Starting VA

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: , ,

[st4u189-iPhone.m4v ( Size: 3277889 )]

posted by James Robertson

 Share Tweet This