[Lazarus] errors: Upper bound of case range is less than lower bound and duplicate case label

Eric Kom erickom at metropolitancollege.co.za
Tue Jan 22 20:48:17 CET 2013


On 21/01/2013 21:11, Sven Barth wrote:
> On 21.01.2013 15:37, Flávio Etrusco wrote:
>> On Mon, Jan 21, 2013 at 7:00 AM, Sven Barth 
>> <pascaldragon at googlemail.com> wrote:
>>> Am 21.01.2013 04:54, schrieb Alexander Klenin:
>>>
>>>> On Mon, Jan 21, 2013 at 4:43 AM, Sven Barth 
>>>> <pascaldragon at googlemail.com>
>>>> wrote:
>>>>>>
>>>>>>       case gradeSelected of
>>>>>>            '12'..'12': tuitionFee := '14500.00';
>>>>>
>>>>>
>>>>>              ^       ^   This should be easy to spot...
>>>>
>>>> No, the error is in the line below.
>>>>
>>>>>>            '8'..'11' : tuitionFee := '13500.00';
>>>>
>>>> Note that strings are not numbers, so '8' > '11'.
>>>> Also, '1' < '11' < '7' < '8', so case branch labels intersect, which
>>>> is the reason for the second error.
>>>>
it works! after I have removed  the single quote and converted 
gradeSelected from string to integer.

Thanks for your contributions.
>>> Right... I forgot that this is a case of string -.-
>>>
>>> Regards,
>>> Sven
>>
>> Should case of string really allow ranges?
>
> THAT is an interesting question.
>
> Regards,
> Sven
>
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>


-- 
Kind Regards

Eric Kom

System Administrator & Programmer - Metropolitan College
  _________________________________________
/ You are scrupulously honest, frank, and \
| straightforward. Therefore you have few |
\ friends.                                /
  -----------------------------------------
    \
     \
         .--.
        |o_o |
        |:_/ |
       //   \ \
      (| Kom | )
     /'\_   _/`\
     \___)=(___/

2 Hennie Van Till, White River, 1240
Tel: 013 750 2255 | Fax: 013 750 0105 | Cell: 078 879 1334
erickom at kom.za.net | erickom at metropolitancollege.co.za
www.kom.za.net | www.kom.za.org | www.erickom.co.za

Key fingerprint: 513E E91A C243 3020 8735 09BB 2DBC 5AD7 A9DA 1EF5





More information about the Lazarus mailing list