Message 1 of 3
Apostrophe in a Function argument

Not applicable
03-07-2001
11:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am writing a calculator that will work with feet and inches.
When I'm passing a figure followed by an apostrophe or a quotation mark (ex.
7' , or 4" ) to a function
I have a type mismatch message.
The function declaration is:
Public Function StringToNumber(strnum As string) As Double
and the line that is calling it is:
Dim n1 As Double
Dim strcbo1 As String
strcbo1 = cbo1.Text
n1 = StringToNumber(strcbo1)
What can I do to solve the problem?
I do not want to check in the calling sub if the last character in string is
' or ".
When I'm passing a figure followed by an apostrophe or a quotation mark (ex.
7' , or 4" ) to a function
I have a type mismatch message.
The function declaration is:
Public Function StringToNumber(strnum As string) As Double
and the line that is calling it is:
Dim n1 As Double
Dim strcbo1 As String
strcbo1 = cbo1.Text
n1 = StringToNumber(strcbo1)
What can I do to solve the problem?
I do not want to check in the calling sub if the last character in string is
' or ".