From: clockwork@... Date: 2007-08-04T01:48:47+09:00 Subject: Beginner with a question. ------=_Part_91419_21545145.1186159730342 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline So I am new to ruby, and I seem to be stuck on a seemingly simple problem. I have two variable's, one that is defined in the script, and one that is grabbed from input. I can add them together just fine, but I have not come up with a way to put the addition statement inline with strings. For instance: puts favnum.to_i + plus1.to_i Works producing the expected result. However when I try something like this: puts 'Try ' + favnum + plus1 + ' has the result.' I get errors. I have tried declaring the variables as integers, and tried various syntax's on that line, but the solution is escaping me and I have not found a good way to do this. I would also be willing to do a variable to define the item I want to add into the line, such as: finalnum = favnum.to_i + plus1.to_i But that doesnt produce the desired result either as the following doesnt work: puts 'Try '+ finalnum +' instead.' In both cases I also tried forcing .to_i but that didnt help. (though doing a "puts finalnum" works.) So what sort of silly syntactical error am I making ? (Apologies if this is the wrong place to post this, it seemed like my best bet.) ~Clockwork ------=_Part_91419_21545145.1186159730342--