Discussion:
Financial program
(too old to reply)
Kari Laine
2009-12-14 15:32:39 UTC
Permalink
Hi,

I have already done little billing program for my parents little firm.
It was a learning exercise. It would make a big help to get little
companies to move to Linux if there was a financial program that run
on Linux and would be free. There comes in Gambas.

Is there already an GPLed financial program made with Gambas?
If not is someone having different parts of a system willing to donate
source code under GPL?

My billing program is so horrible that in it's condition I don't want
to show it's sources to anyone... it was my first Gambas program...

Why Gambas would be extra value for this kind of a project.? Gambas is
easy language and integrated editor makes it very easy to implement
user interface. Speed and other things which are good in C or C++ are
not so important. Naturally someone says Python would be way to go but
I find it more difficult than Gambas. Idea is that regular Joe with
little experimenting could change the program.

Best Regards
Kari
--
PIC - ARM - Microcontrollers - I2C - SPI
Keypads - USB-RS232 - USB-I2C - Accessories
http://www.byvac.com
I am just a happy customer
Fabien Bodard
2009-12-14 16:03:15 UTC
Permalink
you have Laurux at http://laurux.fr/

but the code is not perfect has it was on the start a code learning
programme.. but at the end it's a true accounting program... in french
(Gb2)
Post by Kari Laine
Hi,
I have already done little billing program for my parents little firm.
It was a learning exercise. It would make a big help to get little
companies to move to Linux if there was a financial program that run
on Linux and would be free. There comes in Gambas.
Is there already an GPLed financial program made with Gambas?
If not is someone having different parts of a system willing to donate
source code under GPL?
My billing program is so horrible that in it's condition I don't want
to show it's sources to anyone... it was my first Gambas program...
Why Gambas would be extra value for this kind of a project.? Gambas is
easy language and integrated editor makes it very easy to implement
user interface. Speed and other things which are good in C or C++ are
not so important. Naturally someone says Python would be way to go but
I find it more difficult than Gambas. Idea is that regular Joe with
little experimenting could change the program.
Best Regards
Kari
--
PIC - ARM - Microcontrollers - I2C - SPI
Keypads - USB-RS232 - USB-I2C - Accessories
http://www.byvac.com
I am just a happy customer
------------------------------------------------------------------------------
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Jean-Yves F. Barbier
2009-12-14 16:24:00 UTC
Permalink
Post by Fabien Bodard
you have Laurux at http://laurux.fr/
but the code is not perfect has it was on the start a code learning
programme.. but at the end it's a true accounting program... in french
(Gb2)
BTW, do you plan to have an equivalent of postgresql or python decimal(n,n)
into GB3?
It would be *very* interesting (otherwise you have to filter every line
through Format$)

JY
--
My rackets are run on strictly American lines, and they're going to
stay that way.
-- Al Capone
Fabien Bodard
2009-12-14 16:38:05 UTC
Permalink
i've bookmarked the pyton page ... this is an interesting thing but
... always the time problem ...
Post by Jean-Yves F. Barbier
Post by Fabien Bodard
you have Laurux at http://laurux.fr/
but the code is not perfect has it was on the start a code learning
programme.. but at the end it's a true accounting program... in french
(Gb2)
BTW, do you plan to have an equivalent of postgresql or python decimal(n,n)
into GB3?
It would be *very* interesting (otherwise you have to filter every line
through Format$)
JY
--
My rackets are run on strictly American lines, and they're going to
stay that way.
               -- Al Capone
------------------------------------------------------------------------------
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Benoît Minisini
2009-12-14 17:05:48 UTC
Permalink
Post by Jean-Yves F. Barbier
Post by Fabien Bodard
you have Laurux at http://laurux.fr/
but the code is not perfect has it was on the start a code learning
programme.. but at the end it's a true accounting program... in french
(Gb2)
BTW, do you plan to have an equivalent of postgresql or python decimal(n,n)
into GB3?
It would be *very* interesting (otherwise you have to filter every line
through Format$)
JY
You mean a fixed-point decimal datatype? Or a currency datatype?

It cannot be done in Gambas 3. So, in Gambas 4 ?
--
Benoît Minisini
Jean-Yves F. Barbier
2009-12-14 17:26:29 UTC
Permalink
Post by Benoît Minisini
Post by Jean-Yves F. Barbier
Post by Fabien Bodard
you have Laurux at http://laurux.fr/
but the code is not perfect has it was on the start a code learning
programme.. but at the end it's a true accounting program... in french
(Gb2)
BTW, do you plan to have an equivalent of postgresql or python decimal(n,n)
into GB3?
It would be *very* interesting (otherwise you have to filter every line
through Format$)
JY
You mean a fixed-point decimal datatype? Or a currency datatype?
A fixed-point decimal
Post by Benoît Minisini
It cannot be done in Gambas 3. So, in Gambas 4 ?
Hu?
That's too bad because it is needed to ease accounting purposes.
--
Antique fairy tale: Little Red Riding Hood.
Modern fairy tale: Oswald, acting alone, shot Kennedy.
Benoît Minisini
2009-12-14 19:49:08 UTC
Permalink
Post by Jean-Yves F. Barbier
Post by Benoît Minisini
Post by Jean-Yves F. Barbier
Post by Fabien Bodard
you have Laurux at http://laurux.fr/
but the code is not perfect has it was on the start a code learning
programme.. but at the end it's a true accounting program... in french
(Gb2)
BTW, do you plan to have an equivalent of postgresql or python
decimal(n,n) into GB3?
It would be *very* interesting (otherwise you have to filter every line
through Format$)
JY
You mean a fixed-point decimal datatype? Or a currency datatype?
A fixed-point decimal
Post by Benoît Minisini
It cannot be done in Gambas 3. So, in Gambas 4 ?
Hu?
That's too bad because it is needed to ease accounting purposes.
Why not storing currencies in cents, or fraction of cents, with a Long
datatype?
--
Benoît Minisini
Jean-Yves F. Barbier
2009-12-14 20:26:07 UTC
Permalink
Post by Benoît Minisini
Post by Jean-Yves F. Barbier
Post by Benoît Minisini
Post by Jean-Yves F. Barbier
Post by Fabien Bodard
you have Laurux at http://laurux.fr/
but the code is not perfect has it was on the start a code learning
programme.. but at the end it's a true accounting program... in french
(Gb2)
BTW, do you plan to have an equivalent of postgresql or python
decimal(n,n) into GB3?
It would be *very* interesting (otherwise you have to filter every line
through Format$)
JY
You mean a fixed-point decimal datatype? Or a currency datatype?
A fixed-point decimal
Post by Benoît Minisini
It cannot be done in Gambas 3. So, in Gambas 4 ?
Hu?
That's too bad because it is needed to ease accounting purposes.
Why not storing currencies in cents, or fraction of cents, with a Long
datatype?
No, this is the best way to make mistakes (ie: invoice hardware with
2 decimals, but invoice telephone seconds with 8 & connections w/ 3 or 4
on the same invoice, oeuf corse).

Format$ is not very useful because of conversions it involves.

Using integer arithmetics is muuuch tooo slooow.

So the less worse is still Format$.
--
Mieux vaut tard que jamais!
[ Better late than never ]
Benoît Minisini
2009-12-14 20:45:09 UTC
Permalink
Post by Jean-Yves F. Barbier
Post by Benoît Minisini
Post by Jean-Yves F. Barbier
Post by Benoît Minisini
Post by Jean-Yves F. Barbier
Post by Fabien Bodard
you have Laurux at http://laurux.fr/
but the code is not perfect has it was on the start a code learning
programme.. but at the end it's a true accounting program... in
french (Gb2)
BTW, do you plan to have an equivalent of postgresql or python
decimal(n,n) into GB3?
It would be *very* interesting (otherwise you have to filter every
line through Format$)
JY
You mean a fixed-point decimal datatype? Or a currency datatype?
A fixed-point decimal
Post by Benoît Minisini
It cannot be done in Gambas 3. So, in Gambas 4 ?
Hu?
That's too bad because it is needed to ease accounting purposes.
Why not storing currencies in cents, or fraction of cents, with a Long
datatype?
No, this is the best way to make mistakes (ie: invoice hardware with
2 decimals, but invoice telephone seconds with 8 & connections w/ 3 or 4
on the same invoice, oeuf corse).
Format$ is not very useful because of conversions it involves.
Using integer arithmetics is muuuch tooo slooow.
So the less worse is still Format$.
I think you are mixing a lot of different things:

- When storing a amount of money in memory, you store it in a Long integer in
1/10th of cents. For example, storing 1234,56€ will be stored as 1234560.

- When displaying an amount of money, you use Format$(), or your own function.

- When getting an amount of money from the user, you have to convert a string
into an amount of 1/10th of cents.

- When getting an amount of money from the outside, or exporting an amount of
money to the outside, you must use an standard exchange format based on a
string.

So I don't see any problem with that. Why are you talking about telephone
seconds? We are talking about money, aren't we? Or there is something I didn't
understand?
--
Benoît Minisini
Jean-Yves F. Barbier
2009-12-14 22:41:28 UTC
Permalink
Benoît Minisini a écrit :
...
Post by Benoît Minisini
- When storing a amount of money in memory, you store it in a Long integer in
1/10th of cents. For example, storing 1234,56€ will be stored as 123456
I'm gonna test that, but it implies more load of the DB server side to
convert from one format to the other.
Post by Benoît Minisini
- When displaying an amount of money, you use Format$(), or your own function.
- When getting an amount of money from the user, you have to convert a string
into an amount of 1/10th of cents.
- When getting an amount of money from the outside, or exporting an amount of
money to the outside, you must use an standard exchange format based on a
string.
This is not acceptable: DB must be able to directly process numbers,
not to loose 95% of the time to convert a string to a number and
vice versa (many of my process aren't done by GB but into stored
procedures)
Post by Benoît Minisini
So I don't see any problem with that. Why are you talking about telephone
seconds? We are talking about money, aren't we? Or there is something I didn't
understand?
Yep, but some amounts can have many more decimals than others (in telephony,
seconds are usually invoiced with @ least 6 decimals and sometimes 8), so
mixing that with other number of decimals isn't easy.

This is why definable decimals numbers are so important.
--
Q: How do you keep a moron in suspense?
Benoît Minisini
2009-12-14 23:01:41 UTC
Permalink
Post by Jean-Yves F. Barbier
...
Post by Benoît Minisini
- When storing a amount of money in memory, you store it in a Long
integer in 1/10th of cents. For example, storing 1234,56€ will be stored
as 123456
I'm gonna test that, but it implies more load of the DB server side to
convert from one format to the other.
Post by Benoît Minisini
- When displaying an amount of money, you use Format$(), or your own function.
- When getting an amount of money from the user, you have to convert a
string into an amount of 1/10th of cents.
- When getting an amount of money from the outside, or exporting an
amount of money to the outside, you must use an standard exchange format
based on a string.
This is not acceptable: DB must be able to directly process numbers,
not to loose 95% of the time to convert a string to a number and
vice versa (many of my process aren't done by GB but into stored
procedures)
"Outside" means "out of your control", or "out of the program internals". If
it is a stored procedure you wrote, it will manipulate the integer values
directly of course. But if you have to send or receive currencies from another
program, you must use a standard exchange format.
Post by Jean-Yves F. Barbier
Post by Benoît Minisini
So I don't see any problem with that. Why are you talking about telephone
seconds? We are talking about money, aren't we? Or there is something I
didn't understand?
Yep, but some amounts can have many more decimals than others (in
sometimes 8), so mixing that with other number of decimals isn't easy.
This is why definable decimals numbers are so important.
Again we are talking about currencies. What's the matter with telephony
seconds? If you want to say that you have to store 1/1000th of cents, ro more,
just choose a more precise format. With a Long datatype and using 1/1000000th
of currency unit (!), you can store up to 4,6 x 10^12 units. That should be
enough.
--
Benoît Minisini
Ron_1st
2009-12-14 23:38:35 UTC
Permalink
Post by Benoît Minisini
Again we are talking about currencies. What's the matter with telephony
seconds? If you want to say that you have to store 1/1000th of cents, ro more,
just choose a more precise format. With a Long datatype and using 1/1000000th
of currency unit (!), you can store up to 4,6 x 10^12 units. That should be
enough.
Thanks for the calculation. I hope never have to pay that amount :) :)

Best regards,

Ron_1st
--
111.111111 x 111.111111 = 12345.678987654321
nando
2009-12-15 00:07:01 UTC
Permalink
My contribution to this conversation is..
Always INT or LONG for money.
Keep a global variable to divide by (for example 2 decimal places) 100
when printing/displaying things to humans...
-OR- to take the string and insert a period for cents (North America)
Make a really nice SUB to return a formatted string is good.
It is the utmost importance not to use FLOAT from the beginning
because calculations will be wrong after a while and it will not balance.
You will have headaches!!!

-Fernando


---------- Original Message -----------
From: "Ron_1st" <***@tiscali.nl>
To: gambas-***@lists.sourceforge.net
Sent: Tue, 15 Dec 2009 00:38:35 +0100
Subject: Re: [Gambas-user] Financial program
Post by Ron_1st
Post by Benoît Minisini
Again we are talking about currencies. What's the matter with telephony
seconds? If you want to say that you have to store 1/1000th of cents, ro more,
just choose a more precise format. With a Long datatype and using 1/1000000th
of currency unit (!), you can store up to 4,6 x 10^12 units. That should be
enough.
Thanks for the calculation. I hope never have to pay that amount :) :)
Best regards,
Ron_1st
--
111.111111 x 111.111111 = 12345.678987654321
------------------------------------------------------------------------------
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------- End of Original Message -------
Doriano Blengino
2009-12-15 07:19:42 UTC
Permalink
Post by nando
My contribution to this conversation is..
Always INT or LONG for money.
Keep a global variable to divide by (for example 2 decimal places) 100
when printing/displaying things to humans...
-OR- to take the string and insert a period for cents (North America)
Make a really nice SUB to return a formatted string is good.
It is the utmost importance not to use FLOAT from the beginning
because calculations will be wrong after a while and it will not balance.
You will have headaches!!!
You are perfectly true. It seems that floating point does not like base
10 numbers... :-)

But here comes in place the power of a programming language; a good
language is a wrapper around bad or annoying things. All we love gambas
because it is easy to construct user interface. But there would be no
necessity of its power - one can write external functions and interface
to X11 directly...

So when you tell me "don't use floats for accounting" I agree. When you
say "use a global variable to divide", "insert a decimal point" and so
on, I think "100% of gambas users want to use graphical interfaces,
while only 2% of them want to use financial capabilities. So, that 2%
must live with a language not very suitable for accounting". "Use long
integers, divide them, use format$()..." is the reply from Benoit. Does
someone remember the Cobol? With a simple declaration "picture 99.9999"
it created a datatype and managed all the roundings and conversions on
that datatype; this was the power of that language. I don't say that
gambas should implement this, but it would not hurt... it is a matter of
choice; I understand that this kind of things is difficult to implement
(or, who knows... with OO programming... but the really hard part is the
mixing of different types in the same expression).

The most important application I've written with gambas is something
similar to a financial one. I faced problems with gridviews, tableviews,
formats, roundings... all the things we are speaking about just now, and
they are not yet fully solved. I think that the way you describe is a
hard work, even if it is the only possible at the moment.

Regards,
--
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."
Jean-Yves F. Barbier
2009-12-15 08:32:12 UTC
Permalink
Doriano Blengino a écrit :
...
Post by Doriano Blengino
while only 2% of them want to use financial capabilities. So, that 2%
must live with a language not very suitable for accounting". "Use long
integers, divide them, use format$()..." is the reply from Benoit. Does
someone remember the Cobol? With a simple declaration "picture 99.9999"
it created a datatype and managed all the roundings and conversions on
that datatype; this was the power of that language. I don't say that
Don't burry Cobol too fast: for banking *only*, this year will be around
5 milliards Cobol written lines (progression is an avg of 14% per year).

This kinda feature was also stollen from Cobol to be used in dBase,
which was a great boost for DBs into programming world.
Post by Doriano Blengino
gambas should implement this, but it would not hurt... it is a matter of
choice; I understand that this kind of things is difficult to implement
(or, who knows... with OO programming... but the really hard part is the
mixing of different types in the same expression).
I totally agree: this also would make the difference between a nice GUI
maker and a mature graphical language.
That's what I was trying to explain (with no such fortune though.)
Post by Doriano Blengino
The most important application I've written with gambas is something
similar to a financial one. I faced problems with gridviews, tableviews,
Yeah: THIS is why I don't wanna store other things than decimal(n,n);
furthermore, the more you have transformations the less chances you
have to avoid bugs (especially sneaky ones).
Post by Doriano Blengino
formats, roundings... all the things we are speaking about just now, and
they are not yet fully solved. I think that the way you describe is a
hard work, even if it is the only possible at the moment.
I totally Dorianonize :D

JY
--
Law of Probable Dispersal:
Whatever it is that hits the fan will not be evenly distributed.
Doriano Blengino
2009-12-15 09:19:52 UTC
Permalink
...
=20
while only 2% of them want to use financial capabilities. So, that 2%=20
must live with a language not very suitable for accounting". "Use long=
=20
integers, divide them, use format$()..." is the reply from Benoit. Doe=
s=20
someone remember the Cobol? With a simple declaration "picture 99.9999=
"=20
it created a datatype and managed all the roundings and conversions on=
=20
that datatype; this was the power of that language. I don't say that=20
=20
Don't burry Cobol too fast: for banking *only*, this year will be aroun=
d
5 milliards Cobol written lines (progression is an avg of 14% per year)=
=2E
=20
This is a proof that well designed things get a long life. Ok, cobol was=20
invented exactly for that purpose - sadness is that nobody else seem to=20
care much about those good things. And money is the gas (citation from a=20
popular rock song :-)) of the world...
gambas should implement this, but it would not hurt... it is a matter =
of=20
choice; I understand that this kind of things is difficult to implemen=
t=20
(or, who knows... with OO programming... but the really hard part is t=
he=20
mixing of different types in the same expression).
=20
I totally agree: this also would make the difference between a nice GUI
maker and a mature graphical language.
That's what I was trying to explain (with no such fortune though.)
=20
You was more lucky than me, because you was replied "perhaps in gambas=20
4"; when was my turn to ask, Benoit replied "I will not implement=20
currency type in gambas". Stop. What an irony... someone who hates money=20
and financial programs (me) has to be knocked down for a request about=20
currency...

But on the side of the possible implementation in gambas, it is a really=20
hard work. I thought a little about the question, not necessarily to=20
propose changes in gambas, but to solve the problems in my application.=20
A new class, which does rounding and formatting could work. Something=20
like "dim subtotal as new currency(4,3)" would instantiate a variable=20
with three decimals, stored as a long integer. "subtotal.picture" would=20
return a string representation, "subtotal.picture(12)" would return a=20
space-leaded string of 12 characters, with the formatted number aligned=20
to the right. "subtotal.multiply()" would multiply numbers, and so on.=20
Other methods would be required to interface to databases.
This is the OO way to implement what nando suggested. The problem is=20
that calculi would be no more expressed in the usual, plain way, but in=20
an unnatural way: "totalinvoice=3Damount+vat" would turn in=20
"totalinvoice.set(amount, vat). After the first look, this could be=20
something one can live with. But overloadable operators would be very=20
appreciated to improve readability and, if impossible, compiler macro at=20
least would help. You can walk around the problem as much as you want,=20
and you finish with forcing a language to do things it never was planned=20
to do. The same as complex numbers in C - you can use them, but what a=20
bore! And, in fact, python supports complex numbers natively.

I must experiment a little with this idea, but I suspect that new=20
classes for every textual gui element would be needed, and it is this=20
part which scares me. I wrote some new components for this, and they=20
work, but they have some quirks I don't understand well. And... I really=20
hate accounting programs...

Uhm... I just readed back the mail about the "calculi" part. The=20
"picturednumber" class could evaluate a string... so=20
"totalinvoice=3Damount+vat" could be written as=20
"totalinvoice.setTo("amount+vat")... double work, but double result...=20
the only problem is that the compiler can not check for the correctness=20
of the expression. Problems again.

Regards,
Doriano
Jean-Yves F. Barbier
2009-12-15 10:36:51 UTC
Permalink
Post by Doriano Blengino
Post by Jean-Yves F. Barbier
Don't burry Cobol too fast: for banking *only*, this year will be around
5 milliards Cobol written lines (progression is an avg of 14% per year).
This is a proof that well designed things get a long life. Ok, cobol was
invented exactly for that purpose - sadness is that nobody else seem to
care much about those good things. And money is the gas (citation from a
popular rock song :-)) of the world...
This isn't really true: part of my family owns a company that sell pastry
products (additives etc), their ERP run under UNIX and VT100 consoles
and is entirely written in Cobol.
Many mid to large companies use Cobol, and have problems to find programmers
interested into this language - so there are good days left for those who care.

ADA is also growing because of its very specialized variable definitions
possibilities.

...
Post by Doriano Blengino
You was more lucky than me, because you was replied "perhaps in gambas
4"; when was my turn to ask, Benoit replied "I will not implement
currency type in gambas". Stop. What an irony... someone who hates money
and financial programs (me) has to be knocked down for a request about
currency...
I don't like it either, but there are places to take with good programs.
Post by Doriano Blengino
But on the side of the possible implementation in gambas, it is a really
hard work. I thought a little about the question, not necessarily to
propose changes in gambas, but to solve the problems in my application.
A new class, which does rounding and formatting could work. Something
like "dim subtotal as new currency(4,3)" would instantiate a variable
with three decimals, stored as a long integer. "subtotal.picture" would
return a string representation, "subtotal.picture(12)" would return a
space-leaded string of 12 characters, with the formatted number aligned
to the right. "subtotal.multiply()" would multiply numbers, and so on.
Other methods would be required to interface to databases.
This is the OO way to implement what nando suggested. The problem is
that calculi would be no more expressed in the usual, plain way, but in
an unnatural way: "totalinvoice=amount+vat" would turn in
"totalinvoice.set(amount, vat). After the first look, this could be
something one can live with. But overloadable operators would be very
appreciated to improve readability and, if impossible, compiler macro at
least would help. You can walk around the problem as much as you want,
and you finish with forcing a language to do things it never was planned
to do. The same as complex numbers in C - you can use them, but what a
bore! And, in fact, python supports complex numbers natively.
This is even more complicated - ie: fr law say that precision of VAT rates
is 4 decimals, and as I said before, some items can be invoiced with a
large number of decimals.
For VAT, more than 2 decimals had never been used but could be tomorrow;
so this is an entire int2decimal processor to write (as you wrote, no more
than 2 members to multiply because of that:(
Post by Doriano Blengino
I must experiment a little with this idea, but I suspect that new
classes for every textual gui element would be needed, and it is this
part which scares me. I wrote some new components for this, and they
work, but they have some quirks I don't understand well. And... I really
hate accounting programs...
Uhm... I just readed back the mail about the "calculi" part. The
"picturednumber" class could evaluate a string... so
"totalinvoice=amount+vat" could be written as
"totalinvoice.setTo("amount+vat")... double work, but double result...
the only problem is that the compiler can not check for the correctness
of the expression. Problems again.
I lost too much time with things like that and now strongly consider
to interface all calculation to Python and only keep GB as a GUI.

This shouldn't add that many things to the system: as of Linux, Python
is a std install, as of Debian, this will only require a few packages
to add (AND it'll solve docs templates, PDF generation and some other
dead-ends)

Regards,
JY
--
Don't get even -- get odd!
Doriano Blengino
2009-12-15 11:37:12 UTC
Permalink
=20
Don't burry Cobol too fast: for banking *only*, this year will be aro=
und
5 milliards Cobol written lines (progression is an avg of 14% per yea=
r).
=20
=20
This is a proof that well designed things get a long life. Ok, cobol w=
as=20
invented exactly for that purpose - sadness is that nobody else seem t=
o=20
care much about those good things. And money is the gas (citation from=
a=20
popular rock song :-)) of the world...
=20
This isn't really true: part of my family owns a company that sell past=
ry
products (additives etc), their ERP run under UNIX and VT100 consoles
and is entirely written in Cobol.
Many mid to large companies use Cobol, and have problems to find progra=
mmers
interested into this language - so there are good days left for those w=
ho care.
=20
I was intending that nobody steals good ideas from cobol. I know that=20
cobol is still used but, I think, it is an old language. Dream: a really=20
good language having some properties of cobol, and specialized GUI=20
widgets where you bind the variable (with picture, limits, precision and=20
so on) to a widget. Probably Java and Python are already able to do so,=20
but they have other limits. Another problem I often face is that of=20
preferences. I make a nicely customizable program, with lot of=20
preferences, and for every preference I have to put a widget on a form,=20
load its content from a file, rewrite its content to the file, and so=20
on. Simply boring.
ADA is also growing because of its very specialized variable definition=
s
possibilities.
=20
A strongness inherited from pascal... I gave a look to many, countless=20
languages, and only few met my own requirements - strong typization,=20
good compiler checks, overloading and, of course!, OO model. One of=20
these was Ada. But I rejected all C- and Java- flavoured. Irony again...=20
C language is the one I use most...
=20
But on the side of the possible implementation in gambas, it is a real=
ly=20
hard work. I thought a little about the question, not necessarily to=20
propose changes in gambas, but to solve the problems in my application=
.=20
A new class, which does rounding and formatting could work. Something=20
like "dim subtotal as new currency(4,3)" would instantiate a variable=20
with three decimals, stored as a long integer. "subtotal.picture" woul=
d=20
return a string representation, "subtotal.picture(12)" would return a=20
space-leaded string of 12 characters, with the formatted number aligne=
d=20
to the right. "subtotal.multiply()" would multiply numbers, and so on.=
=20
Other methods would be required to interface to databases.
This is the OO way to implement what nando suggested. The problem is=20
that calculi would be no more expressed in the usual, plain way, but i=
n=20
an unnatural way: "totalinvoice=3Damount+vat" would turn in=20
"totalinvoice.set(amount, vat). After the first look, this could be=20
something one can live with. But overloadable operators would be very=20
appreciated to improve readability and, if impossible, compiler macro =
at=20
least would help. You can walk around the problem as much as you want,=
=20
and you finish with forcing a language to do things it never was plann=
ed=20
to do. The same as complex numbers in C - you can use them, but what a=
=20
bore! And, in fact, python supports complex numbers natively.
=20
This is even more complicated - ie: fr law say that precision of VAT ra=
tes
is 4 decimals, and as I said before, some items can be invoiced with a
large number of decimals.
For VAT, more than 2 decimals had never been used but could be tomorrow=
;
so this is an entire int2decimal processor to write (as you wrote, no m=
ore
than 2 members to multiply because of that:(
=20
I am not sure to understand. If you take an amount with 2 decimals of=20
precision, you can calculate VAT with 4 decimal precision:
dim amount as new currency(8,2)
dim vatrate as new currency(2,4)
dim vat as new currency(8,2)
dim total as new currency(8,2)

amount.calculate(....)
vatrate.set(18.55) ' is this a percent, right?
vat.calculate(amount % vatrate)
total.calculate('amount+vat')

Now a few things should be considered. The variable VAT has a precision=20
of 2 decimals, but by invoking vat.calculate(...), a variable with=20
precision 4 is passed in, so the calculus is made on 4 decimals and,=20
just before storing the result to VAT, the rounding to 2 decimals is=20
made (and the rounding is another interesting piece...).
So we should have what we want: precision 4 in the rate, and precision 2=20
in money's variables. Not sure what to do in the inverse operation...=20
taking out a 18.55% vat rate from a total, should give a correct amount=20
and vat which, added together, should give the total again... funny to=20
say, but a little harder to implement... but this could be just another=20
method (I call it "scorporo", but I don't know how to say it in english).
=20
Uhm... I just readed back the mail about the "calculi" part. The=20
"picturednumber" class could evaluate a string... so=20
"totalinvoice=3Damount+vat" could be written as=20
"totalinvoice.setTo("amount+vat")... double work, but double result...=
=20
the only problem is that the compiler can not check for the correctnes=
s=20
of the expression. Problems again.
=20
I lost too much time with things like that and now strongly consider
to interface all calculation to Python and only keep GB as a GUI.
=20
Betrayer! :-)))

Why not interface to cobol directly, then? I don't think your way is=20
viable - it would be even more "forcing a language to do things it never=20
was planned for". I think you intend to call /usr/lib/libpython2.xx,=20
perhaps through some wrapper class; interesting... may be this could=20
solve the "expressions" issue...

Regards,
Doriano
Jean-Yves F. Barbier
2009-12-15 12:03:07 UTC
Permalink
Doriano Blengino a écrit :
...
Post by Doriano Blengino
A strongness inherited from pascal... I gave a look to many, countless
hmm, I don't think Pascal can define vars as temperature[-10, +50]
Post by Doriano Blengino
languages, and only few met my own requirements - strong typization,
good compiler checks, overloading and, of course!, OO model. One of
these was Ada. But I rejected all C- and Java- flavoured. Irony again...
C language is the one I use most...
Yes this is the PB, each one has pros & cons.

...
Post by Doriano Blengino
Post by Jean-Yves F. Barbier
I lost too much time with things like that and now strongly consider
to interface all calculation to Python and only keep GB as a GUI.
Betrayer! :-)))
No, this meets what you said above: no language is perfect, so the only
solution is to take whatever you want in some of them (well, not some, 2)

