B buras3 Active Member Licensed User Longtime User Oct 30, 2012 #1 hello i am trying to replace the ' char to char(96) because it's making error when you have this char in a word Sub FixStr(Word As String) As String Dim NewWord As String Dim Tav As Char NewWord="" For i =1 To Word.Length Tav=Word.CharAt(i) If Tav =Chr(34) Then Tav=Chr(96 ) End If NewWord=NewWord & Tav Next i Return NewWord End Sub I am getting the error: NewWord=NewWord & Tav javac 1.6.0_30 src\michael\CallStat\funcs.java:105: not a statement _i; ^ 1 error what can i do? tank you
hello i am trying to replace the ' char to char(96) because it's making error when you have this char in a word Sub FixStr(Word As String) As String Dim NewWord As String Dim Tav As Char NewWord="" For i =1 To Word.Length Tav=Word.CharAt(i) If Tav =Chr(34) Then Tav=Chr(96 ) End If NewWord=NewWord & Tav Next i Return NewWord End Sub I am getting the error: NewWord=NewWord & Tav javac 1.6.0_30 src\michael\CallStat\funcs.java:105: not a statement _i; ^ 1 error what can i do? tank you
klaus Expert Licensed User Longtime User Oct 30, 2012 #2 You must replace Next i by Next Chr(34) is the character " double quote Chr(39) is ' single quote You can also write your routine like this : Code: Copy Sub FixStr(Word As String) As String Word = Word.Replace(Chr(34), Chr(96)) Return Word End Sub Best regards. Upvote 0
You must replace Next i by Next Chr(34) is the character " double quote Chr(39) is ' single quote You can also write your routine like this : Code: Copy Sub FixStr(Word As String) As String Word = Word.Replace(Chr(34), Chr(96)) Return Word End Sub Best regards.
B buras3 Active Member Licensed User Longtime User Oct 30, 2012 #3 Tank you that was helpful I meant Word = Word.Replace(Chr(39), Chr(96)) michael Upvote 0