<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 21/02/2016 11:15, Sven Barth wrote:<br>
</div>
<blockquote
cite="mid:CAFMUeB--iPeDJjo2ZsaW9LhzVT7MSs6unCmXRUhcKEEGWP3kLA@mail.gmail.com"
type="cite">Would it be possible to implement? Yes<br>
<p>
Would that mean that instance pointers would be handled as
ordinal values? No, because "case" is merely a parser construct.
In principle the condition and the case labels could be
anything. String constants aren't ordinal values after all
either.<br>
It might look logical but it would be a complete paradigm shift
for case-statements, because the case labels are supposed to be
constant values (ordinal, including enums and string constants)
while variables (local, global, fields) are not constants
however.</p>
</blockquote>
And there lies the problem.<br>
<br>
Case labels do not allow duplicates. But if they are variables, then
this can not be checked at compile time.<br>
So this must either throw an exception, or add/change the evaluation
of the "case" to have a precedence between the "labels", and decide
if only the first or all matches are executed.<br>
<br>
<blockquote type="cite">
<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> </div>
</li>
</ol>
</blockquote>
<br>
</body>
</html>