[RESOLVED] Convert from c# TryParse
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: [RESOLVED] Convert from c# TryParse

  1. #1
    Join Date
    Dec 2011
    Posts
    53

    [RESOLVED] Convert from c# TryParse

    Hi, In c# the following codes are working good

    decimal number1;
    if (!decimal.TryParse(MyTxtBxStr, out number1))
    {
    MessageBox.Show("Invalid Value....Try Again");
    }

    And when I try to convert it like the following code

    System:ecimal MyNumber1;
    if (!Decimal::TryParse(MyTxtBxStr, MyNumber1)){
    MessageBox.Show("Invalid Value....Try Again");
    }

    It's giving error like Syntax error 2143 missing ';' before '.'


    Thanks for the helps
    Thanks Again
    Last edited by MAHEY; May 19th, 2014 at 09:49 PM. Reason: Code Block

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,532

    Re: Convert from c# TryParse

    First, edit your post adding Code tags around the code snippets. Otherwise your code is unreadable,

    Second:
    Quote Originally Posted by MAHEY View Post
    ...
    It's giving error like Syntax error 2143 missing ';' before '.'
    in what line?

    See also Compiler Error C2143
    Victor Nijegorodov

  3. #3
    Join Date
    Dec 2011
    Posts
    53

    Re: Convert from c# TryParse

    Hi VictorN,
    Thanks for your reply. (1) When I try to make it as code tag, it has not accepted....You can find it on my edit reason.
    (2)Syntax error showing on the below line
    MessageBox.Show("Invalid Value....Try Again");

    Thanks
    Last edited by MAHEY; May 19th, 2014 at 10:06 PM.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,440

    Re: [RESOLVED] Convert from c# TryParse

    Code tags are [ code] put code here [/ code] minus the spaces.

    Replace . with ::
    Code:
    MessageBox::Show("Invalid Value....Try Again");

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center