Solved

VB to C# Code

Posted on 2011-09-22
6
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

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 125 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

Independent Software Vendors: 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!

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
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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