>From: "Brad Hile" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Date: Sat, 11 Jan 2003 18:23:11 +0800
>Subject: <lingo-l> Percentage calculations
>Reply-To: [EMAIL PROTECTED]

>Just wondering if anyone has a better way to work out percentage values.
>Currently I'm having to append text to the number then  use value
>it works but seems kinda kludgy.
>something like this:
>PercentAddition=2
> eq=value(PercentAddition) 
> if value(PercentAddition)<100 then eq=value("0."&
>PercentAddition)
> if value(PercentAddition)<10 then eq=value("0.0"&
>PercentAddition)
> percentValue=totalcost * eq
>
>I've tried 
>set the floatprecision=2
>eq=PercentAddition)/100
>
>but it always returns 0.00 
>
>Any thoughts ?
++++++++++++++++++++++++++++++++++++++++++++++++

Seems as if "0.0" and "0", is just plain strings of bricks... and the result is 
zip..! 
First there have to be a value for the beginning to use.. The total value, 
timelengt, size...

Find your way so you get the path of having numbers..not strings. 
Brake it up, and track it through 'message' in menu at right, (CTLR+M)in 
Director. Set the Lingo-code of 'put eq' (the variables you are tracking down).
And do so with the rest of the variables you mess with. 

'Floatprecision' gives the decimals, you only make the maths in your target 
code. Concentrate on that first..and use parenthesis in frequent to box in your 
separate math-rituals..

For measuring % for sounds, it's hard to get the actual length in seconds or in 
bytes - in a unit scaled for an external file. One have to put it's value into 
by the file-name procedure as I recall it. Even some problems with internal 
sound files and might be so for other files too.. 
If you are aiming for % in a game or edutainment whatever ...it is probably 
easier to have the full knowledge of the total length or sum or what might be 
considered. 


                                                   Iceman


-------------------------------------------------
FREE E-MAIL IN 1 MINUTE!
 - [EMAIL PROTECTED] - http://www.pc.nu
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to