Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 32 total
Thread Has The Lack Of Functions Been A Setback?
Sat, Sep 21 2013 4:31 AMPermanent Link

Frederick Chin

This is my second time evaluating EWB as a serious tool for web application development and I have decided to create a real world application for a school to test it.

At this initial stage, I have had to work around EWB missing a number of useful functions that Delphi provides such as Trunc() and FloatToStrF(). Instead of working on the application itself, I have been pounding out system functions and they are nowhere as complete as Delphi equivalents.

Has this been a setback to your using EWB? Should I be calling a similar working function as trunc() mytrunc()?

Frederick
Sat, Sep 21 2013 11:45 AMPermanent Link

Matthew Jones

<Frederick Chin> wrote:
> This is my second time evaluating EWB as a serious tool for web
> application development and I have decided to create a real world
> application for a school to test it.
>
> At this initial stage, I have had to work around EWB missing a number of
> useful functions that Delphi provides such as Trunc() and FloatToStrF().
> Instead of working on the application itself, I have been pounding out
> system functions and they are nowhere as complete as Delphi equivalents.
>
> Has this been a setback to your using EWB? Should I be calling a similar
> working function as trunc() mytrunc()?

I think I found this one too, but something like Ceil() is available
instead. Basically, there is probably something equivalent there.

--
Matthew Jones
Sun, Sep 22 2013 1:47 AMPermanent Link

Frederick Chin

Matthew Jones wrote:

/*
I think I found this one too, but something like Ceil() is available
instead. Basically, there is probably something equivalent there.
*/

I'd be surprised if Ceil() could be used instead of Trunc(). Surely the return value of Ceil(15.98) is not the same as Trunc(15.98)?

Frederick
Sun, Sep 22 2013 8:26 AMPermanent Link

Matthew Jones

<Frederick Chin> wrote:
> Matthew Jones wrote:
>
> /*
> I think I found this one too, but something like Ceil() is available
> instead. Basically, there is probably something equivalent there.
> */
>
> I'd be surprised if Ceil() could be used instead of Trunc(). Surely the
> return value of Ceil(15.98) is not the same as Trunc(15.98)?

Hence me saying "something like". It rather depends on the purpose of the
call of course. But there may be a suitable equivalent already available.

--
Matthew Jones
Sun, Sep 22 2013 9:35 AMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 9/22/2013 1:47 AM, Frederick Chin wrote:
> I'd be surprised if Ceil() could be used instead of Trunc(). Surely the return value of Ceil(15.98) is not the same as Trunc(15.98)?

In this case you likely want to use Floor function .

In EWB you have Ceil (round up), Floor (round down) or Round for "round
half up" rounding.

Raul
Sun, Sep 22 2013 10:16 AMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 9/21/2013 4:31 AM, Frederick Chin wrote:
> At this initial stage, I have had to work around EWB missing a number of useful functions that Delphi provides such as Trunc() and FloatToStrF(). Instead of working on the application itself, I have been pounding out system functions and they are nowhere as complete as Delphi equivalents.

How about floor for first and how much precision do you need for 2nd one
(floattostr exists). EWB i believe can do up to 16digits precision on
the double value.

> Has this been a setback to your using EWB? Should I be calling a similar working function as trunc() mytrunc()?

Not for us. We don't use the EWB as a general purpose programming
language - in our case it's main value is in being able to rapidly
develop web based front-end (user facing) apps. In our case all the
heavier lifting is done in the back end side so EWB apps deal with UI
and web requests.



Raul
Sun, Sep 22 2013 9:07 PMPermanent Link

Frederick Chin

Matthew Jones wrote:
/*
Hence me saying "something like". It rather depends on the purpose of the
call of course. But there may be a suitable equivalent already available.
*/

Noted. I normally use trunc() when I want to get the value of a spinner control. Hey, wait a minute...There is no spinner control!

Frederick
Sun, Sep 22 2013 9:12 PMPermanent Link

Frederick Chin

Raul wrote:
/*
In this case you likely want to use Floor function .

In EWB you have Ceil (round up), Floor (round down) or Round for "round
half up" rounding.
*/

I use the Trunc() function to get the integer value of a float. Since there is no Int() either, I have to cobble my own.

Frederick
Sun, Sep 22 2013 9:28 PMPermanent Link

Frederick Chin

Raul wrote:

/*
How about floor for first and how much precision do you need for 2nd one
(floattostr exists). EWB i believe can do up to 16digits precision on
the double value.
*/

Let's see...I want to get the integer value of -11.25. Using Floor(-11.25) gives me -12. Ceil(-11.25) gives me -11. Trunc(-11.25) in Delphi gives me -11, what I need, unambiguously. This is giving me a headache!

/*
Not for us. We don't use the EWB as a general purpose programming
language - in our case it's main value is in being able to rapidly
develop web based front-end (user facing) apps. In our case all the
heavier lifting is done in the back end side so EWB apps deal with UI
and web requests.
*/

Makes sense for an experienced person.

As a beginner, I would want EWB to be able to handle the following processes without any third-party support:-

o   Front end interface
o   Saving and retrieving data to/from MYSQL (DBISAM is a given)
o   Data processing (hand-coded)
o   Generating reports for PDF

Frederick
Mon, Sep 23 2013 9:44 AMPermanent Link

Matthew Jones

> I use the Trunc() function to get the integer value of a float.
> Since there is no Int() either, I have to cobble my own.

integer(Floor(theValue))
will give you the integer version.

Yes, it may not be ideal for negatives, but it is easy to write a Trunc for
yourself with these tools.

/Matthew Jones/
Page 1 of 4Next Page
Jump to Page:  1 2 3 4
Image