Showing posts with label event. Show all posts
Showing posts with label event. Show all posts

Wednesday, 28 March 2012

ASP: calculate if a number is odd or even

   


In this short post I will explain something that I see asked often on forums and ASP help site.
How can we calculate if a number is even or odd?

The question is quite easy and the answer is hidden in the MOD function. I've talked about that function in a past article (ASP: resulting recordset in two columns), where we used the MOD function in order to create a two columns table and display data using the same table.

As a reminder, "the MOD function provides the remainder value in a division. The remainder is what's left over after you do a division."
Apart from the fact that I'm starting to quote myself - and I probably should talk to my wife who is a psychotherapist, it is quite easy, even if you are not a math expert, to understand how we can benefit from the MOD function to determine if a number is odd or even.

Wednesday, 14 December 2011

ASP: a tutorial for beginners

   


What is ASP? Which is ASP basic syntax? Objects, methods, properties, events and collections?
AH! Do we really know what we are talking about?

The following post is just a quick reference guide for all those things. It is meant for beginners, but I believe that even experienced programmers might find it useful... just to check if everything we know is correct.

What is ASP?
ASP stands for Active Server Page. In a previous post I've already defined it as a scripting engine. That is because we usually and wrongfully consider ASP as a programming language.
We can use different programming languages in ASP pages, such as VBScript or JScript. Usually, web developers use VBScript, which is ASP default language.
The ASP engine is managed by IIS (Internet Information Services), working in a MS Windows environment. I know that it is possible to use ASP with other web server applications such as Apache.
It is worth mentioning that ASP is working with PWS as well. PWS (Personal Web Server) is a small but fully functional version of IIS and it was available on older operating systems like WIN 95 and 98 (oh what a leap in the past!).