And I'm not a language integrist: I pick what fits my needs.
Post by Doriano Blengino
Why not interface to cobol directly, then? I don't think your way is
viable - it would be even more "forcing a language to do things it never
was planned for". I think you intend to call /usr/lib/libpython2.xx,
perhaps through some wrapper class; interesting... may be this could
solve the "expressions" issue...
I'm far from a specialist, as a matter of fact I didn't used OO before
(only C and ASM a looong time ago) so the only way I see to make a mix
is to call external subroutines through SHELL or EXEC; but if you know
other ways, I'm in.

I don't wanna end up with terrible hacks, nor spend more time to develop
something that already exists in another language: I need it to run the way
I want in an easy (and maintenable) way - without headaches...

Regards
JY
--
You are here:
***
***
*********
*******
*****
***
*

But you're not all there.
Doriano Blengino
2009-12-15 12:17:32 UTC
Permalink
Post by Jean-Yves F. Barbier
...
=20
Post by Doriano Blengino
=20
=20
A strongness inherited from pascal... I gave a look to many, countless=
=20
Post by Jean-Yves F. Barbier
Post by Doriano Blengino
=20
hmm, I don't think Pascal can define vars as temperature[-10, +50]
=20
What do you mean precisely? Can you define the properties of such variabl=
e?
Post by Jean-Yves F. Barbier
I'm far from a specialist, as a matter of fact I didn't used OO before
(only C and ASM a looong time ago) so the only way I see to make a mix
is to call external subroutines through SHELL or EXEC; but if you know
other ways, I'm in.
I don't wanna end up with terrible hacks, nor spend more time to develo=
p
Post by Jean-Yves F. Barbier
something that already exists in another language: I need it to run the=
way=20
Post by Jean-Yves F. Barbier
I want in an easy (and maintenable) way - without headaches...
=20
*That* would be slow, very slooow.

There are "external" declarations in gambas (I was admired when I saw=20
them the first time). That should be the way to go. I used them to=20
interface the LDAP library, and it worked. But it was a pain to manage=20
pointers and memory in gambas, and probably there are several quirks in=20
that work. If the python lib is written in C++ instead, then things get=20
worse, so an EXEC is simpler for sure (but slow). I insist on the=20
slowness because you insisted on that in an earlier mail. If you want to=20
process thousands rows from a database, then the exec is guaranteed to=20
be out of discussion.

Regards,
Doriano
Rolf Schmidt
2009-12-15 13:30:13 UTC
Permalink
Post by Jean-Yves F. Barbier
...
Post by Doriano Blengino
A strongness inherited from pascal... I gave a look to many, countless
hmm, I don't think Pascal can define vars as temperature[-10, +50]
What do you mean precisely? Can you define the properties of such variable?
Post by Jean-Yves F. Barbier
I'm far from a specialist, as a matter of fact I didn't used OO before
(only C and ASM a looong time ago) so the only way I see to make a mix
is to call external subroutines through SHELL or EXEC; but if you know
other ways, I'm in.
I don't wanna end up with terrible hacks, nor spend more time to develop
something that already exists in another language: I need it to run the
way I want in an easy (and maintenable) way - without headaches...
*That* would be slow, very slooow.
There are "external" declarations in gambas (I was admired when I saw
them the first time). That should be the way to go. I used them to
interface the LDAP library, and it worked. But it was a pain to manage
pointers and memory in gambas, and probably there are several quirks in
that work. If the python lib is written in C++ instead, then things get
worse, so an EXEC is simpler for sure (but slow). I insist on the
slowness because you insisted on that in an earlier mail. If you want to
process thousands rows from a database, then the exec is guaranteed to
be out of discussion.
Did you try to use the mp-lib (multi precision) from the gnu project. It is
designed to make math cal the way we learnd at school, so its result are
always correct at any depth of decimal fractions.

I think they have a definition for the data/variables they need for the
calculation. So define variables in their way, is a possibility how to
implement a number class in gambas.

Regards
Rolf
Fabien Bodard
2009-12-15 13:30:50 UTC
Permalink
Post by Jean-Yves F. Barbier
...
Post by Doriano Blengino
A strongness inherited from pascal... I gave a look to many, countless
hmm, I don't think Pascal can define vars as temperature[-10, +50]
What do you mean precisely? Can you define the properties of such variable?
Post by Jean-Yves F. Barbier
I'm far from a specialist, as a matter of fact I didn't used OO before
(only C and ASM a looong time ago) so the only way I see to make a mix
is to call external subroutines through SHELL or EXEC; but if you know
other ways, I'm in.
I don't wanna end up with terrible hacks, nor spend more time to develop
something that already exists in another language: I need it to run the way
I want in an easy (and maintenable) way - without headaches...
*That* would be slow, very slooow.
There are "external" declarations in gambas (I was admired when I saw
them the first time). That should be the way to go. I used them to
interface the LDAP library, and it worked. But it was a pain to manage
pointers and memory in gambas, and probably there are several quirks in
that work. If the python lib is written in C++ instead, then things get
worse, so an EXEC is simpler for sure (but slow). I insist on the
slowness because you insisted on that in an earlier mail. If you want to
process thousands rows from a database, then the exec is guaranteed to
be out of discussion.
And on the thouthen of accounting program code i've readen the
majority use long or integer to store values.
so they use integer to compute and in the database they store the
printable value as string...

Not many are using float, and those are beginner's ones... like mine :/ lol
Regards,
Doriano
------------------------------------------------------------------------------
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Jussi Lahtinen
2009-12-15 15:52:56 UTC
Permalink
I don't like floats.
They are slow, and bitchy;

Dim n As Single
n = 1.4 - 0.2
Print n
And the result is 1.200000047684, which is obviously wrong from math
point of view.
Correcting floating point artifact, makes floats even slower.
And it is surprisingly common to be able to use integers instead.

