-
May 19th, 2014, 08:10 AM
#1
[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 08:49 PM.
Reason: Code Block
-
May 19th, 2014, 08:31 AM
#2
Re: Convert from c# TryParse
First, edit your post adding Code tags around the code snippets. Otherwise your code is unreadable,
Second:
 Originally Posted by MAHEY
...
It's giving error like Syntax error 2143 missing ';' before '.'
in what line?
See also Compiler Error C2143
Victor Nijegorodov
-
May 19th, 2014, 08:56 PM
#3
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 09:06 PM.
-
May 19th, 2014, 10:37 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|