First Look at IronRuby
page 5 of 8
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 30040/ 65

IronRuby "Hello World" Console Sample

If you download and build the IronRuby source code, you are probably wondering "how do I start using it?" 

The easiest way to get started is to run the "rbx.exe" interactive console application that by default is built under the \bin\release directory:

Figure 1

This console shell provides you with the ability to write Ruby code interactively.  After each line, the shell will interactively execute it. 

For example, we could output hello world by typing puts "Hello World":

Figure 2

To output this 10 times in a row, we could type the following:

Figure 3

To use Windows Forms functionality in IronRuby, we could type a require statement that references the System.Windows.Forms assembly, and then use the MessageBox.Show method to display a message in a modal dialog:

Figure 4


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2021 ASPAlliance.com  |  Page Processed at 2021-11-29 7:34:41 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search