Solved

VB to C# Code

Posted on 2011-09-22
6
242 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

630 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