Johan Åhlgren

Projects

Getting by without loops


Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

In functional languages, there are typically no loops – there is no way to write a for, while or repeat expression. There are basically two ways to implement what in an imperative lanugage would require loops. The first one is…

Iterating over a sequence using “for .. in”


Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

The for .. in construct was added to Delphi 2005 and allows you to iterate over arrays, lists and other container objects. In this article I will show you how to implement a class that provides this capacity. I will…

Creating a quiz web application in Delphi, part 3


Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

The easiest way to implement an HTTP server is to drop a TIdHTTPServer component (part of the Indy package, included with Delphi) onto a form or data module, create a handler for its OnCommandGet event (which strikes when a client…

Creating a quiz web application in Delphi, part 2


Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

In a traditional desktop application, the application holds its own data and that data is available whenever we need to present it to the user. In a web application, the data is stored on the web server and the client…

Creating a quiz web application in Delphi, part 1


Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

While surfing the net the other day, I stumbled across a quiz that I decided to take. You know the kind – you are asked a question and you may choose one of typically four alternative answers. After a specific…

Project 1: Building the parse tree


Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Now that we have finished our tokenizer, we will look at the second task: building the parse tree. Once we have that, we can ask the tree if a set of strings are a valid match or not. More precisely,…

Project 1: Tokenization


Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118

Notice: A non well formed numeric value encountered in /www/webvol1/lw/n1mf7j21f9a4rkg/johanahlgren.se/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

Our tokenizer will perform one task – it will take a sequence of characters and emit a sequence of tokens. We will build it using an input stream from which the source characters are fetched, and then implement specific methods…