Prestwood eMag
Our monthly opt-in coupons+newsletter.
|
portal.prestwood.com
|
|
November 2014 - ASP Classic Edition
|
Year 16 Issue 11
|
|
|
|
Your full service technology partner!
|
|
Expert guidance from working professionals!
psSendMail DLL topic:
v1.1 Documentation by Wes Peterson
v1.1 of psSendMail will soon be replaced by v2.
IT Water-Cooler for Power-Users topic:
Setup Exchange E-Mail Queue by Jon Speare
About: An email queue is setup for 2+ workers as a queue where those working the queue move emails to subfolders or delete as they proceed. Subfolders sample: Assigned, Completed, Ignored, etc. Good for groups of staff to work. Our support@prestwood.com is an email queue. Our scheduler and tech staff in our Network Operating Center (NOC) work this queue.
|
Monthly ASP Classic Lesson
|
|
ASP Classic Topic:
Code Snippet of the Month
The following function demonstrates one technique for coding a Yes/No dropdown. It uses a for loop which can be expanded to handle more than the 3 states (Y, N, and blank).
Example of calling the function:
Do you fish? <%=YesNoDropDown("ynFish", "")%>
Function YesNoDropDown(strName, strSelected)
Dim i
Dim strSelectedString
Dim YesNoName
Dim YesNoCode
YesNoName = Array("Yes","No")
YesNoCode = Array("Y","N")
YesNoDropDown = "<select name='" & strName & "'>" & vbcrlf
YesNoDropDown = YesNoDropDown & "<option>" & "--" & "</option>"
For i = 0 To UBound(YesNoName)
If strSelected = YesNoCode(i) Then
strSelectedString = "Selected"
Else
strSelectedString = ""
End If
YesNoDropDown = YesNoDropDown & "<option value='" & YesNoCode(i) & "' " & _
strSelectedString & " >" & YesNoName(i) & "</option>" & vbcrlf
Next
YesNoDropDown = YesNoDropDown & "</select>" & vbcrlf
End Function
Language Details Topic:
Question: What is the syntax in ASP Classic for using an associative array?
Answer: Use a dictionary:
Dim StateList
set StateList = Server.CreateObject("Scripting.Dictionary")
StateList.Add "CA", "California"
Response.Write "NV is " & StateList("NV") For more examples, refer to our ASP Classic Associative Array (Scripting.Dictionary) article.
Language Details Topic:
Tip of the Month
Although you can use the generic request collection, as in Request("SomeValue"), for either Request.Form("SomeValue") or Request.QueryString("SomeValue"), it's best to avoid the generic request collection until it's really needed. Use a For Each loop to loop through elements.
|
|
|