Is this an error of .NET Framework ???

  • Thread starter Thread starter Lighting_dragon
  • Start date Start date
L

Lighting_dragon

I use the function Right() to take the year of the Date in String.

Dim S_Year as String
Dim S_Date as String

S_Date="1/7/2004" '( d/m/y)

S_Year= Microsoft.VisualBasic.Right(S_Date, InStrRev(S_Date, "/", -1)
- 1)

it give me sometimes "004" and sometimes "2004". I dont know why.
Maybe it is an error from .NET Framework ? ( Version 1 1.0.3705)
 
Can you provide example dates where the wrong value is returned?

-- Alex Papadimoulis

Lighting_dragon said:
I use the function Right() to take the year of the Date in String.

Dim S_Year as String
Dim S_Date as String

S_Date="1/7/2004" '( d/m/y)

S_Year= Microsoft.VisualBasic.Right(S_Date, InStrRev(S_Date, "/", -1)
- 1)

it give me sometimes "004" and sometimes "2004". I dont know why.
Maybe it is an error from .NET Framework ? ( Version 1 1.0.3705)
 
* (e-mail address removed)-spam.invalid (Lighting_dragon) scripsit:
I use the function Right() to take the year of the Date in String.

Dim S_Year as String
Dim S_Date as String

S_Date="1/7/2004" '( d/m/y)

S_Year= Microsoft.VisualBasic.Right(S_Date, InStrRev(S_Date, "/", -1)
- 1)

it give me sometimes "004" and sometimes "2004". I dont know why.
Maybe it is an error from .NET Framework ? ( Version 1 1.0.3705)

What do you mean by "sometimes"?
 
Lighting_dragon said:
I use the function Right() to take the year of the Date in String.


Dim S_Year as String
Dim S_Date as String

S_Date="1/7/2004" '( d/m/y)

S_Year= Microsoft.VisualBasic.Right(S_Date, InStrRev(S_Date, "/",
-1) - 1)

it give me sometimes "004" and sometimes "2004". I dont know why.
Maybe it is an error from .NET Framework ? ( Version 1 1.0.3705)


S_Year= Microsoft.VisualBasic.Right( _
S_Date, len(s_date) - InStrRev(S_Date, "/", -1) )



--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Oooo.. well spotted Armin!! I missed that by a gnat's nadger!!
_________________________
The Grim Reaper
 
Back
Top