Solved

VB to C# Code

Posted on 2011-09-22
6
230 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
COnsume rest client 6 34
C# replace string in void with dR["myData"].ToString() 3 39
How to avoid saving tif files a 2nd time using VS2015 and C#? 1 27
Class object 2 26
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

930 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

8 Experts available now in Live!

Get 1:1 Help Now