Ruby Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesRuby Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old July 21st, 2007, 02:11 PM
abyssalRX abyssalRX is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 8 abyssalRX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 37 m 5 sec
Reputation Power: 0
Program ends to quickly

Just for an example:

#!/usr/bin/ruby
print "Hello World\n"


It makes a black window appear, the words "Hello World" Pop up and the screen disappears almost to quickly to see it. How do I make it stay up until I tell it to end (i.e. Hit the enter key to close?)

I appreciate any help I can get.

Reply With Quote
  #2  
Old July 21st, 2007, 04:38 PM
Oler1s Oler1s is online now
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2006
Posts: 1,477 Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Oler1s User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 4 Weeks 13 h 21 m 32 sec
Reputation Power: 426
What you wrote is a console program, so you ideally you should open a command line and run it from there. Get used to doing so, as many of the programs and tools you will use will be command line programs.

But if you want to create a kludge and keep the window open, ask for user input. Doing something like kludge = gets at the end of the program will do the trick.
__________________
C/C++: Books, C FAQ, C++ FAQ, C/C++ Reference.
Python: Website, Beautiful Soup.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesRuby Programming > Program ends to quickly


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway