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 Bug Reports (Closed)
 BUG (3.2a6): inc_functions - Spelling/Select Case
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

work mule
Senior Member

USA
1358 Posts

Posted - 15 March 2001 :  09:20:52  Show Profile
This is in regards to the

There is a (minor) spelling mistake in Line 1732 - problem is prolbem

Line 1732
<p align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">There was a prolbem</font></p>

And in regards to the chkString function (starting at Line 378)
Having read that Select statements process quicker than multiple if statements, would writing that function using a select statement be worthwhile? It's a highly used function - could be worth optimizing.

Original
	if fField_Type = "title" then
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
chkBadWords(fString)
chkString = fString
exit function
end if
if fField_Type = "password" then
fString = trim(fString)
chkString = fString
end if
if fField_Type = "decode" then
fString = HTMLDecode(fString)
chkString = fString
exit function
end if
if fField_Type = "urlpath" then
fString = Server.URLEncode(fString)
chkString = fString
exit function
end if
if fField_Type = "SQLString" then
fString = Replace(fString, "'", "''")
fString = HTMLEncode(fString)
chkString = fString
exit function
end if
if fField_Type = "JSurlpath" then
fString = Replace(fString, "'", "\'")
fString = Server.URLEncode(fString)
chkString = fString
exit function
end if
if fField_Type = "display" then
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
chkString = fString
exit function
elseif fField_Type = "message" then
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
elseif fField_Type = "preview" then
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
elseif fField_Type = "hidden" then
fString = HTMLEncode(fString)
end if


Rewritten as Select Case
	Select Case fField_Type
Case "title"
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
chkBadWords(fString)
chkString = fString
exit function
Case "password"
fString = trim(fString)
chkString = fString
Case "decode"
fString = HTMLDecode(fString)
ChkString = fString
exit function
Case "urlpath"
fString = Server.URLEncode(fString)
ChkString = fString
exit function
Case "SQLString"
fString = Replace(fString, "'", "''")
fString = HTMLEncode(fString)
ChkString = fString
exit function
Case "JSurlpath"
fString = Replace(fString, "'", "\'")
fString = Server.URLEncode(fString)
ChkString = fString
exit function
Case "display"
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
ChkString = fString
exit function
Case "message"
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
Case "preview"
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
Case "hidden"
fString = HTMLEncode(fString)
End Select




RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 29 January 2002 :  11:53:54  Show Profile
addressed in v3.4
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07