Jussi
Post by Fabien Bodard
Post by Jean-Yves F. Barbier
...
Post by Doriano Blengino
A strongness inherited from pascal... I gave a look to many, countless
hmm, I don't think Pascal can define vars as temperature[-10, +50]
What do you mean precisely? Can you define the properties of such variable?
Post by Jean-Yves F. Barbier
I'm far from a specialist, as a matter of fact I didn't used OO before
(only C and ASM a looong time ago) so the only way I see to make a mix
is to call external subroutines through SHELL or EXEC; but if you know
other ways, I'm in.
I don't wanna end up with terrible hacks, nor spend more time to develop
something that already exists in another language: I need it to run the way
I want in an easy (and maintenable) way - without headaches...
*That* would be slow, very slooow.
There are "external" declarations in gambas (I was admired when I saw
them the first time). That should be the way to go. I used them to
interface the LDAP library, and it worked. But it was a pain to manage
pointers and memory in gambas, and probably there are several quirks in
that work. If the python lib is written in C++ instead, then things get
worse, so an EXEC is simpler for sure (but slow). I insist on the
slowness because you insisted on that in an earlier mail. If you want to
process thousands rows from a database, then the exec is guaranteed to
be out of discussion.
And on the thouthen of accounting program code i've readen the
majority use long or integer to store values.
 so they use integer to compute and in the database they store the
printable value as string...
Not many are using float, and those are beginner's ones... like mine :/ lol
Regards,
Doriano
------------------------------------------------------------------------------
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Les Hardy
2009-12-15 21:57:04 UTC
Permalink
Can anyone tell me how to save a gif image.
I can save other images, but not gifs

gambas 2.18 on ubuntu 9.04

Regards
Les Hardy
Jussi Lahtinen
2009-12-16 15:44:47 UTC
Permalink
Save gif from where?
Please show your code you are using to save other image formats.

Jussi
Post by Les Hardy
Can anyone tell me how to save a gif image.
I can save other images, but  not gifs
gambas 2.18 on ubuntu 9.04
Regards
Les Hardy
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Fabien Bodard
2009-12-16 19:18:51 UTC
Permalink
have you libgif installed ?
Post by Jussi Lahtinen
Save gif from where?
Please show your code you are using to save other image formats.
Jussi
Post by Les Hardy
Can anyone tell me how to save a gif image.
I can save other images, but  not gifs
gambas 2.18 on ubuntu 9.04
Regards
Les Hardy
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Les Hardy
2009-12-16 19:55:20 UTC
Permalink
Yes, I have libgif-4.1.6-6. I tried reinstalling all image libraries
that I could find.
Still no good.

Regards
Les Hardy
Post by Fabien Bodard
have you libgif installed ?
Post by Jussi Lahtinen
Save gif from where?
Please show your code you are using to save other image formats.
Jussi
Post by Les Hardy
Can anyone tell me how to save a gif image.
I can save other images, but not gifs
gambas 2.18 on ubuntu 9.04
Regards
Les Hardy
Les Hardy
2009-12-16 18:33:12 UTC
Permalink
Thanks for responding Jussi,

The image is a result of an image.load previously in the code.
It may have been loaded as a gif, jpg, png or bmp.

'this works ok
imgfile = user.home &/ "tmpfile.jpg"
imageout.Save(imgfile)
'------------------
'this works ok
imgfile = user.home &/ "tmpfile.png"
imageout.Save(imgfile)
'------------------
' this does not work. error message say 'cannot save file'
imgfile = user.home &/ "tmpfile.gif"
imageout.Save(imgfile)

I have written a few apps in gambas, with plenty of file handling, but I
don't generally use gifs.
I tried it with images, pictures, pictureboxes. and in every case I can
save anything but a gif.
Its driving me nuts.
I cannot see any other postings about this problem. So I guess it must
be something with my setup.

Have you any ideas of what to try next?

Regards
Les Hardy
Post by Jussi Lahtinen
Save gif from where?
Please show your code you are using to save other image formats.
Jussi
Post by Les Hardy
Can anyone tell me how to save a gif image.
I can save other images, but not gifs
gambas 2.18 on ubuntu 9.04
Regards
Les Hardy
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Benoît Minisini
2009-12-16 20:22:58 UTC
Permalink
Post by Les Hardy
Thanks for responding Jussi,
The image is a result of an image.load previously in the code.
It may have been loaded as a gif, jpg, png or bmp.
'this works ok
imgfile = user.home &/ "tmpfile.jpg"
imageout.Save(imgfile)
'------------------
'this works ok
imgfile = user.home &/ "tmpfile.png"
imageout.Save(imgfile)
'------------------
' this does not work. error message say 'cannot save file'
imgfile = user.home &/ "tmpfile.gif"
imageout.Save(imgfile)
I have written a few apps in gambas, with plenty of file handling, but I
don't generally use gifs.
I tried it with images, pictures, pictureboxes. and in every case I can
save anything but a gif.
Its driving me nuts.
I cannot see any other postings about this problem. So I guess it must
be something with my setup.
Have you any ideas of what to try next?
Regards
Les Hardy
In Gambas 2, the image save function is managed by the GUI component: which
one do you use? gb.qt or gb.gtk?

I know, for example, that Qt can be compiled without GIF support. So on a
system with Qt compiled that way, Gambas projects using gb.qt won't be able to
deal with gif files.

Regards,
--
Benoît Minisini
Les Hardy
2009-12-16 21:20:03 UTC
Permalink
Yes, You have it. Just checked. Looks like QImageIO was compiled
without gif support on ubuntu 9.04 , and I am using gb.qt.

My Thanks to all that responded.

Regards
Les Hardy
Post by Benoît Minisini
In Gambas 2, the image save function is managed by the GUI component: which
one do you use? gb.qt or gb.gtk?
I know, for example, that Qt can be compiled without GIF support. So on a
system with Qt compiled that way, Gambas projects using gb.qt won't be able to
deal with gif files.
Regards,
Jean-Yves F. Barbier
2009-12-15 15:50:11 UTC
Permalink
Post by Jean-Yves F. Barbier
Post by Doriano Blengino
A strongness inherited from pascal... I gave a look to many, countless
hmm, I don't think Pascal can define vars as temperature[-10, +50]
What do you mean precisely? Can you define the properties of such variable?
means: var name of type = temperature, type = integer, can't go further
its boundaries [-10, +50] ([-10.0, +50.0] would have a 1/10th degree
precision and so on)

...
Post by Jean-Yves F. Barbier
I don't wanna end up with terrible hacks, nor spend more time to develop
something that already exists in another language: I need it to run the way
I want in an easy (and maintenable) way - without headaches...
*That* would be slow, very slooow.
There are "external" declarations in gambas (I was admired when I saw
them the first time). That should be the way to go. I used them to
interface the LDAP library, and it worked. But it was a pain to manage
pointers and memory in gambas, and probably there are several quirks in
that work. If the python lib is written in C++ instead, then things get
worse, so an EXEC is simpler for sure (but slow). I insist on the
slowness because you insisted on that in an earlier mail. If you want to
process thousands rows from a database, then the exec is guaranteed to
be out of discussion.
Ok, I drew the logical conclusion.

