|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am a VB newbie, and im am getting this Type Mismatch error for 2 days now, and i can't get rid of it. Can someone please help?
This is the function code where the error occures. '******************************************* ' Procedure nawwen '******************************************* Public Function nawwen(str11, str22) Dim iii Dim jjj jjj = 1 For iii = 1 To Len(str22) If mid(str22, iii, 1) = " " Then str11(jjj) = "Ç" jjj = jjj+1 str11(jjj) = "õ" jjj = jjj+1 Else str11(jjj) = mid(str22, iii, 1) End If jjj = jjj+1 Next str11(jjj) = "Ç" jjj = jjj+1 str11(jjj) = "õ" jjj = jjj+1 Delete str11, jjj, 1000 End Function '**************************************** What's wrong with it? |
|
#2
|
|||
|
|||
|
Hi,
In VB you cannot reference a character position in a string like this: - Code:
str11(jjj) = mid(str22, iii, 1) (If it were C/C++/C# you could...) Build the string up from scratch: Code:
Dim s, myChr as string
s = ""
For iii = 1 To Len(str22)
myChr = mid(str22, iii, 1)
If myChr = " " Then
s = s & "Çõ"
Else
s = s & myChr
End If
Next
Regards, Michiel |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > VB Question????? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|