<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
I have been pondering with that idea ever since the implementation
of strings for case.<br>
This morning I remembered again why it may be useful.<br>
Consider this code vs the alternative I suggest.<br>
Plz. do not value the code, it is just copied from the forum and
frankly not the point but an illustration:<br>
<div class="pascal geshi" style="font-family:monospace;">
<ol>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"><span
style="color: #000000; font-weight: bold;">procedure</span>
TFrame00<span style="color: #000066;">.</span><span
style="color: #006600;">ComboBoxChanged</span><span
style="color: #009900;">(</span>Sender<span style="color:
#000066;">:</span> TObject<span style="color: #009900;">)</span><span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"><span
style="color: #000000; font-weight: bold;">Var</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> x <span
style="color: #000066;">:</span> TComboBox<span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"><span
style="color: #000000; font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">If</span> <span
style="color: #009900;">(</span>Sender Is TComboBox<span
style="color: #009900;">)</span> <span style="color:
#000000; font-weight: bold;">Then</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> x <span
style="color: #000066;">:</span><span style="color:
#000066;">=</span> <span style="color: #009900;">(</span>Sender
As TComboBox<span style="color: #009900;">)</span><span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> </div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">case</span> x<span
style="color: #000066;">.</span><span style="color:
#000000; font-weight: bold;">Name</span> <span
style="color: #000000; font-weight: bold;">of</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #ff0000;">'ComboBox01'</span><span
style="color: #000066;">:</span><span style="color:
#000000; font-weight: bold;">if</span> x<span
style="color: #000066;">.</span><span style="color:
#006600;">ItemIndex</span> <span style="color: #000066;">=</span>
<span style="color: #000066;">-</span><span style="color:
#cc66cc;">1</span> <span style="color: #000000;
font-weight: bold;">then</span> x<span style="color:
#000066;">.</span><span style="color: #006600;">ItemIndex</span>
<span style="color: #000066;">:</span><span style="color:
#000066;">=</span> PrjIndex <span style="color: #000000;
font-weight: bold;">else</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">end</span><span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #ff0000;">'ComboBox02'</span><span
style="color: #000066;">:</span><span style="color:
#000000; font-weight: bold;">if</span> x<span
style="color: #000066;">.</span><span style="color:
#006600;">ItemIndex</span> <span style="color: #000066;">=</span>
<span style="color: #000066;">-</span><span style="color:
#cc66cc;">1</span> <span style="color: #000000;
font-weight: bold;">then</span> x<span style="color:
#000066;">.</span><span style="color: #006600;">ItemIndex</span>
<span style="color: #000066;">:</span><span style="color:
#000066;">=</span> HubIndex <span style="color: #000000;
font-weight: bold;">else</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">end</span><span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #ff0000;">'ComboBox03'</span><span
style="color: #000066;">:</span><span style="color:
#000000; font-weight: bold;">if</span> x<span
style="color: #000066;">.</span><span style="color:
#006600;">ItemIndex</span> <span style="color: #000066;">=</span>
<span style="color: #000066;">-</span><span style="color:
#cc66cc;">1</span> <span style="color: #000000;
font-weight: bold;">then</span> x<span style="color:
#000066;">.</span><span style="color: #006600;">ItemIndex</span>
<span style="color: #000066;">:</span><span style="color:
#000066;">=</span> RimIndex <span style="color: #000000;
font-weight: bold;">else</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">end</span><span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #ff0000;">'ComboBox04'</span><span
style="color: #000066;">:</span><span style="color:
#000000; font-weight: bold;">if</span> x<span
style="color: #000066;">.</span><span style="color:
#006600;">ItemIndex</span> <span style="color: #000066;">=</span>
<span style="color: #000066;">-</span><span style="color:
#cc66cc;">1</span> <span style="color: #000000;
font-weight: bold;">then</span> x<span style="color:
#000066;">.</span><span style="color: #006600;">ItemIndex</span>
<span style="color: #000066;">:</span><span style="color:
#000066;">=</span> SpkIndex <span style="color: #000000;
font-weight: bold;">else</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">end</span><span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">end</span><span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">End</span><span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"><span
style="color: #000000; font-weight: bold;">end</span><span
style="color: #000066;">;</span> </div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> </div>
</li>
<li style="white-space: nowrap; padding: 0 5px;
background-color: #fff; line-height: 16px; border-left: 1px
solid #999;"><br>
</li>
</ol>
</div>
Now how much nicer it would be if you could write someting along
the lines of:<br>
<br>
<ol>
<li style="white-space: nowrap; padding: 0 5px; background-color:
#fff; line-height: 16px; border-left: 1px solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"><span
style="color: #000000; font-weight: bold;">procedure</span>
TFrame00<span style="color: #000066;">.</span><span
style="color: #006600;">ComboBoxChanged</span><span
style="color: #009900;">(</span>Sender<span style="color:
#000066;">:</span> TObject<span style="color: #009900;">)</span><span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px; background-color:
#fff; line-height: 16px; border-left: 1px solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"><span
style="color: #000000; font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px; background-color:
#fff; line-height: 16px; border-left: 1px solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">If</span> Sender
Is TComboBox <span style="color: #000000; font-weight: bold;">Then</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px; background-color:
#fff; line-height: 16px; border-left: 1px solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">case</span>
TCombobox<span style="color: #009900;">(</span>sender<span
style="color: #009900;">)</span> <span style="color:
#000000; font-weight: bold;">of</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px; background-color:
#fff; line-height: 16px; border-left: 1px solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> Combobox1<span
style="color: #000066;">:;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px; background-color:
#fff; line-height: 16px; border-left: 1px solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> ComboBox2<span
style="color: #000066;">:;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px; background-color:
#fff; line-height: 16px; border-left: 1px solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> ComboBox3<span
style="color: #000066;">:;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px; background-color:
#fff; line-height: 16px; border-left: 1px solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"> <span
style="color: #000000; font-weight: bold;">end</span><span
style="color: #000066;">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0 5px; background-color:
#fff; line-height: 16px; border-left: 1px solid #999;">
<div style="font: normal normal 1em/1.2em monospace; margin:0;
padding:0; background:none; vertical-align:top;"><span
style="color: #000000; font-weight: bold;">end</span><span
style="color: #000066;">;</span> <br>
</div>
</li>
</ol>
In other words, use the instance pointer as an ordinal value.<br>
It looks a lot more logical but as it stands it is of course invalid
syntax.<br>
Is it possible to implement?<br>
If so, has it any value? To me at least it looks feasable and less
like syntactic sugar than some features.<br>
</body>
</html>