Re: checking arbitrary bounds



Pawel Slusarz wrote:
Surely someone must've run into this before. I want to write a
function that combines the functionality of Low() and High().

The difficulty will be that Low and High are compiler-magic functions. Their implementations are built in to the compiler, so you can't duplicate them in normal code.


I usually just let the compiler insert my bound-checking code for me by enabling the range-checking compiler option. And any explicit bound-checking occurs within Assert statements.

--
Rob
.



Relevant Pages

  • Re: SEARCH ALL
    ... > so that it DOES always return a consistent result when there are duplicate ... What criteria should the *compiler* apply unconditionally ... from customers who thought the performance of SEARCH ALL could benefit from ... The requested solution was "We want SEARCH ALL unconditionally to produce ...
    (comp.lang.cobol)
  • Re: Utilty for parsing raw data into C structures
    ... > Depending what's the structure of the data is in ... built with a different compiler. ... built on redhat9 has an NT and a W98 client and a few other RH9 machines all ...
    (comp.os.linux.development.apps)
  • Re: Compilation on VS 2005 Beta 2 is slower than on VS 2003
    ... using the previous built of this same product... ... Every version of Delphi ... >>> We never ship Betas with debug code of symbols. ... >>> I personally haven't noticed this and we are using VS 2005 compiler to ...
    (microsoft.public.vsnet.general)
  • Re: PHP compiler
    ... >built in functions. ... But, anyway, my compiler doesn't have to have more than ... We were working on a Antlr parser for PHP, ... But it does not actually contain any builtin PHP methods. ...
    (alt.php)
  • Re: PHP compiler
    ... >built in functions. ... But, anyway, my compiler doesn't have to have more than ... We were working on a Antlr parser for PHP, ... But it does not actually contain any builtin PHP methods. ...
    (comp.lang.php)