Re: operator * cannot be applied

From: George Hester (hesterloli_at_hotmail.com)
Date: 04/04/04


Date: Sun, 04 Apr 2004 19:06:05 GMT

Thanks Chris. Actually I knew that. I used "Cast" to see if anyone would clarify it for me. I knew I used the expression incorrectly but I didn't know why. Thanks again.

George Hester
__________________________________
"Chris Smith" wrote in message news:MPG.1ad85d78e3424af69899c6@news.pop4.net...
> George Hester wrote:
> > NumberFormat nf = NumberFormat.getInstance();
> > double poundValue = nf.parse(amount).doubleValue();
> > String rate = getInitParameter("RATE");
> > double dblrate = nf.parse(rate).doubleValue();
> > poundValue *= dblrate;
> >
> > That casted the string rate to a double dblrate.
>
> Just to be picky about terminology; that did not cast the String to a
> double. Casting a String to a double is, in fact, impossible and always
> results in a compiler error. What it did was convert a String to a
> double.
>
> The word "cast" -- at least in Java, and in a number of other languages
> -- refers to a specific piece of language syntax -- namely:
>
> ( type ) expr
>
> Hopefully, that will save you some confusion in the future.
>
> --
> www.designacourse.com
> The Easiest Way to Train Anyone... Anywhere.
>
> Chris Smith - Lead Software Developer/Technical Trainer
> MindIQ Corporation



Relevant Pages

  • Re: simple binding of controls to object properties - refresh cont
    ... Thanks again Chris for looking into this.! ... Still I think I prefer just manually reseting the bindings, ... public string Ting ... textbox BobTheBound = new TextBox; ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Invalid CastException with SqlDBType
    ... Add(string*, SqlDbType, int, string**) ... The DateTime.Now is trying to cast into a int. ... not in Sql set up the column as identity and let it seed itself. ... > update a MS SQL Database with a stored procedure. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Porting up to VC++ 2005
    ... Since you are dealing with strings that contain file names, ... characters, but that's a different question to be handled in a different way. ... done, which should be unnecessary, it should be an LPTSTR cast, which ... It only applies to string and ...
    (microsoft.public.vc.mfc)
  • Re: new for regular expression in Perl
    ... > string, the original file will not change.) ... >> Thanks Chris and others for the information. ... DSL? ...
    (perl.beginners)
  • Re: Confused about using Reflection to examine a collection
    ... the precise type that Reflection is saying it is. ... say that 'obj' is actually a custom collection. ... If it were a basic type, such as 'string' then I would do a cast like this: ...
    (microsoft.public.dotnet.languages.csharp)