Jump to content

Recommended Posts

Posted

hi

I want a loop to do the following:

x=100; start point first result of the loop

100*1.2=120; is the second result of the loop

120*1.2=144; is the 3ed result of the loop

144*1.2=173; is the 4th result of the loop

....

etc

I tryed to solve it like this

for $i=1 to 10

send (x*1.2)

next

it dosnt work; please help

kind regards

Posted

This should work, just enter the code and you have 2 seconds to get to notepad or what have you before it begins. Think this is what you were talking about.

$x = 1
sleep(2000)

For $i = 1 to 10
send($x*1.2&@CRLF)
$x = $x+1
Next
Posted

I have it working fine, however it is not rounding for instance on your sheet you have the 4th iteration as 173 but 144 x 1.2 = 172.8. The script just deals with exact numbers so every iteration will give you an additional decimal place.

Posted

boogieoompa :

yes its rounding problem results are:

120

144

1728

20736

248832

is it possible to solve it; I apriciate your help

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...