Having a general understanding of how memory and addressing works, helps you understand pointers in Delphi (and C/C++). Learning assembler also gives you that knowledge, but there are simpler ways to think about it.
A pointer is a memory location that contains the address to the actual data you want.
Think of a street with houses. Make a list of the houses and their addresses. This is a list of pointers. Each pointer in the list leads to the actual house it refers to.
You would expect to see x vary in the order of the values in the list.
However – if x and the values are of an enumerated type, looping the “list” does NOT loop in the apparent order of the constant, but in the order of the enumerated type declaration, such as it would for any set.
I was writing a web request handler when I ran into a problem. I was plugging in multiple handlers, but only one of them actually worked.
To get to the essence of it, this doesn’t work
for hType in [foo, bar]
case hType of
foo: Handler := TFoo.Create;
bar: Handler := TBar.Create;