473,805 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Who knows the .Net equivalent of the Val() function?

I inherited some code from a former employee, who was unable to cut the
umbilical cord from VB6. His code is littered with calls to VB6 functions
like Space(), String(), Left(), Mid(), Right(), Len(), Val(), etc.

I know the .Net equivalents of everything except Val().

Int32.Parse allows you to filter out characters like "$" and "," and
whitespace, but it still can't emulate the Val() function completely.

Alright, who here in this group knows the answer?

Thanks,

Mike
Nov 20 '05 #1
10 4856
* "Mike Wengler" <mikewenglerATp rovoxDOTcom> scripsit:
I inherited some code from a former employee, who was unable to cut the
umbilical cord from VB6. His code is littered with calls to VB6 functions
like Space(), String(), Left(), Mid(), Right(), Len(), Val(), etc.
I hope you don't try to replace these handy functions!
I know the .Net equivalents of everything except Val().
There is no 1:1 replacement available.
Int32.Parse allows you to filter out characters like "$" and "," and
whitespace, but it still can't emulate the Val() function completely.


Why not use 'Val'? It's a VB.NET function.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Cor
Hi Herfried,

Why not use 'Val'? It's a VB.NET function.

That is true but I think not a good answer

:-)

Cor
Nov 20 '05 #3
Cor,

* "Cor" <no*@non.com> scripsit:
Why not use 'Val'? It's a VB.NET function.

That is true but I think not a good answer


[Write your answer here]

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
I think somebody forgot to fill in his mail template :-p

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bv******** ****@ID-208219.news.uni-berlin.de...
Cor,

* "Cor" <no*@non.com> scripsit:
Why not use 'Val'? It's a VB.NET function.

That is true but I think not a good answer


[Write your answer here]

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #5
Cor
> Cor,
Why not use 'Val'? It's a VB.NET function.

That is true but I think not a good answer


[Write your answer here]

Why not use 'Val'? It's a function from .Net.

:-))))

Cor
Nov 20 '05 #6
Val is evil ..... Regex.Match coupled with ^\d*
"Mike Wengler" <mikewenglerATp rovoxDOTcom> wrote in message
news:u1******** ******@TK2MSFTN GP12.phx.gbl...
I inherited some code from a former employee, who was unable to cut the
umbilical cord from VB6. His code is littered with calls to VB6 functions
like Space(), String(), Left(), Mid(), Right(), Len(), Val(), etc.

I know the .Net equivalents of everything except Val().

Int32.Parse allows you to filter out characters like "$" and "," and
whitespace, but it still can't emulate the Val() function completely.

Alright, who here in this group knows the answer?

Thanks,

Mike

Nov 20 '05 #7
Herfried:
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bv******** *****@ID-208219.news.uni-berlin.de...
* "Mike Wengler" <mikewenglerATp rovoxDOTcom> scripsit:
I inherited some code from a former employee, who was unable to cut the
umbilical cord from VB6. His code is littered with calls to VB6 functions like Space(), String(), Left(), Mid(), Right(), Len(), Val(), etc.


I hope you don't try to replace these handy functions!
I know the .Net equivalents of everything except Val().


There is no 1:1 replacement available.
Int32.Parse allows you to filter out characters like "$" and "," and
whitespace, but it still can't emulate the Val() function completely.


Why not use 'Val'? It's a VB.NET function.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

You are wayyy too cool to like those functions..plea se tell me it's just
some of that Austrian sarcasm ;-)
Nov 20 '05 #8
just use
microsoft.Visua lBasic.Val()

the microsoft.visua lbasic class has all the old VB functions and they work
exactly the same..

"Mike Wengler" <mikewenglerATp rovoxDOTcom> wrote in message
news:u1******** ******@TK2MSFTN GP12.phx.gbl...
I inherited some code from a former employee, who was unable to cut the
umbilical cord from VB6. His code is littered with calls to VB6 functions
like Space(), String(), Left(), Mid(), Right(), Len(), Val(), etc.

I know the .Net equivalents of everything except Val().

Int32.Parse allows you to filter out characters like "$" and "," and
whitespace, but it still can't emulate the Val() function completely.

Alright, who here in this group knows the answer?

Thanks,

Mike

Nov 20 '05 #9
Cor
Hi Bill,

I think it has nothing to do with sarcasme.

There seems a strange thinking with some people who think that by limiting
themself by only using the System part they are programming for the Net.

Cor
Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5162
by: Phil Powell | last post by:
I need to find a PHP equivalent to a very familiar TCL command "subst" (see http://www.hume.com/html84/mann/subst.html ). This command will take a string and evaluate anything TCL inside of it and return values. for example, if this were my line: set word {World}
9
7464
by: neerolyte | last post by:
How would I pass an object variable to a function without that variable getting changed in the function changing the variable that was passed (eg both variables treated as one)? <script> var a = 1; var b = 2; function sub(a, b) { a = a - b;
20
6493
by: Praveen | last post by:
Hi All, I have an application for that we used oracle 8i as the db and we have written procedures using VARRAYs. Now, the requirement came to migrate it on DB2 UDB. Can anyone pls tell me is there any equivalent or alternative to VARRAYs in DB2? Thanks in advance, Praveen
21
3989
by: google | last post by:
I'm trying to implement something that would speed up data entry. I'd like to be able to take a string, and increment ONLY the right-most numerical characters by one. The type structure of the data that is in this field can vary. It's a list of mechanical equipment, and how it is designated varies based on how the customer has them labeled. For example, a list of their equipment might look like: CH-1 CH-2 CH-3
5
5485
by: jose g. de jesus jr mcp, mcdba | last post by:
vb.net val function c=val(a$)+val(b$) thanks
9
4053
by: Alan Silver | last post by:
Hello, I'm converting some old VB6 code to use with ASP.NET and have come unstuck with the Asc() function. This was used in the old VB6 code to convert a character to its ASCII numeric equivalent. Is there such a function available in C#? I can see that VB.NET has one, but I couldn't see how to get at it in C#. For example, if I have ...
1
3803
by: aum | last post by:
Hi, Does Javascript have any equivalent to Python's __getattr__ and __setattr__ methods? In other words, the option to define a method of a class that gets invoked whenever someone tries to fetch an unknown attribute, or set any attribute of an instance of that class? I've looked at __defineGetter__, __defineSetter__, __lookupGetter__ and
10
1607
by: cppquester | last post by:
I got an app where a bunch of values are set before the calculation is fired up. I need an elegant way to check if all variables have been set. So for example for double I am thinking about a class Double { private;
8
1595
by: Derek Martin | last post by:
I'd like to know if it's possible to code something in Python which would be equivalent to the following C: ---- debug.c ---- #include <stdio.h> bool DEBUG;
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10617
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10370
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.