[Mono-list] Newbie question

Francisco Figueiredo Jr. fxjrlists@yahoo.com.br
Mon, 12 Aug 2002 02:18:45 -0300 (ART)


 --- jojolapin-mono@altern.org escreveu: 
> Hello, i have just discovered mono and c#, so sorry for the newbie question.
> I have tried to compile a c# source that does that
> 
> using System;
> ...
> int partants;
> partants=Console.ReadLine().ToInt32();
> ...
> 
> 
> But i get the following error message:
> Pronos.cs(27) error CS0117: `System.String' does not contain a definition for
> `ToInt32'
> 
> Has this function not been implemented, or am i wrong somewhere ?
> 

Hi, this method was implemented. But the IConvertible interface was implemented
using a feature of .Net called "explicit interface implementation". When
implemented like this, it can't be access directly. You must cast to the
IConvertible interface so that you can access its methods. You should have
something like this:

partants=((IConvertible)Console.ReadLine()).ToInt32(null);

I hope it helps.


=====
Regards,
Francisco Figueiredo Jr.

_______________________________________________________________________
Yahoo! PageBuilder
O super editor para criação de sites: é grátis, fácil e rápido.
http://br.geocities.yahoo.com/v/pb.html