<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
On 02/21/2016 11:37 AM, <a class="moz-txt-link-abbreviated" href="mailto:thaddy@thaddy.com">thaddy@thaddy.com</a> wrote:
<blockquote cite="mid:56C99372.5070005@thaddy.com" type="cite"> <br>
<div class="pascal geshi" style="font-family: monospace;">
<ol>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"><span style="color: rgb(0, 0, 0);
font-weight: bold;">procedure</span> TFrame00<span
style="color: rgb(0, 0, 102);">.</span><span
style="color: rgb(0, 102, 0);">ComboBoxChanged</span><span
style="color: rgb(0, 153, 0);">(</span>Sender<span
style="color: rgb(0, 0, 102);">:</span> TObject<span
style="color: rgb(0, 153, 0);">)</span><span
style="color: rgb(0, 0, 102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"><span style="color: rgb(0, 0, 0);
font-weight: bold;">Var</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> x <span style="color: rgb(0, 0,
102);">:</span> TComboBox<span style="color: rgb(0, 0,
102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"><span style="color: rgb(0, 0, 0);
font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0, 0);
font-weight: bold;">If</span> <span style="color:
rgb(0, 153, 0);">(</span>Sender Is TComboBox<span
style="color: rgb(0, 153, 0);">)</span> <span
style="color: rgb(0, 0, 0); font-weight: bold;">Then</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0, 0);
font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> x <span style="color: rgb(0, 0,
102);">:</span><span style="color: rgb(0, 0, 102);">=</span>
<span style="color: rgb(0, 153, 0);">(</span>Sender As
TComboBox<span style="color: rgb(0, 153, 0);">)</span><span
style="color: rgb(0, 0, 102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> </div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0,
0); font-weight: bold;">case</span> x<span style="color:
rgb(0, 0, 102);">.</span><span style="color: rgb(0, 0,
0); font-weight: bold;">Name</span> <span style="color:
rgb(0, 0, 0); font-weight: bold;">of</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(255, 0,
0);">'ComboBox01'</span><span style="color: rgb(0, 0,
102);">:</span><span style="color: rgb(0, 0, 0);
font-weight: bold;">if</span> x<span style="color:
rgb(0, 0, 102);">.</span><span style="color: rgb(0, 102,
0);">ItemIndex</span> <span style="color: rgb(0, 0,
102);">=</span> <span style="color: rgb(0, 0, 102);">-</span><span
style="color: rgb(204, 102, 204);">1</span> <span
style="color: rgb(0, 0, 0); font-weight: bold;">then</span>
x<span style="color: rgb(0, 0, 102);">.</span><span
style="color: rgb(0, 102, 0);">ItemIndex</span> <span
style="color: rgb(0, 0, 102);">:</span><span
style="color: rgb(0, 0, 102);">=</span> PrjIndex <span
style="color: rgb(0, 0, 0); font-weight: bold;">else</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0,
0); font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0,
0); font-weight: bold;">end</span><span style="color:
rgb(0, 0, 102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(255, 0,
0);">'ComboBox02'</span><span style="color: rgb(0, 0,
102);">:</span><span style="color: rgb(0, 0, 0);
font-weight: bold;">if</span> x<span style="color:
rgb(0, 0, 102);">.</span><span style="color: rgb(0, 102,
0);">ItemIndex</span> <span style="color: rgb(0, 0,
102);">=</span> <span style="color: rgb(0, 0, 102);">-</span><span
style="color: rgb(204, 102, 204);">1</span> <span
style="color: rgb(0, 0, 0); font-weight: bold;">then</span>
x<span style="color: rgb(0, 0, 102);">.</span><span
style="color: rgb(0, 102, 0);">ItemIndex</span> <span
style="color: rgb(0, 0, 102);">:</span><span
style="color: rgb(0, 0, 102);">=</span> HubIndex <span
style="color: rgb(0, 0, 0); font-weight: bold;">else</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0,
0); font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0,
0); font-weight: bold;">end</span><span style="color:
rgb(0, 0, 102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(255, 0,
0);">'ComboBox03'</span><span style="color: rgb(0, 0,
102);">:</span><span style="color: rgb(0, 0, 0);
font-weight: bold;">if</span> x<span style="color:
rgb(0, 0, 102);">.</span><span style="color: rgb(0, 102,
0);">ItemIndex</span> <span style="color: rgb(0, 0,
102);">=</span> <span style="color: rgb(0, 0, 102);">-</span><span
style="color: rgb(204, 102, 204);">1</span> <span
style="color: rgb(0, 0, 0); font-weight: bold;">then</span>
x<span style="color: rgb(0, 0, 102);">.</span><span
style="color: rgb(0, 102, 0);">ItemIndex</span> <span
style="color: rgb(0, 0, 102);">:</span><span
style="color: rgb(0, 0, 102);">=</span> RimIndex <span
style="color: rgb(0, 0, 0); font-weight: bold;">else</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0,
0); font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0,
0); font-weight: bold;">end</span><span style="color:
rgb(0, 0, 102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(255, 0,
0);">'ComboBox04'</span><span style="color: rgb(0, 0,
102);">:</span><span style="color: rgb(0, 0, 0);
font-weight: bold;">if</span> x<span style="color:
rgb(0, 0, 102);">.</span><span style="color: rgb(0, 102,
0);">ItemIndex</span> <span style="color: rgb(0, 0,
102);">=</span> <span style="color: rgb(0, 0, 102);">-</span><span
style="color: rgb(204, 102, 204);">1</span> <span
style="color: rgb(0, 0, 0); font-weight: bold;">then</span>
x<span style="color: rgb(0, 0, 102);">.</span><span
style="color: rgb(0, 102, 0);">ItemIndex</span> <span
style="color: rgb(0, 0, 102);">:</span><span
style="color: rgb(0, 0, 102);">=</span> SpkIndex <span
style="color: rgb(0, 0, 0); font-weight: bold;">else</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0,
0); font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0,
0); font-weight: bold;">end</span><span style="color:
rgb(0, 0, 102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0,
0); font-weight: bold;">end</span><span style="color:
rgb(0, 0, 102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0, 0);
font-weight: bold;">End</span><span style="color: rgb(0,
0, 102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"><span style="color: rgb(0, 0, 0);
font-weight: bold;">end</span><span style="color: rgb(0,
0, 102);">;</span> </div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> </div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);"><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: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"><span style="color: rgb(0, 0, 0);
font-weight: bold;">procedure</span> TFrame00<span
style="color: rgb(0, 0, 102);">.</span><span style="color:
rgb(0, 102, 0);">ComboBoxChanged</span><span style="color:
rgb(0, 153, 0);">(</span>Sender<span style="color: rgb(0,
0, 102);">:</span> TObject<span style="color: rgb(0, 153,
0);">)</span><span style="color: rgb(0, 0, 102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"><span style="color: rgb(0, 0, 0);
font-weight: bold;">begin</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0, 0);
font-weight: bold;">If</span> Sender Is TComboBox <span
style="color: rgb(0, 0, 0); font-weight: bold;">Then</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0, 0);
font-weight: bold;">case</span> TCombobox<span
style="color: rgb(0, 153, 0);">(</span>sender<span
style="color: rgb(0, 153, 0);">)</span> <span
style="color: rgb(0, 0, 0); font-weight: bold;">of</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> Combobox1<span style="color:
rgb(0, 0, 102);">:;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> ComboBox2<span style="color:
rgb(0, 0, 102);">:;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> ComboBox3<span style="color:
rgb(0, 0, 102);">:;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"> <span style="color: rgb(0, 0, 0);
font-weight: bold;">end</span><span style="color: rgb(0,
0, 102);">;</span></div>
</li>
<li style="white-space: nowrap; padding: 0pt 5px;
background-color: rgb(255, 255, 255); line-height: 16px;
border-left: 1px solid rgb(153, 153, 153);">
<div style="font: 1em/1.2em monospace; margin: 0pt; padding:
0pt; background: none repeat scroll 0% 0% transparent;
vertical-align: top;"><span style="color: rgb(0, 0, 0);
font-weight: bold;">end</span><span style="color: rgb(0,
0, 102);">;</span> <br>
</div>
</li>
</ol>
In other words, use the instance pointer as an ordinal value.<br>
</blockquote>
<br>
<br>
The reason this does not work is that Combobox1, Combobox2, ... are
not constants. Replacing the strings in your first example with
Combobox1.Name, Combobox2.Name will also fail to compile.<br>
<br>
Take this example:<br>
=== example begin ===<br>
Program Example;<br>
<br>
{$mode ObjFPC}<br>
<br>
Var<br>
C, D: TObject;<br>
Begin <br>
Case ptruint(C) of<br>
0: ;<br>
1: ;<br>
End;<br>
<br>
Case ptruint(C) of<br>
0: ;<br>
1: ;<br>
ptruint(D): ;<br>
End;<br>
End.<br>
=== example end ===<br>
<br>
The first case will compile, the second will not, failing with a
"Constant Expression expected". So, if you would somehow know the
instance pointers at compile time, you might get away with it ;-)<br>
<br>
-- <br>
<pre class="moz-signature" cols="72">Ewald</pre>
</body>
</html>