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

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Code-ReUse and Performace
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

manji
Starting Member

USA
7 Posts

Posted - 11 September 2002 :  10:34:14  Show Profile  Visit manji's Homepage
I have scoured the source code to replace any tags that are created over and over with Render tags that I've used personally. String concetation takes up alot of processing, instead just response.write data and let the user's browser or webserver append and output the data as it is built instead of concetating the strings.

Below are several routines that demonstrate the code reuse I have done, I'm still working. I suggest this highly, especially for those who want to convert to CSS, it'd be much easier to modify. Just modify the render tags for CSS instead of scouring the overwhelming amount of lines to add CSS support.


sub RenderOpenFontTag(strFontFace, strFontSize)
	Response.Write "<font face="""
	Response.Write strFontFace
	Response.Write """ size="""
	Response.Write strFontSize
	Response.Write """>"
end sub

sub RenderOpenFontColorTag(strFontFace, strFontSize, strFontColor)
	Response.Write "<font face="""
	Response.Write strFontFace
	Response.Write """ size="""
	Response.Write strFontSize
	Response.Write """ color="""
	Response.Write strHeadFontColor
	Response.Write """>"
end sub

sub RenderOpenTdTag(strAlign, strBgcolor, bNoWrap, strValign)
	Response.Write "<td align="""
	Response.Write strAlign
	Response.Write """ bgcolor="""
	Response.Write strBgcolor
	Response.Write """"
	if bNoWrap then Response.Write " nowrap"
	Response.Write " valign="""
	Response.Write strValign
end sub


Another note, to format the page sourcewith vbCrLf and vbTab, I usually make a constants such as vbTab2 and vbTab3. In this way the string concetation of tabs only occurs once in a page request.

Anyways, these are just suggestions... Keep up the great work!
  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 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07