Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2005, 11:48 AM
Authorized User
 
Join Date: Jun 2003
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default function issue

can anybody see a problem with this function?

function doCode(fString, fOTag, fCTag, fROTag, fRCTag)
    fOTagPos = Instr(1, fString, fOTag, 1)
    fCTagPos = Instr(1, fString, fCTag, 1)
    while (fCTagPos > 0 and fOTagPos > 0)
        fString = replace(fString, fOTag, fROTag, 1, 1, 1)
        fString = replace(fString, fCTag, fRCTag, 1, 1, 1)
        fOTagPos = Instr(1, fString, fOTag, 1)
        fCTagPos = Instr(1, fString, fCTag, 1)
    wend
    doCode = fString
end function
 
Old May 6th, 2005, 10:03 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Waht are you trying to acieve?
What exact error are you getting?
Exactly where does the error occur?

All that type of stuff will help others help you...

Wind is your friend
Matt
 
Old May 7th, 2005, 01:53 AM
Authorized User
 
Join Date: Jun 2003
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the function is meant to modifiy the rs("field") coming from database into html tags.
is used with another function
function formatstring(fString)
  fString = docode(fString, "", , "<b>", "</b>")
...
end function

on the page called as this

<%=formatstring(rs("field"))%>

the error is Type mistmatched
 
Old May 7th, 2005, 09:06 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;the error is Type mistmatched
As I asked above, where is this error happening? Do you have 'show friendly http error turned off' if so this should give you a line number also.

Tricky to troubleshoot. EG what types of data are being passed in these variables:
fString, fOTag, fCTag, fROTag, fRCTag

IMO looks like a verbose way to generate some html. Perhaps there is a better way to get the result you are looking for. If you could elaborate on:
;;;the function is meant to modifiy the rs("field") coming from database into html tags.
What is your objective? Eg I am dealing with a RS that is a string data type, if the string = "fffffff" and the first char is a "f" then wrap it in the following html tags else...

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with replace function using regex avator BOOK: Beginning Regular Expressions 0 May 26th, 2008 03:46 AM
Date function issue Grafixx01 Access 2 April 11th, 2007 02:32 PM
send variable in function to another function schoolBoy Javascript How-To 6 March 3rd, 2007 09:16 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
retreive function/Line from macro or function? MikoMax J2EE 0 April 1st, 2004 04:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.