A r t i c l e s
Navigation

Note: This Wiki is
outdated, personal views
may have changed.
L505 A.I. bot is dead
long live THX 1138

M a i n P a g e

D i r e c t o r y

Pascal Looping Through The Alphabet


The procedure below is a quick and easy way to loop through the alphabet as if it were your friend.
procedure LoopAlphabet;
var
  i: integer;
begin
  for i:= ord('a') to ord('z') do
    writeln(chr(i));
end;

Real world example:
You have a list of URL's to grab from the internet and the first URL has a URL parameter or URL variable with A, while the last URL you need to get has a URL variable or URL parameter of Z. Quick and easy solution above, rather than trying to define your own constants or cutting/copying and pasting each letter into code.

Or say you wanted to build a program that downloaded a dictionary.


Loops are your friend - and not for just numbers.

About
Note: This Wiki is outdated, personal views may have changed.

This wiki contains info on life, health, humans, nature, programming, database, fads, paradigms, poems, principles, theories.

Articles may contain statements which some may find helpful and encouraging, or even discouraging.

Beware, I believe in the Grand Justice system.
_ _ _