[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

how to fail initialize

Jim

2/16/2007 3:16:00 PM

I would like to know the correct way to fail the creating of an object.
I would return a NULL in c/c++ but returning a nil does not to seem to
work correctly i.e.

if(obj) then do stuff

OR

if(obj != nil) then do stuff

New to Ruby if you couldn't guess.

Jim.

--
Posted via http://www.ruby-....

2 Answers

Ara.T.Howard

2/16/2007 3:21:00 PM

0

Jim

2/16/2007 3:37:00 PM

0

Thanks for quick response, I decided to do error testing before creating
object thus removing the problem, I find exception handling messy.

Thanks,
Jim.


--
Posted via http://www.ruby-....