Create a .i file with these functions and they will be available all the time use. Just add "{filename.i}" at the beginning of your code.
FUNCTION Ceiling RETURNS INTEGER (INPUT ipdValue AS DECIMAL):
IF (ipdValue LE 0) OR (TRUNCATE(ipdValue,0) = ipdValue) THEN
RETURN INTEGER (TRUNCATE(ipdValue,0)).
ELSE
RETURN integer(TRUNCATE(ipdValue,0) + 1).
END.
FUNCTION Floor RETURNS INTEGER (INPUT ipdValue AS DECIMAL):
IF (ipdValue GE 0) OR (TRUNCATE(ipdValue,0) = ipdValue) THEN
RETURN INTEGER (TRUNCATE(ipdValue,0)).
ELSE
RETURN integer(TRUNCATE(ipdValue,0) - 1).
END.
FUNCTION Ceiling RETURNS INTEGER (INPUT ipdValue AS DECIMAL):
IF (ipdValue LE 0) OR (TRUNCATE(ipdValue,0) = ipdValue) THEN
RETURN INTEGER (TRUNCATE(ipdValue,0)).
ELSE
RETURN integer(TRUNCATE(ipdValue,0) + 1).
END.
FUNCTION Floor RETURNS INTEGER (INPUT ipdValue AS DECIMAL):
IF (ipdValue GE 0) OR (TRUNCATE(ipdValue,0) = ipdValue) THEN
RETURN INTEGER (TRUNCATE(ipdValue,0)).
ELSE
RETURN integer(TRUNCATE(ipdValue,0) - 1).
END.
--- In vantage@yahoogroups.com, "jckinneman" <jckinneman@...> wrote:
>
> I found the same, my approach uses the truncate function to strip off the decimal part then do a compare to see if the values are the same if there aren't add 1. Same result as your approach, just a different way around the tree ending up at the same point. The truncate gives you the floor value as the intermediate value.
>
> syntax not verified
>
> if (truncate(x,0) EQ x) then truncate(x, 0) else truncate(x , 0) + 1.
>
> Jim Kinneman
> Encompass Solutions, Inc
>
> --- In vantage@yahoogroups.com, Jose Gomez <jose@> wrote:
> >
> > Anyone know if there is a ceiling function in ABL /4GL I can't seem to find
> > one. I got around it by using ROUND(X) +1 if ROUND(X) < X but still.
> > Thanks!
> > *Jose C Gomez*
> > *Software Engineer*
> > *
> > *
> > *checkout my new blog <http://www.usdoingstuff.com> *
> > *
> > *T: 904.469.1524 mobile
> > E: jose@
> > http://www.josecgomez.com
> > <http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
> > <http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
> > <http://www.josecgomez.com/professional-resume/>
> > <http://www.josecgomez.com/feed/>
> > <http://www.usdoingstuff.com>
> >
> > *Quis custodiet ipsos custodes?*
> >
> >
> > [Non-text portions of this message have been removed]
> >
>