Print Page | Close Window

Help with some code...

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=21574
Printed Date: 29 March 2026 at 7:40pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Help with some code...
Posted By: kwouters
Subject: Help with some code...
Date Posted: 12 October 2006 at 1:28pm

Hi There,

I'm using Ezaspsite for my homepage. An item on the mainpage is news.
When I put news on it often doesn't display what I want it to.
I found out that the lenght of the news on the mainpage is hardcoded. I put the code below. I already changed the number from 350 to 500.
Can anyone help me to change this code into something that reads the item and displays it until it runs across e.g. [#] or something.

Thanks in advance..

Greetings, Koen

If blnWordCut = True Then
  If len(strNewsItem)>500 then
   strNewsItem = left(strNewsItem,500) & "<br><br><a href=""forum/forum_posts.asp?TID=" & intNewsID & """ class=""text2"" alt="""& strTxtShowMore &""" title="""& strTxtShowMore &""">"& strTxtShowMore &"</a>"
                        strMore = True
  End If
End If




Replies:
Posted By: jeffdaro
Date Posted: 12 October 2006 at 4:35pm
Are you saying you want it to include all text from strNewsItem up to and excluding a delimiter like '#'? If that's what you mean then you can do something like this...

Originally posted by Code Sample Code Sample wrote:


Dim intDelimiterPos

    intDelimiterPos = instr(1, strNewsItem, '#')

    If intDelimiterPos > 0 then
        strNewsItem = mid(strNewsItem, 1, intDelimiterPos - 1)
    End if



Posted By: kwouters
Date Posted: 13 October 2006 at 8:51am
@jeffdaro: Thanks for this code... I've tried it, and it works perfect.
The most articles now are showing complete (some mistakes*), and when I put in the # the article is shown up to there.
 
* Mistakes: Some articles containing pictures and links don't fully show. It looks like a limit in characters, but I can't figure out where it is. I will be looking into that.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net