Hi Everyone...I am a very new ruby user. I have downloaded ruby to my
computer (windows98). I have a ruby icon on my desktop with the name
hello. In the notepad part of the icon (hello.rb) are the following
words:
#generate some simple output (comment)
puts "Hello World"
When I click on the icon, a small screen appears with the name ruby.
The screen in visible for a few seconds. Then it disappears. The
screen is black and the words on it are white. I can't read the words
because the screen disappears too quickly.
How can I make the screen stay visible until I choose to click it off?
How can I change the screen so that the words are in black letters on
a white background?
How can I make the screen stay visible until I choose to click it off?
How can I change the screen so that the words are in black letters on
a white background?
Go to the start menu > Run, and type "cmd" (sans quotation marks). This
should open a command prompt you can use to run it ("ruby hello.rb").
Hope it helps,
···
On Tuesday 04 September 2007 11:20:05 am yahdoco wrote:
Hi Everyone...I am a very new ruby user. I have downloaded ruby to my
computer (windows98). I have a ruby icon on my desktop with the name
hello. In the notepad part of the icon (hello.rb) are the following
words:
#generate some simple output (comment)
puts "Hello World"
When I click on the icon, a small screen appears with the name ruby.
The screen in visible for a few seconds. Then it disappears. The
screen is black and the words on it are white. I can't read the words
because the screen disappears too quickly.
How can I make the screen stay visible until I choose to click it off?
How can I change the screen so that the words are in black letters on
a white background?
How can I make the screen stay visible until I choose to click it off?
How can I change the screen so that the words are in black letters on
a white background?
···
On Sep 4, 2:24 pm, Lloyd Linklater <ll...@2live4.com> wrote:
--------------------------
Hiya!
What about adding a gets at the end?
--------------------------
I changed the file hello.rb to the following: #generate some simple output (comment)
puts "Hello World"
gets
--------------------------
The screen still disappears very quickly. In a slow computer moment I
did see the words "Hello World."
Any other ideas?
I sill have the same two problems:
(1)The hello world screen disappears quickly.
(2)The letters are white on a black background.
I tried using MyComputer>ControlPanel>Display and the
DialogBox(Appearance) but nothing changed.
Any other ideas out there?
Thanks. Yahdoco
I sill have the same two problems:
(1)The hello world screen disappears quickly.
What have you tried? Can you post some code?
(2)The letters are white on a black background.
I tried using MyComputer>ControlPanel>Display and the
DialogBox(Appearance) but nothing changed.
Any other ideas out there?
Right click on the title bar of the console window, and select Properties. Set the colours up on the Colors tab. I don't know if it's possible to control this from Ruby - I'd expect it would be, but I've never needed to...
Don't just type "hello.rb" in the run box. Type "cmd", and you get a command
prompt that *doesn't* go away quickly, as I told you in the first email.
···
On Tuesday 04 September 2007 01:15:04 pm yahdoco wrote:
I sill have the same two problems:
(1)The hello world screen disappears quickly.
(2)The letters are white on a black background.
I tried using MyComputer>ControlPanel>Display and the
DialogBox(Appearance) but nothing changed.
Any other ideas out there?
Thanks. Yahdoco
This is your Command Prompt. You can open it via Run -> "cmd" in the box, or
via your Programs in Accessories (IIRC, it is there. It should have an icon
reading MS-DOS). Then, you'll have a command prompt in black with grayish
text, eagerly awaiting to do your bidding. Tell it to go to your desktop, by
typing in "cd c:\documents and settings\<put your user name here>\Desktop".
That should get you where you have placed your hello.rb file.
Once you are at the place you saved your hello.rb, just type "ruby
hello.rb", and you'll see the output of your command prompt.
If you cannot find your hello.rb, just type "irb" at the command prompt, and
you enter the interactive Ruby shell. You can experiment with Ruby there,
too.
Please note: I'm not sure about the place of your Desktop, since it has been
ages since I've worked with Windows 98.
···
-----Original Message-----
From: yahdoco [mailto:yahdoco@yahoo.com]
Sent: Tuesday, September 04, 2007 10:15 PM
To: ruby-talk ML
Subject: Re: running ruby
I sill have the same two problems:
(1)The hello world screen disappears quickly.
Actually, in W98, I believe the command is "command" not "cmd".
To the OP:
Most rubyists run their programs from the command line. But if you
truly want to double click on an icon to run a program, you'll need
two files.
If your hello.rb file is in c:\ruby, you will need to create a file on
your desktop (or wherever) containing this text: "ruby
c:\ruby\hello.rb %1", and then rename it to have a .cmd extension (not
tested, by the way, since I don't have W98).
hth,
Todd
···
On 9/4/07, Konrad Meyer <konrad@tylerc.org> wrote:
On Tuesday 04 September 2007 01:15:04 pm yahdoco wrote:
> I sill have the same two problems:
> (1)The hello world screen disappears quickly.
> (2)The letters are white on a black background.
> I tried using MyComputer>ControlPanel>Display and the
> DialogBox(Appearance) but nothing changed.
> Any other ideas out there?
> Thanks. Yahdoco
Don't just type "hello.rb" in the run box. Type "cmd", and you get a command
prompt that *doesn't* go away quickly, as I told you in the first email.
Don't just type "hello.rb" in the run box. Type "cmd", and you get a command
prompt that *doesn't* go away quickly, as I told you in the first email.
···
------------------------------
I click on start>run and I get a dialog box with the word OPEN:
I enter the word cmd and I get an error Dialog Box with the words:
Cannot find tye file 'cmd' (or one of it's components). Make sure the
path and filename are correct and that all required libraries are
available.
The hello.rb program does not run.
It only runs when I enter "hello.rb", but the response (an active
window with the name ruby) come up and then quickly disappears.
Any other ideas? Thanks. Yahdoco
At Wed, 5 Sep 2007 05:18:28 +0900,
Alex Young wrote in [ruby-talk:267595]:
Right click on the title bar of the console window, and select
Properties. Set the colours up on the Colors tab. I don't know if it's
possible to control this from Ruby - I'd expect it would be, but I've
never needed to...
I guess you can do it by setting the ColorTable## under the
registory key, \\HKEY_CURRENT_USER\Console. I don't know if
there are other ways.
Hi Everyone...Something interesting happened yesterday when I turned
off my computer at the end of the day. After the desktop screen
disappeared, all of the ruby windows that appeared for a short time
and then disappeared were on the next screen. Apparently, by clicking
on the hello icon, I am sending the answer to the MSDOS WINDOOW(?)
behind the desktop.
(1)How do I make the response appear as a ruby window on top of my
desktop screen?
(2)How do I change this response so that it consists of black text on
a white screen?
Thanks for your help. I am going to review all of the messages I have
received so far an see what I can learn from them. Yahdoco
If your running Windows 98 I think you have to type command.com into the run
dialog box, but you should also have MS-DOS located under your start menu
somewhere. Just open up a Dos prompt and then go to the directory where the
program is held and type
C:\>ruby hello.rb
~Jeremy
···
On 9/4/07, yahdoco <yahdoco@yahoo.com> wrote:
> Don't just type "hello.rb" in the run box. Type "cmd", and you get a
command
> prompt that *doesn't* go away quickly, as I told you in the first email.
------------------------------
I click on start>run and I get a dialog box with the word OPEN:
I enter the word cmd and I get an error Dialog Box with the words:
Cannot find tye file 'cmd' (or one of it's components). Make sure the
path and filename are correct and that all required libraries are
available.
The hello.rb program does not run.
It only runs when I enter "hello.rb", but the response (an active
window with the name ruby) come up and then quickly disappears.
Any other ideas? Thanks. Yahdoco
> Don't just type "hello.rb" in the run box. Type "cmd", and you get a
command
> prompt that *doesn't* go away quickly, as I told you in the first email.
------------------------------
I click on start>run and I get a dialog box with the word OPEN:
I enter the word cmd and I get an error Dialog Box with the words:
Cannot find tye file 'cmd' (or one of it's components). Make sure the
path and filename are correct and that all required libraries are
available.
The hello.rb program does not run.
It only runs when I enter "hello.rb", but the response (an active
window with the name ruby) come up and then quickly disappears.
Any other ideas? Thanks. Yahdoco
As Todd pointed out, the program to run in W98 is "command", not "cmd" --
you should try that. You should also probably get a newer operating system,
sheesh.
···
On Tuesday 04 September 2007 02:00:09 pm yahdoco wrote:
At Wed, 5 Sep 2007 05:18:28 +0900,
Alex Young wrote in [ruby-talk:267595]:
Right click on the title bar of the console window, and select Properties. Set the colours up on the Colors tab. I don't know if it's possible to control this from Ruby - I'd expect it would be, but I've never needed to...
I guess you can do it by setting the ColorTable## under the
registory key, \\HKEY_CURRENT_USER\Console. I don't know if
there are other ways.
> Don't just type "hello.rb" in the run box. Type "cmd", and you get a command
> prompt that *doesn't* go away quickly, as I told you in the first email.
Actually, in W98, I believe the command is "command" not "cmd".
···
---------------------------------
Hi Todd...You are correct. I took the following path:
Enter "command" and click on OK.
I got a window on my desktop>
Title=MS-DOS PROMPT
Content=C:\WINDOWS\Desktop>
At this point I tried words like:
run hello.rb
hello
hello.rb
but the message that came back was:
Bad Command
followed by C:\WINDOWS\Desktop>
What statement should I enter after Desktop>?
Thanks for your help. I seem to be learning new things and making a
lttle progress. Yahdoco
Hi Everyone...With the help of trial and error, I have made some
progress. I modified my hello.rb file by adding some ruby code that I
found on the web. The added code contained an analysis of a stock
using a yahoo website. (Actually, my interest in ruby is to do some of
my own stock market analysis). In the code was a request to enter a
stock symbol. This request kept the ruby window (with the "Hello
World" statement) on my desktop as it waited for me to enter a stock
symbol. Once I entered the symbol, a long calculation was made and
then the ruby window disappeared. Thus, one way to keep the window in
view is to add a request for input. I suppose a pause statement might
also work.
(1)Is there another way to keep the window in
view until I enter an exit command?
(2) I still have the problem that the window consists of white
characters on a black background. Is there a ruby command to change
the window or create another window with features that I can control?
Just remember that when you are in the command prompt, you have to be
in the same directory as where your hello.rb file is. In this case,
you should be, because you are in c:\windows\Desktop which is the
directory (also known as folder) that holds the files that you see on
your real desktop.
Todd
···
On 9/5/07, yahdoco <yahdoco@yahoo.com> wrote:
> > Don't just type "hello.rb" in the run box. Type "cmd", and you get a command
> > prompt that *doesn't* go away quickly, as I told you in the first email.
>
> Actually, in W98, I believe the command is "command" not "cmd".
---------------------------------
Hi Todd...You are correct. I took the following path:
>
>
Enter "command" and click on OK.
I got a window on my desktop>
Title=MS-DOS PROMPT
Content=C:\WINDOWS\Desktop>
At this point I tried words like:
run hello.rb
hello
hello.rb
but the message that came back was:
Bad Command
followed by C:\WINDOWS\Desktop>
What statement should I enter after Desktop>?
Thanks for your help. I seem to be learning new things and making a
lttle progress. Yahdoco
Your questions have already been answered. Your problem
is that you don't know how to use the Windows console
(also known as a DOS box). You need to learn how to use
it before you attempt to learn to program in Ruby.
···
On Sep 6, 10:05 am, yahdoco <yahd...@yahoo.com> wrote:
Hi Everyone...With the help of trial and error, I have made some
progress. I modified my hello.rb file by adding some ruby code that I
found on the web. The added code contained an analysis of a stock
using a yahoo website. (Actually, my interest in ruby is to do some of
my own stock market analysis). In the code was a request to enter a
stock symbol. This request kept the ruby window (with the "Hello
World" statement) on my desktop as it waited for me to enter a stock
symbol. Once I entered the symbol, a long calculation was made and
then the ruby window disappeared. Thus, one way to keep the window in
view is to add a request for input. I suppose a pause statement might
also work.
(1)Is there another way to keep the window in
view until I enter an exit command?
(2) I still have the problem that the window consists of white
characters on a black background. Is there a ruby command to change
the window or create another window with features that I can control?