Author |
Topic  |
|
redbrad0
Advanced Member
    
USA
3725 Posts |
Posted - 23 February 2001 : 16:42:32
|
I am writing a program that is using Snitz's CleanCode function in the inc_functions.asp file. Im trying to edit an entry which below is the entry....
<b>this is bold</b>
<i>italic</i>
When the cleancode runs.... I get this error...
Microsoft VBScript runtime error '800a005e' Invalid use of Null: 'replace' /gb/inc_functions.asp line 25
line 25 is just where it is trying to do the replace...
fString = replace(fString, "<b>","[b]", 1, -1, 1)
any ideas what might be causing this?
brad |
|
HuwR
Forum Admin
    
United Kingdom
20595 Posts |
Posted - 23 February 2001 : 16:44:38
|
try putting a response.write fstring just prior to 25 followed by response.end
what does it think fstring is ?
|
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 23 February 2001 : 18:03:48
|
fstring must be null
====== Doug G ====== |
 |
|
redbrad0
Advanced Member
    
USA
3725 Posts |
Posted - 25 February 2001 : 08:59:16
|
This is exactly what it thinks fstring is without the quotes....
"This is the test message"
Brad |
 |
|
Goose
New Member

Denmark
74 Posts |
Posted - 05 April 2001 : 19:14:23
|
Just for all to know:
On my installation (Win2K, IIS5, SQL Server 2000) I have isolated this problem to be related to database fields of type Text and nText. A workaround is to place the value of the field in a variable before passing it to CleanCode, ie.:
strMessage = Trim(CleanCode(rs("MyTextField")))
would then be
strMessage = rs("MyTextField") strMessage = Trim(CleanCode(strMessage))
This seems to solve the problem.
Hope this helps someone
Edited by - Goose on 05 April 2001 19:29:09 |
 |
|
TimV
Starting Member
6 Posts |
Posted - 10 April 2001 : 03:37:11
|
if i do it this way, nothing get's replaced:
<!--#INCLUDE FILE="data/inc_functions.asp" --> ... strMessage = rs("cnt_data") strMessage = Trim(CleanCode(strMessage)) ... <%=strMessage%>
this replaces all but the [url=] tags:
<%=formatStr(chkString(rs("cnt_data"), ""))%>
.. anyone got an idea?
Edited by - TimV on 10 April 2001 03:38:34 |
 |
|
Nevyn
Starting Member
1 Posts |
Posted - 10 April 2001 : 07:20:30
|
Hi all
Just a tip when dealing with null values from databases, I've always found it's preferable to add a blank string to the field before trimming it..
strMessage = Trim(rs("Message") & "")
That way, at least you're trimming "", even if you get a null value in rs("Message")
Cheers, Marcus
|
 |
|
TimV
Starting Member
6 Posts |
Posted - 10 April 2001 : 11:20:20
|
plz help :/
everything in the inc_function.asp works except this:
it replace [url=http://bla.com]bla[/url] to :
[url=<a href="http://bla.com">http://bla.com</a>]bla[/url]
instead of <a href="http://bla.com">bla</a>
what can be the reason of this, i recon the sequence is different, but even if i do ReplaceUrls(rs("message") i get this..
[edit] lol! i see the [url= function doesnt work here either :D [/edit]
Edited by - TimV on 10 April 2001 11:21:29 |
 |
|
TimV
Starting Member
6 Posts |
Posted - 11 April 2001 : 05:06:29
|
quote: it replace [url=http://bla.com]bla[/url] to :
"All" "Your" "Quotes" "Are" "Belong" "To" "Us" "!!"
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 11 April 2001 : 11:39:40
|
You need to put quotes around the url. If you looked at the FAQ.asp page that came with your forum (the link is at the top right hand corner) it would show you how to use the [ url ] command. It should be like this:
[ url="http://blah.com" ]blah.com[ /url ]
without the spaces of course, and you would get this:
blah.com
|
 |
|
|
Topic  |
|