Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 24th, 2005, 01:24 AM
speakitoutloud speakitoutloud is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 41 speakitoutloud User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 18 m 9 sec
Reputation Power: 4
Question VB Question?????

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?

Reply With Quote
  #2  
Old March 25th, 2005, 02:32 AM
mvagh2 mvagh2 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 324 mvagh2 User rank is Corporal (100 - 500 Reputation Level)mvagh2 User rank is Corporal (100 - 500 Reputation Level)mvagh2 User rank is Corporal (100 - 500 Reputation Level)mvagh2 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 16 h 26 m 36 sec
Reputation Power: 5
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > VB Question?????


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT