From: Chuck Brotman Date: 2005-06-21T03:35:35+09:00 Subject: Re: :Another Newbe question ..." if then syntax" James, Yes I think that helps! Thanks, Chuck "James Edward Gray II" wrote in message news:86987EF9-CC8B-4BCE-9DFB-4ADEC4D005ED@grayproductions.net... > On Jun 20, 2005, at 1:10 PM, Chuck Brotman wrote: > >> some cinfusion on syntax... >> >> Is it necessary (desirable) to end a single-line if/then statement with >> "end. > > Usually, but read on. > >> The dopcumentation shows it when using else or multiline if.. >> >> Is the following okay?: >> >> if condition then "the then code" > > No, that's not okay. However, Ruby allows statement modifiers, so we can > reverse that: > > do_this() if condition? > > That is allow and no end is needed. > >> or should it be >> >> if condition then "the then code" end ???? > > The above is fine. You can also replace then with it's symbol shortcut, > in recent versions of Ruby: > > if condition? : do_this() end > >> what about the use of curlybrackets "{}" how would that syntax go? > > No braces for if's, use end instead. > > Hope that helps. > > James Edward Gray II > > >