[Gambas-user] Arithmetic failure in project..Solution
nando
nando_f at ...951...
Sat Oct 3 06:11:28 CEST 2009
Friend,
I have gone through your project and I ran it with these changes:
(1) in SUB action_click...insert above this line:
result = (exposure * (guidenumber / distance) * (flashcompensation) * (multicompensation))
these four lines:
IF gn_feet.Value = TRUE THEN guidenumber = (input_gn.Value / 3.3)
IF gn_metres.Value = TRUE THEN guidenumber = input_gn.Value
distance = input_distance.Value
if distance = 0 then distance = 0.00001 'to prevent divide by zero error
result = (exposure * (guidenumber / distance) * (flashcompensation) * (multicompensation))
(2)
Remove or REM the 3 line sub:
PUBLIC SUB input_distance_KeyPress()
distance = (input_distance.Value)
END
-Fernando
---------- Original Message -----------
[UTF-8?]From: Horst Günther Burkhardt III <horst at ...2298...>
To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
Sent: Fri, 02 Oct 2009 19:18:25 +1000
Subject: Re: [Gambas-user] Arithmetic failure in project
> On Mon, 2009-09-21 at 21:20 +0200, Charlie Reinl wrote:
> > Am Dienstag, den 22.09.2009, 03:42 +1000 schrieb Horst Günther Burkhardt
> > III:
> > > Hey everybody.
> > >
> > > I'm building a basic flash exposure calculator with floats and extremely
> > > precise arithmetic, to benefit those of us who happen to list
> > > photography among our hobbies ;)
> > >
> > > Unfortunately, I've run into several issues with the code.
> > >
> > > The foremost of which: no matter the data that is plugged in, the result
> > > is always 0.
> > >
> > > Also, my case construct for power adjustment is ... considerably failed.
> > >
> > > Attached are my .form .class and a screenshot of the result i get.
> > >
> > > Thanks in advance for all your help :)
> >
> > Salut Horst Günther Burkhardt,
> Guten Tag.
>
> > Tell use , your version of gambas,
> 2.15.2
> > and send us the project "Source archive" can by made by pressing CTRL
> > +ALT+A at same time.
> Which you will now find attached.
>
> > Thanks in advance for all your help :)
> Sorry about all the delay, but I was on speed-restricted internet.
>
> -- Horst
------- End of Original Message -------
More information about the User
mailing list