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

  • Thread starter Thread starter Mike Wengler
  • Start date Start date
M

Mike Wengler

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
 
* "Mike Wengler said:
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:
Herfried K. Wagner said:
I hope you don't try to replace these handy functions!


There is no 1:1 replacement available.


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


You are wayyy too cool to like those functions..please tell me it's just
some of that Austrian sarcasm ;-)
 
just use
microsoft.VisualBasic.Val()

the microsoft.visualbasic class has all the old VB functions and they work
exactly the same..
 
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
 
* "Cor said:
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.

Full ACK.

;-)
 
Back
Top