Thread: Replace
View Single Post
  #3 (permalink)  
Old May 4th, 2005, 04:52 AM
crmpicco crmpicco is offline
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

with that code i get a Compile Error:

Function call on left side of assignment must return Variant or Object

heres my code:

Code:
''''''''''''''''''''''''''''''''''''''''''''''''''''
' Replace Ampersand character with 'AND'
'''''''''''''''''''''''''''''''''''''''''''''''''''

Public Function fix_ampersand(ByVal strValue As String) As String
fix_ampersand = Replace(strValue, "&", "AND")
End Function

''''''''''''''''''''''''''''''''''''''''''''''''''''
' Replace Apostrophe character with 'AND'
'''''''''''''''''''''''''''''''''''''''''''''''''''

Public Function fix_apostrophe(ByVal strValue As String) As String
fix_apostrophe = Replace(strValue, "'", "")
End Function

''''''''''''''''''''''''''''''''''''''''''''''''''''
' Replace Colon character with ''
'''''''''''''''''''''''''''''''''''''''''''''''''''

Public Function fix_colon(ByVal strValue As String) As String
fix_colon = Replace(strValue, ":", "")
End Function

''''''''''''''''''''''''''''''''''''''''''''''''''''
' Replace Comma character with ''
'''''''''''''''''''''''''''''''''''''''''''''''''''

Public Function fix_comma(ByVal strValue As String) As String
fix_comma = Replace(strValue, ",", "")
End Function

''''''''''''''''''''''''''''''''''''''''''''''''''''
' Replace all characters with ""
'''''''''''''''''''''''''''''''''''''''''''''''''''

Public Function fix_characters(ByVal strValue As String) As String
  fix_apostrophe = Replace(strValue, "'", "")
  fix_colon = Replace(strValue, ":", "")
  fix_comma = Replace(strValue, ",", "")
End Function
and where i call it:

Code:
fix_characters(Trim(the_Content))
www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
Reply With Quote