Re: Could someone explain this variable please



On Sun, 24 Apr 2005 17:21:48 +0000 (UTC), Marco van de Voort
<marcov@xxxxxxxx> wrote:

>On 2005-04-24, Tim <tim@xxxxxxxx> wrote:
>>
>> What exactly is this declaring?
>>
>> somevar: 0..100;
>
>It is an integer subtype with range 0..100
>
>> And how and why is it used?
>
>For safety/debugging. When compiled with rangechecking on, an overflow at
>values higher than 100, or below zero will be detected. It also allows the
>compiler to downgrade to a smaller size than integer (e.g. smallint).

Thanks. I think I understand. :-)


.



Relevant Pages

  • Re: Could someone explain this variable please
    ... > What exactly is this declaring? ... > somevar: 0..100; ... It is an integer subtype with range 0..100 ... compiler to downgrade to a smaller size than integer. ...
    (comp.lang.pascal.delphi.misc)
  • Re: register variables
    ... > what is the purpose of declaring a register variable? ... It tells the compiler that you think you have a better ... Prev by Date: ...
    (comp.lang.c)
  • Re: Add new col event?
    ... It's a directive to the compiler that you will be declaring all the variables ... With "Option explicit", the compiler will notice that one of those variables ... Prev by Date: ...
    (microsoft.public.excel)
  • Re: register variables
    ... > what is the purpose of declaring a register variable? ... There is no purpose nowadays. ... The compiler can do a much better ... Prev by Date: ...
    (comp.lang.c)