Solved
ProbIem comparing 2 strings using INSTR
Posted on 2001-06-19
I have the following problem
I would like to compare the 2 strings below.
How can Extract the value between the first dot and the 2nd dot compare the 2 string if equal proceed?
1)AppVersion=?3.4.0
DbVersion=3.4.0
0r
2)AppVersion=?3.14.0
DbVersion=3.14.0
Basically I cannot find a way to compare the 2 strings and if equal proceed
What I thought was:
Dim Appversion as string,dbversion as string
Dim bwrongVersion as Boolean
1)AppVersion=?3.4.0
DbVersion=3.4.0
0r
2)AppVersion=?3.14.0
DbVersion=3.14.0
Bwrongversion= len(Appversion,4)<>len(dbversion,4)
If bwrongversion then
MsgBox?Unsuccessfull?
Else
Msgbox?successful?
End if
The problem with this is that if the string is the second example the above will fail.!!!!!!
##########################################################
So I thought
Dim appverPos1 as string,appVerPos2 as string
Dim bwrongVersion as Boolean
AppVerpos1=instr(,appversion,?.?) ?find the first dot
AppVerpos2=instr(3,appversion,?.?) ?find the 2nd dot
DbVerpos1=instr(,DbVersion,?.?) ?find the first dot
Dbverpos2= instr(3, DbVersion,?.?) ?find the 2nd dot
AppVersionFinal=???????????????????? How can Extract the value between the first dot and the 2nd dot?
DbVersionFinal= ?????????????????????
How can Extract the value between the first dot and the 2nd dot?
Bwrongposition=??????????
Can you help?
Thanks
Gabriel