Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Using CleanCode Function
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 23 February 2001 :  16:42:32  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
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  Show Profile  Visit HuwR's Homepage
try putting a response.write fstring just prior to 25 followed by response.end

what does it think fstring is ?

Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 23 February 2001 :  18:03:48  Show Profile
fstring must be null

======
Doug G
======
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 25 February 2001 :  08:59:16  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
This is exactly what it thinks fstring is without the quotes....

"This is the test message"

Brad
Go to Top of Page

Goose
New Member

Denmark
74 Posts

Posted - 05 April 2001 :  19:14:23  Show Profile  Visit Goose's Homepage  Send Goose an ICQ Message
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
Go to Top of Page

TimV
Starting Member

6 Posts

Posted - 10 April 2001 :  03:37:11  Show Profile
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
Go to Top of Page

Nevyn
Starting Member

1 Posts

Posted - 10 April 2001 :  07:20:30  Show Profile  Send Nevyn an ICQ Message
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

Go to Top of Page

TimV
Starting Member

6 Posts

Posted - 10 April 2001 :  11:20:20  Show Profile
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
Go to Top of Page

TimV
Starting Member

6 Posts

Posted - 11 April 2001 :  05:06:29  Show Profile
quote:
it replace [url=http://bla.com]bla[/url] to :


"All" "Your" "Quotes" "Are" "Belong" "To" "Us" "!!"

Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 11 April 2001 :  11:39:40  Show Profile
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

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 3.09 seconds. Powered By: Snitz Forums 2000 Version 3.4.07