Yep, In the end I came up with a similar solution last night.

 eg 
{$I RMINUS.INC}
 //code that always requires no range checking due to Delphi range check bugs
{$I RPLUS.INC}

And these had in them
{$IFOPT R+} {$R-} {$DEFINE RPLUS} {$ENDIF}

{$IFDEF RPLUS} {$R+} {$UNDEF RPLUS} {$ENDIF}
Myles

-----Original Message-----
From:   Rohit Gupta [SMTP:[EMAIL PROTECTED]]
Sent:   Thursday, May 13, 1999 10:33 PM
To:     Multiple recipients of list delphi
Subject:        Re: [DUG]:  Can you stack compiler directives?

Myles,

The only way to do it is to have the options in another file that you 
include....

  // Set default options
  {$I OPTIONS}

  //Must Always be R-
  {$R-}
  blah blah

  //Reset default options
  {$I OPTIONS}



On 12 May 99 at 12:15, Myles Penlington wrote:

> Is there a better way to do this -
>     {$IFOPT R+}
>       {$R-}
>         numnames :=3D ntohl(FromServ.NameCount);
>       {$R+}
>     {$ELSE}
>         numnames :=3D ntohl(FromServ.NameCount);
>     {$ENDIF}
> 
> Why have I done this - Delphi Range checking is no good on 32 bit =
> numbers - especially when dealing with this network stuff, as the byte =
> order has to be swapped.
> 
> I would have liked to do
>  {$ Stack current $R value
>  {$R-}
>  numnames :=3D ntohl(FromServ.NameCount); // Must always compile with =
> range checking off.
>  {$ Unstack old $R value}
> 


Rohit

======================================================================
CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New Zealand
PH    (649) 489-2280 
FX    (649) 489-2290
email [EMAIL PROTECTED]  or  [EMAIL PROTECTED]
======================================================================

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

application/ms-tnef

Reply via email to