Solved

VB to C# Code

Posted on 2011-09-22
6
227 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now