Regards
JY
--
Never try to outstubborn a cat.
-- Lazarus Long, "Time Enough for Love"
Doriano Blengino
2009-12-15 16:26:53 UTC
Permalink
=20
Post by Jean-Yves F. Barbier
A strongness inherited from pascal... I gave a look to many, countle=
ss=20
Post by Jean-Yves F. Barbier
=20
=20
hmm, I don't think Pascal can define vars as temperature[-10, +50]
=20
=20
What do you mean precisely? Can you define the properties of such vari=
able?
=20
means: var name of type =3D temperature, type =3D integer, can't go fur=
ther
its boundaries [-10, +50] ([-10.0, +50.0] would have a 1/10th degree=20
precision and so on)
=20
Pascal can do it on scalars: "type Tdegrees =3D -10..50;". The storage=20
will be the minimum required (in this case, a shortint, or signed byte).=20
If you turn range checking on, then assigning a value out of range=20
raises a runtime error. If in your program you have such a wrong=20
assignment from a constant expression, then the error will be detected=20
at compile time (ie, the compiler is smart enough to detect this). This=20
is the "old", standard pascal, where you can't do the same with real=20
(floating) numbers because they are not scalar, so by definition they do=20
not have ranges, so you can not define subranges (and this is a limit,=20
dictated by "pureness" of original pascal). I think that ADA's very=20
advanced declarations started from here, adding more capabilities=20
(pascal has the same age as C).

In more recent pascal you can overload everything (operators included),=20
so you can get a step ahead; but "temperature :=3D temperature+1" always=20
means "increment of one unit". This is what is possible without OO.=20
Using OO, you must instantiate every variable (because now they are=20
objects), write methods and overload assignments and operators, and make=20
exactly what you want even with precision 1/10th: writing "temperature=20
:=3D temperature+1" can lead to 1 degree of increment, or 1 tenth of=20
degree: it depends on how you implement it.

Regards,
Doriano
Kari Laine
2009-12-15 18:08:51 UTC
Permalink
Hi,

thank you for all the information. I also found a system made in
Finland using PHP. It is called pupesoft and it's web-address is

http://www.devlab.fi/pupesoft

So now when I have time I will test all of these and see how they work.

Best Regards
Kari
Norarg
2009-12-15 11:31:51 UTC
Permalink
Post by Doriano Blengino
Post by nando
My contribution to this conversation is..
Always INT or LONG for money.
Keep a global variable to divide by (for example 2 decimal places) 100
when printing/displaying things to humans...
-OR- to take the string and insert a period for cents (North America)
Make a really nice SUB to return a formatted string is good.
It is the utmost importance not to use FLOAT from the beginning
because calculations will be wrong after a while and it will not balance.
You will have headaches!!!
You are perfectly true. It seems that floating point does not like base
10 numbers... :-)
But here comes in place the power of a programming language; a good
language is a wrapper around bad or annoying things. All we love gambas
because it is easy to construct user interface. But there would be no
necessity of its power - one can write external functions and interface
to X11 directly...
So when you tell me "don't use floats for accounting" I agree. When you
say "use a global variable to divide", "insert a decimal point" and so
on, I think "100% of gambas users want to use graphical interfaces,
while only 2% of them want to use financial capabilities. So, that 2%
must live with a language not very suitable for accounting". "Use long
integers, divide them, use format$()..." is the reply from Benoit. Does
someone remember the Cobol? With a simple declaration "picture 99.9999"
it created a datatype and managed all the roundings and conversions on
that datatype; this was the power of that language. I don't say that
gambas should implement this, but it would not hurt... it is a matter of
choice; I understand that this kind of things is difficult to implement
(or, who knows... with OO programming... but the really hard part is the
mixing of different types in the same expression).
The most important application I've written with gambas is something
similar to a financial one. I faced problems with gridviews, tableviews,
formats, roundings... all the things we are speaking about just now, and
they are not yet fully solved. I think that the way you describe is a
hard work, even if it is the only possible at the moment.
Regards,
Hi

I remember Cobol, it was very much used in the 80'es, and the company in
which I was employed at that time used it for all commercial software.
Then C got more and more modern to use, and one had to write a lot of
functions to get the same results - in the accounting-context. Cobol had
its own "database", just datafiles, it did not have to convert anything
from any SQL-Server, and as far as I can remember, it stored the data
without any floats - the picture 9.99 just told it where to set the
decimalpoint.

regards
Ron_1st
2009-12-14 23:36:32 UTC
Permalink
Post by Jean-Yves F. Barbier
...
Post by Benoît Minisini
- When storing a amount of money in memory, you store it in a Long integer in
1/10th of cents. For example, storing 1234,56€ will be stored as 123456
I'm gonna test that, but it implies more load of the DB server side to
convert from one format to the other.
It is not a matter of the DB server to calculate.
Its the presentation only, the matter of the frontend program.
Adding integers a amount in 1/10th of cents stored is more quick then
adding floating point numbers that must be handled to and back from the co-processor.

