by Dan Walter (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 7th October 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Convert a String to an Integer
Dim temp, ch As String
Dim i, mult As Integer
temp = s
i = 0
mult = 1
While Len(temp) <> 0
ch = Right(temp, 1)
i = i + mult * (Asc(ch) - Asc("0"))
mult = mult * 10
temp = Left(temp, Len(temp) - 1)
Wend
Str2Int = i
End Function