D
Dirk Traulsen
Hi list!
I had a strange effect, when I combined print with several strings
and a method.
Please look at this example:
##############
def method1
print "string_2_method", " - "
return "return_string_method - "
end
print "\n"
print "string_1", " - ", method1, "string_3\n"
##############
Surprisingly it results in:
string_2_method - string_1 - return_string_method - string_3
But I expected it to result in:
string_1 - string_2_method - return_string_method - string_3
Even if any method would be executed first, independant of the
position in the line, then shouldn't it be the following:
string_2_method - return_string_method - string_1 - string_3
Can somebody please explain this strange order of execution to me?
Thanks
Dirk
I had a strange effect, when I combined print with several strings
and a method.
Please look at this example:
##############
def method1
print "string_2_method", " - "
return "return_string_method - "
end
print "\n"
print "string_1", " - ", method1, "string_3\n"
##############
Surprisingly it results in:
string_2_method - string_1 - return_string_method - string_3
But I expected it to result in:
string_1 - string_2_method - return_string_method - string_3
Even if any method would be executed first, independant of the
position in the line, then shouldn't it be the following:
string_2_method - return_string_method - string_1 - string_3
Can somebody please explain this strange order of execution to me?
Thanks
Dirk