S
Scott McNair
What's your favorite bit of "short-cut" code that you use?
One of my favorite shortcuts I'll use when coding a page is to create a sub
along the lines of the following:
Sub Print(myText)
Response.Write myText & vbcrlf
End Sub
And then I use Print instead of Response.Write thru my code.
I do this for several reasons:
A) I'm an old-skool coder, and I started coding back in the days when you
wrote to the screen with "PRINT"
B) It's shorter than doing Response.Write [insert string here] & vbcrlf for
every instance where you want to write to the client.
C) It's easier to use for debug purposes: If for example I want to do a
time-trace to see where a slow-down is occuring, I'll change the code to
Response.Write "<!--" & Now() & "-->" & myText
D) If I want to adapt a particular snippet of code for client-side, I'll
usually just have to copy/paste (along with minor changes), and include the
Print sub, except with Response.Write changed to Document.Write.
One of my favorite shortcuts I'll use when coding a page is to create a sub
along the lines of the following:
Sub Print(myText)
Response.Write myText & vbcrlf
End Sub
And then I use Print instead of Response.Write thru my code.
I do this for several reasons:
A) I'm an old-skool coder, and I started coding back in the days when you
wrote to the screen with "PRINT"
B) It's shorter than doing Response.Write [insert string here] & vbcrlf for
every instance where you want to write to the client.
C) It's easier to use for debug purposes: If for example I want to do a
time-trace to see where a slow-down is occuring, I'll change the code to
Response.Write "<!--" & Now() & "-->" & myText
D) If I want to adapt a particular snippet of code for client-side, I'll
usually just have to copy/paste (along with minor changes), and include the
Print sub, except with Response.Write changed to Document.Write.