The ASP cheat sheet is designed to act as a reminder and reference sheet, listing various of the oft-forgotten parts of ASP / VBScript. I no longer work full-time with ASP, so to ensure the cheat sheet was as helpful as possible, I roped in one Allan Wenham, an excellent ASP / .NET developer, to assist. Thanks Al!
A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size ASP cheat sheet.
VBScript has support for regular expressions, for pattern matching and replacements in strings. This section lists the various symbols used in regular expression patterns along with their meanings.
Date Function Arguments
VBScript's date function(s) can take several different arguments, all with their own simple codes (eg Year, Month, Day, Week etc). This section lists these codes and meanings.
Redirect With 301 Header
I appreciate this is a little unusual for a cheat sheet, but I find myself needing this with alarming regularity. VBScript's Response.Redirect function by default sends a "302" header, telling the recipient the page they were looking for has moved temporarily. A "301" header tells the recipient the page has moved permanently - and in SEO terms the ability to send 301 headers is very important. These lines of code are an alternative to Response.Redirect.
Include a File
I had a little space here. A very little space. So 1 line of code that might prove useful has been roped in to fill it - the code you need to include a file.
Function Argument Orders
Function argument orders are possibly the easiest thing in almost any language to forget. This section lists some common functionns with their argument orders.
When opening files, you can do so in several different ways, each requiring a different file mode. There are not many, but they are easy to forget - and this section lists the 3 file modes with what they do.
Common LCID Codes
LCID codes are used to determine location-related settings, such as date formats, among other things. Personally I find myself fairly often hunting around for LCID code lists. This section lists the most common LCID codes, for the UK, US, France, Germany and Spain.
These three sections list several of the constants used in VBScript. The Date, Comparison and String constants seem to be the ones that people most often use and can least often remember offhand.
Methods and Properties
The Request, Response, Session - and so on - objects all have a variety of methods and properties. This section lists methods and properties with each object.
The functions list contains some of VBScript most used functions, for working with strings, dates, arrays and numbers.
When accessing, for example, data sent by the user, you will often use Request.Querystring or Request.Form. These are both commonly known as collections, and there are fair few of them at your disposal. This section lists those collections.
So now that you know what it does, please feel free to print out the ASP cheat sheet:
And finally, if you like the cheat sheets, and want to say thanks, please consider buying me something from my Amazon Wishlist. Thankyou very much to those who have already hunted it down and sent me something nice - I'm very grateful!
Please note: If you wish to link to the ASP cheat sheet from elsewhere, please link to this page so others find the description, rather than linking directly to the sheet.