<%@ Language=VBScript %>
<%
Option Explicit
' By declaring 'Option Explicit' all variables
' are required to be initialized using the 'Dim' statement
' The response buffer caches all response data that will be
' sent to the client until the response is finished. Then it
' sends all the data at one time.
Response.Buffer = True ' Enable to improve performance
DisableClientCache.inc immediately below the above opening code
rstCourseList.Close
Set rstCourseList = Nothing
'Free the Session("strCourseID") object
Session.Contents.Remove("strCourseID")
Screen space should be conserved as much as possible, while still allowing code formatting to reflect logic structure and nesting. Indent standard nested blocks one tab or four spaces.
Begin each page with the following documentation:
'*********************************************************
' Purpose: Locates the first occurrence of a specified user in the UserList array.
' Inputs: strUserList(): the list of users to be searched.
' strTargetUser: the name of the user to search for.
' Returns: The index of the first occurrence of the strTargetUser in the strUserList array.
' If the target user is not found, return -1.
'*********************************************************
To enhance readability and consistency, use the following prefixes with descriptive names for variables in your VBScript code.
| Subtype | Prefix | Example |
|---|---|---|
| Boolean | bln | blnFound |
| Byte | byt | bytRasterData |
| Date (Time) | dtm | dtmStart |
| Double | dbl | dblTolerance |
| Error | err | errOrderNum |
| Integer | int | intQuantity |
| Long | lng | lngDistance |
| Object | obj | objCurrent |
| Single | sng | sngAverage |
| String | str | strFirstName |
| ADO Objects | ||
|---|---|---|
| Connection | cnn | cnnDevSQL |
| Field | fld | fldName |
| Recordset | rst | rstStudent |