Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB to C# Code

Posted on 2011-09-22
6
Medium Priority
?
253 Views
Last Modified: 2012-05-12
Guy's, here's another one:

                If m IsNot Nothing AndAlso m.Success Then
                    .Action = Conversion.Val(m.Value)
                Else
                    .Action = SIM.Charge.Command.Credit_Sale
                End If
 .Action = Val(m.Value) converts to .Action = Conversion.Val(m.Value)
Help says there is an explicit conversion

Thanks guys!!
Don't know what I would do without Expert Exchange!!

Jerry
0
Comment
Question by:JDL129
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:jmnf
ID: 36583833
Do you want to know exactly why is there an explicit conversion? I don't really understand your question.

if (m != null && m.Success) {
	.Action = Conversion.Val(m.Value);
}
else {
	.Action = SIM.Charge.Command.Credit_Sale;
}

Open in new window

0
 

Author Comment

by:JDL129
ID: 36583862
imnf!!!!!!!!!!!!!!!!!!

Thanks for the response!


Use of the word Conversion gives me an error:Cannot implicitly convert type 'double' to SIM.Charge.Command. An explicit conversion exists (Are you missing a cast)?

Jerry



0
 
LVL 4

Expert Comment

by:jmnf
ID: 36583991
Not an expert in c#, but enlighten us more please....

what is .Action?
where does it comes from?
Does the code has a "with something" before the if?
Is "Action" an Enum type?

(too many questions on my part)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JDL129
ID: 36584040
.Action is a method of a of SIM.dll
I don't know if it is an Enum type.
It doesn't have a "with something" before the if
It looks as if the code is trying to convert the value of m to a double.

m = System.Text.RegularExpressions.Regex.Match(action, "^([\\s\\d]+)");

That's about the best I can do..Not an expert in .Net just a newbie!!

Thanks!!

Jerry
0
 
LVL 4

Accepted Solution

by:
jmnf earned 500 total points
ID: 36584130
I'm out of ideas, it just seems to be a verifone payware library, but no documentation on it, as a random suggestion/idea, remove the dot before Action OR add SIM before the dot.
0
 

Author Closing Comment

by:JDL129
ID: 36584138
imnf!!!!!

Thanks for all your help!!

Jerry
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question