In fact your gambas program does not use that co-proc but a library to do
the job in software in most cases.
Only special programs handle this arithmetic direct to the co-proc.
Post by Jean-Yves F. Barbier
Post by Benoît Minisini
- When displaying an amount of money, you use Format$(), or your own function.
- When getting an amount of money from the user, you have to convert a string
into an amount of 1/10th of cents.
- When getting an amount of money from the outside, or exporting an amount of
money to the outside, you must use an standard exchange format based on a
string.
This is not acceptable: DB must be able to directly process numbers,
not to loose 95% of the time to convert a string to a number and
vice versa (many of my process aren't done by GB but into stored
procedures)
A DB server is _just_ losing time if the numbers are in floats and not in integer.
It have to first normalize the numbers before it can do the arithmetics.
And I'm almost on safe that it also _just_ use a slow library instead of the co-proc.
Post by Jean-Yves F. Barbier
Post by Benoît Minisini
So I don't see any problem with that. Why are you talking about telephone
seconds? We are talking about money, aren't we? Or there is something I didn't
understand?
Yep, but some amounts can have many more decimals than others (in telephony,
mixing that with other number of decimals isn't easy.
Almost every accounting program works with at least 8 decimals for the fractional part.
Only at the last step, the presentation the rounding to 2 decimals for currency is/should done.
Post by Jean-Yves F. Barbier
This is why definable decimals numbers are so important.
I do agree it can be handy to have but there is no absolute need.
However if we talking about scientific calculations then it would/can
be a complete different case.

In my view a database is for storage of information/numbers.
The handling/calculation of the stored data is the job for the end application.

In my good old times I made some floating point programs on a Z80 CPU.
No support for floats or co-procs available (or acceptable price).
I did just what Benoit suggest and worked with 1/100 of a cent and
at the last step the round to 2 decimals in Dutch Giuilder.
Later I got a request to implement the co-proc and the customer
was disapointed about the drop in speed as result.
The max bit size was 16 bit for add/subtract so I had to make
my own routines for 4 times 16 bit wide. Was interesting job to do.


Anyway I feel a bit with your for the request.
It can make simple apps more ease to develop.

Best regards,

Ron_1st
--
111.111111 x 111.111111 = 12345.678987654321
Kari Laine
2009-12-14 17:24:23 UTC
Permalink
Hi,

thanks
Post by Fabien Bodard
you have Laurux at http://laurux.fr/
but the code is not perfect has it was on the start a code learning
programme.. but at the end it's a true accounting program... in french
(Gb2)
I don't read a single word French so I have to pass. It would be too
difficult for me to adapt.


Best Regards
Kari
Jean-Yves F. Barbier
2009-12-14 17:36:47 UTC
Permalink
Post by Kari Laine
Hi,
thanks
Post by Fabien Bodard
you have Laurux at http://laurux.fr/
but the code is not perfect has it was on the start a code learning
programme.. but at the end it's a true accounting program... in french
(Gb2)
I don't read a single word French so I have to pass. It would be too
difficult for me to adapt.
You can take a look at sql-ledger that implements a double-entry
accounting with many accounting plans (but it is written in perl...)
--
A man without a woman is like a fish without gills.
Werner
2009-12-14 16:55:11 UTC
Permalink
Post by Kari Laine
Hi,
I have already done little billing program for my parents little firm.
It was a learning exercise. It would make a big help to get little
companies to move to Linux if there was a financial program that run
on Linux and would be free. There comes in Gambas.
Is there already an GPLed financial program made with Gambas?
If not is someone having different parts of a system willing to donate
source code under GPL?
My billing program is so horrible that in it's condition I don't want
to show it's sources to anyone... it was my first Gambas program...
Why Gambas would be extra value for this kind of a project.? Gambas is
easy language and integrated editor makes it very easy to implement
user interface. Speed and other things which are good in C or C++ are
not so important. Naturally someone says Python would be way to go but
I find it more difficult than Gambas. Idea is that regular Joe with
little experimenting could change the program.
Best Regards
Kari
There is Quasar from Linux Canada. It is very similar to MYOB. Their
last GPL version is 1.4.7, I think. After that they went sort of
proprietary(Note1) but the documentation of how to hook into the new
version database is exemplary. We use 1.4.7, mostly the inventory
control part which is excellent. In this version the reporting bits are
suboptimal but the rest is fine.
We use it since around 2002, using mostly the inventory control part.
The mailing list support is excellent. I had studied their source code.
It is extremely well written, I learned a lot from it.

If you think you can write a decent accounting program in 3 man months
you don't know what the task is.
If you think you can write a decent accounting program in 3 man years
you may have something fairly basic to show but only if you got your
priorities right.
Accounting programs are very much underestimated.

You might just want to hook into what's there and be efficient. The
interface is well documented.

Regards

Werner

Note 1: If I recall it properly it was after someone claimed their
software was actually his
Kari Laine
2009-12-14 17:22:02 UTC
Permalink
Hi,
Post by Werner
There is Quasar from Linux Canada. It is very similar to MYOB. Their
last GPL version is 1.4.7, I think.
Do you have the source for the GPL version. I visited their site and
couldn't find it.
Post by Werner
If you think you can write a decent accounting program in 3 man months
you don't know what the task is.
If you think you can write a decent accounting program in 3 man years
you may have something fairly basic to show but only if you got your
priorities right.
I always have my priorities wrong ... I am right now swamped. But
I was more on the line what exists and could be modified for Finnish market.
And idea was also that I wouldn't have to do everything myself.
Post by Werner
Accounting programs are very much underestimated.
I agree.

Best Regards
Kari
--
PIC - ARM - Microcontrollers - I2C - SPI
Keypads - USB-RS232 - USB-I2C - Accessories
http://www.byvac.com
I am just a happy customer
Werner
2009-12-14 17:48:23 UTC
Permalink
Post by Kari Laine
Hi,
Post by Werner
There is Quasar from Linux Canada. It is very similar to MYOB. Their
last GPL version is 1.4.7, I think.
Do you have the source for the GPL version. I visited their site and
couldn't find it.
Post by Werner
If you think you can write a decent accounting program in 3 man months
you don't know what the task is.
If you think you can write a decent accounting program in 3 man years
you may have something fairly basic to show but only if you got your
priorities right.
I always have my priorities wrong ... I am right now swamped. But
I was more on the line what exists and could be modified for Finnish market.
And idea was also that I wouldn't have to do everything myself.
Post by Werner
Accounting programs are very much underestimated.
I agree.
Best Regards
Kari
ftp://www.linuxcanada.com/pub/Quasar/1.4.7/
I hope to have conveyed: They are very decent people and it is brilliant
software.

Regards
Werner
g***@hotmail.com
2009-12-14 18:54:45 UTC
Permalink
You have the wonderfull accounting programm www.laurus.fr
Here you have some :

http://gambas.sourceforge.net/en/main.html

enjoy :)
Henri
--------------------------------------------------
From: "Kari Laine" <***@gmail.com>
Sent: Monday, December 14, 2009 4:32 PM
To: <Gambas-***@lists.sourceforge.net>
Subject: [Gambas-user] Financial program
Post by Kari Laine
Hi,
I have already done little billing program for my parents little firm.
It was a learning exercise. It would make a big help to get little
companies to move to Linux if there was a financial program that run
on Linux and would be free. There comes in Gambas.
Is there already an GPLed financial program made with Gambas?
If not is someone having different parts of a system willing to donate
source code under GPL?
My billing program is so horrible that in it's condition I don't want
to show it's sources to anyone... it was my first Gambas program...
Why Gambas would be extra value for this kind of a project.? Gambas is
easy language and integrated editor makes it very easy to implement
user interface. Speed and other things which are good in C or C++ are
not so important. Naturally someone says Python would be way to go but
I find it more difficult than Gambas. Idea is that regular Joe with
little experimenting could change the program.
Best Regards
Kari
--
PIC - ARM - Microcontrollers - I2C - SPI
Keypads - USB-RS232 - USB-I2C - Accessories
http://www.byvac.com
I am just a happy customer
------------------------------------------------------------------------------
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Tony
2009-12-14 20:19:39 UTC
Permalink
Post by Kari Laine
Hi,
I have already done little billing program for my parents little firm.
It was a learning exercise. It would make a big help to get little
companies to move to Linux if there was a financial program that run
on Linux and would be free. There comes in Gambas.
Is there already an GPLed financial program made with Gambas?
If not is someone having different parts of a system willing to donate
source code under GPL?
My billing program is so horrible that in it's condition I don't want
to show it's sources to anyone... it was my first Gambas program...
Why Gambas would be extra value for this kind of a project.? Gambas is
easy language and integrated editor makes it very easy to implement
user interface. Speed and other things which are good in C or C++ are
not so important. Naturally someone says Python would be way to go but
I find it more difficult than Gambas. Idea is that regular Joe with
little experimenting could change the program.
Best Regards
Kari
Hi,

Whilst obviously not written in Gambas, I've been using GnuCash for
personal accounting for some time. The double entry bit and UI are a
little clunky for my basic needs, but in the end it works. I'm think you
can use it for billing and you can tailor reports etc in guile, so it
may be worth a look. Source code should be available since it is GPL.

Tony..
Continue reading on narkive:
Loading...