Are you 100% sure that "EOS" begins in column 0? This must be true or
it will not be found. Otherwise, change to <<-EOS, where the - will
let you indent the terminator.
Jason
···
On 8/11/05, hsun <sunh11373@hotmail.com> wrote:
Hi,
I have a simple test program.
====================
class QuickTest
def testMe
str = <<EOS
Some Application data
EOS
puts str
end
end
if $0 == __FILE__ then
$test = QuickTest.new
$test.testMe
end
I got this error and could not figure out what's wrong?
Your program is failing because you have 12 spaces after the "EOS".
You can't have anything on the line after the here-document terminator,
not even whitespace.
hsun <sunh11373@hotmail.com> writes:
···
Hi,
I have a simple test program.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
class QuickTest
=20
def testMe
str =3D <<EOS
Some Application data
EOS =20
puts str
end =20
=20
end
if $0 =3D=3D __FILE__ then
$test =3D QuickTest.new
$test.testMe
end =20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
I got this error and could not figure out what's wrong?
I opened you attachment and it bombed on me as well. But when I selected the line afetr the terminating EOS I saw that you definitely did have about 12 spaces after the EOS. I am attching your file back and now it works.
HTH
-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
509-577-7732 ezra@yakima-herald.com
Thanks, it works now. maybe I should trun the EOL mark on from now on.
Thanks for everyone that offered help
···
I opened you attachment and it bombed on me as well. But when I
selected the line afetr the terminating EOS I saw that you definitely
did have about 12 spaces after the EOS. I am attching your file back
and now it works.
HTH
-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
509-577-7732
ezra@yakima-herald.com
On Aug 11, 2005, at 2:19 PM, hsun wrote:
Hello David,
The message messed up but I am sure that the EOS is on its own line
by itself and I even checked with a HEX editor. Here is the file
atached.
The editor I use is Mondrain.
Thanks
Hi --
On Fri, 12 Aug 2005, hsun wrote:
Hi,
I have a simple test program.
====================
class QuickTest
def testMe
str = <<EOS
Some Application data
EOS puts str
end end
if $0 == __FILE__ then
$test = QuickTest.new
$test.testMe
end ===========================
I got this error and could not figure out what's wrong?
QuickTest.rb:21: can't find string "EOS" anywhere before EOF
Thanks, it works now. maybe I should trun the EOL mark on from now on.
Having the editor remove trailing white space automatically when saving is
a good idea. This feature is present in almost every serious editor.
robert
···
Thanks for everyone that offered help
I opened you attachment and it bombed on me as well. But when I
selected the line afetr the terminating EOS I saw that you definitely
did have about 12 spaces after the EOS. I am attching your file back
and now it works.
HTH
-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
509-577-7732
ezra@yakima-herald.com
On Aug 11, 2005, at 2:19 PM, hsun wrote:
Hello David,
The message messed up but I am sure that the EOS is on its own line
by itself and I even checked with a HEX editor. Here is the file
atached.
The editor I use is Mondrain.
Thanks
Hi --
On Fri, 12 Aug 2005, hsun wrote:
Hi,
I have a simple test program.
====================
class QuickTest
def testMe
str = <<EOS
Some Application data
EOS puts str
end end
if $0 == __FILE__ then
$test = QuickTest.new
$test.testMe
end ===========================
I got this error and could not figure out what's wrong?
QuickTest.rb:21: can't find string "EOS" anywhere before EOF