Hello,
I am building a calendar listing using ASP and VBScript. The calendar contains a field that list a description of an event, which could be more than 255 characters long (Access 2000 database...set as a Memo datatype). I only want to show the first 275 characters of the event description, but want to make sure that I always end on a space, instead of mid-word. Would I need to use the Mid function or the InStr function or both?
I can use the MID function to search for a " " 275 characters out from the left. If a " " exists, then I want to write the contents of shortDesc up to that point, add ... and have the reader click on a link to view the entire contents of the event description. But, if MID(shortDesc, 275, 1) <> " ", then I want to search for the last instance of " " within the first 275 characters, add ... and have the reader click on a link to view the entire contents of the event description. Should I use the InStr to accomplish that?
This is what I am after:
Tuesday, October 25, 2007 10:00 AM to 12:00 PM read more...
This is only a test of the class calendar. This test is just full of blank, non-meaningful data that is entered to merely represent what a true calendar event for The Leadership Organization would look like. Hopefully, it represents well once in a productio...
at Westin Hotel, Somewhere
Any help would be most appreciated!
Thanks,
GC
I am building a calendar listing using ASP and VBScript. The calendar contains a field that list a description of an event, which could be more than 255 characters long (Access 2000 database...set as a Memo datatype). I only want to show the first 275 characters of the event description, but want to make sure that I always end on a space, instead of mid-word. Would I need to use the Mid function or the InStr function or both?
I can use the MID function to search for a " " 275 characters out from the left. If a " " exists, then I want to write the contents of shortDesc up to that point, add ... and have the reader click on a link to view the entire contents of the event description. But, if MID(shortDesc, 275, 1) <> " ", then I want to search for the last instance of " " within the first 275 characters, add ... and have the reader click on a link to view the entire contents of the event description. Should I use the InStr to accomplish that?
This is what I am after:
Tuesday, October 25, 2007 10:00 AM to 12:00 PM read more...
This is only a test of the class calendar. This test is just full of blank, non-meaningful data that is entered to merely represent what a true calendar event for The Leadership Organization would look like. Hopefully, it represents well once in a productio...
at Westin Hotel, Somewhere
Any help would be most appreciated!
Thanks,
GC