I have this value in myvar ="Ver. 1.0.3"
How to increase of 0.0.1 this value?
Similar:
Ver. 1.0.4
Ver. 1.0.5
...
Ver. 2.1.9
increase value
-
- Administrator
- Posts: 78475
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: increase value
What comes after 1.0.9? Is the next value
a) 1.0.10
b) 1.1.0
c) 1.1.1
d) something else - and if so, what?
a) 1.0.10
b) 1.1.0
c) 1.1.1
d) something else - and if so, what?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: increase value
I think this formatHansV wrote:What comes after 1.0.9? Is the next value
a) 1.0.10
b) 1.1.0
c) 1.1.1
d) something else - and if so, what?
a) 1.0.10
but in effect the number refer similar a Version of apps, choice you based your experince the appropriate value:-)
-
- Administrator
- Posts: 78475
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: increase value
For example:
Code: Select all
Dim p As Long
Dim n As Long
p = InStrRev(myVar, ".")
n = Mid(myVar, p + 1)
myVar = Left(myVar, p) & (n + 1)
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: increase value
HansV wrote:What comes after 1.0.9? Is the next value
a) 1.0.10
b) 1.1.0
c) 1.1.1
d) something else - and if so, what?
ops...
Hans sorry, but really i need after 1.0.9
1.1.0
Possible to modify yyour code, in effect i need the b option.?
-
- Administrator
- Posts: 78475
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: increase value
That requires very different code:
Code: Select all
Dim arrParts As Variant
Dim n As Long
Dim v As Long
arrParts = Split(myVar, ".")
n = UBound(arrParts)
v = Val(arrParts(n))
If v < 9 Then
arrParts(n) = v + 1
Else
arrParts(n) = 0
v = Val(arrParts(n - 1))
If v < 9 Then
arrParts(n - 1) = v + 1
Else
arrParts(n - 1) = 0
v = Val(arrParts(n - 2))
arrParts(n - 2) = " " & (v + 1)
End If
End If
myVar = Join(arrParts, ".")
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: increase value
HansV wrote:That requires very different code:
Code: Select all
Dim arrParts As Variant Dim n As Long Dim v As Long arrParts = Split(myVar, ".") n = UBound(arrParts) v = Val(arrParts(n)) If v < 9 Then arrParts(n) = v + 1 Else arrParts(n) = 0 v = Val(arrParts(n - 1)) If v < 9 Then arrParts(n - 1) = v + 1 Else arrParts(n - 1) = 0 v = Val(arrParts(n - 2)) arrParts(n - 2) = " " & (v + 1) End If End If myVar = Join(arrParts, ".")
"That requires very different code" , sorry me.