info-cgicc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[info-cgicc] RE: [help-cgicc] Limits in getDoubleValue and getIntegerVal


From: Stephen F. Booth
Subject: [info-cgicc] RE: [help-cgicc] Limits in getDoubleValue and getIntegerValue
Date: Sun, 24 Nov 2002 19:48:18 -0500

I added these methods to the CVS version of cgicc - look for a new
version in a week or so.  Basically I added the following to FormEntry:
getIntegerValue(int, int, bool&) and getDoubleValue(double, double,
bool&).  The bool& is set to true or false depending on whether or not
the value was clamped to the limits.  Also, the bug fix for
getDoubleValue (the bug you reported) is in there as well.

-Stephen

> -----Original Message-----
> From: address@hidden [mailto:address@hidden On
Behalf
> Of Carsten P. Gehrke
> Sent: Tuesday, November 05, 2002 3:46 AM
> To: Stephen F. Booth; address@hidden
> Subject: RE: [help-cgicc] Limits in getDoubleValue and getIntegerValue
> 
> Ah, I was trying to avoid calling getDoubleValue twice...  Oh well,
> perhaps
> a method or a flag in a future release??  Thanks for your response.
> 
> 
> At 20:14 04-11-02, Stephen F. Booth wrote:
> >There is no built-in function to do what you describe, but I can
think
> >of a fairly simple way to accomplish what you want to do.  If you
call
> >getDoubleValue() with no limits, it will trim the return only to the
> >largest and smallest allowable double values- you could use this
return
> >value and compare it to the returned "trimmed" value- if they
differed
> >you would know that one of your limits was used.
> >
> >Does this help at all?
> >
> > > -----Original Message-----
> > > From: address@hidden [mailto:address@hidden
On
> >Behalf
> > > Of Carsten P. Gehrke
> > > Sent: Saturday, November 02, 2002 4:07 PM
> > > To: address@hidden
> > > Subject: [help-cgicc] Limits in getDoubleValue and getIntegerValue
> > >
> > > As I understand from the documentation and the source code, the
> > > FormEntry::getDoubleValue method silently clamps the returned
value to
> >the
> > > min and max parameters, if these are given.  Is there any way to
check
> >if
> > > the value of the CGI parameter was outside the limits?  E.g. if I
have
> >a
> > > CGI argument list containing d=85.9, and I use
getDoubleValue(-75.0,
> > > 75.0),
> > > the value I get for d will be 75.0, while a CGI with d=75.0 would
also
> > > give
> > > me a value of 75.0.  It would be useful to know that in the first
case
> >the
> > > value of d was outside the limits, while in the second case it was
OK.
> > >
> > > I think the same applies to the getIntegerValue method.
> > >
> > > Thank you,
> > > Carsten
> > >
> 
> --
>
========================================================================
>                              Carsten P. Gehrke
>                       mailto:address@hidden
>
========================================================================
> 
> 
> 
> 
> 
> _______________________________________________
> help-cgicc mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-cgicc






reply via email to

[Prev in Thread] Current Thread [Next in Thread]