Jump to content

Recommended Posts

Posted

Looks good Jon but your math could use a touch up. 3.0.100 would be older than 3.0.94 not newer. Me thinks maybe 3.1.00 is what you needed.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

  • Administrators
Posted

Looks good Jon but your math could use a touch up. 3.0.100 would be older than 3.0.94 not newer.  Me thinks maybe 3.1.00 is what you needed.

In MS programs version number components are:

major.minor.build.revision

To see if something is newer you compare the major numbers seperately, then minor, etc.

100 is the "100th build" of 3.0


 

  • Administrators
Posted

What is the deadline for submitting help file updates?

6pm Friday GMT.


 

  • Administrators
Posted

Updated:

3.0.100 (24th Feb, 2004)

- Fixed: @UserProfileDir under 9x

- Fixed: IsDeclared()

- Fixed: Random()


 

Posted

Random() seems to work good, I tested a few million of them with some scripts, like this:

dim $a[7]
$begin = TimerStart()

$count=1000000
For $i=1 To $count
    $x= Int(Random(6)+1)
    $a[$x]=$a[$x]+1
Next
For $i=1 To 6
$a1=$a1&$i& "= "&$a[$i]&@TAB&@TAB&$a[$i]/$count*100&"%"&@CRLF
Next
$time=StringFormat ("%.2f",(TimerStop($begin)/1000))
MsgBox(1,"Random 1-"&$count,$a1 &@CRLF&"Time to complete in seconds="&$time )

Updateing the Help file was nice, you left in the coin flip with no output though:

;Flip of coin

If Random(0, 1) > 0.5 Then

    $msg = "Heads. 50% Win"

Else

    $msg = "Tails. 50% Loss"

Endif

;Roll of die

msgBox(0,"", "You rolled a " & Int(Random(6)+1) )

AutoIt3, the MACGYVER Pocket Knife for computers.

Posted

I think to get a true 50% chance the coin toss example should be

;Flip of coin
If Random(0, 1) >= 0.5 Then
    $msg = "Heads. 50% Win"
Else
    $msg = "Tails. 50% Loss"
Endif

GrahamS

Posted

actually I meant it doesn't display.

;Flip of coin
If Random(0, 1) >= 0.5 Then
   $msg = "Heads. 50% Win"
Else
   $msg = "Tails. 50% Loss"
Endif

should be

;Flip of coin
If Random(0, 1) >= 0.5 Then
   $msg = "Heads. 50% Win"
Else
   $msg = "Tails. 50% Loss"
Endif
msgbox(1,"Coin Toss",$msg)

AutoIt3, the MACGYVER Pocket Knife for computers.

Posted

In MS programs version number components are:

major.minor.build.revision

To see if something is newer you compare the major numbers seperately, then minor, etc.

100 is the "100th build" of 3.0

We will not avoid user testing as @AutoItVersion < "3.0.100.0" for pre-release handling.

Next beta should start a 3.10.100.0 more room for final release.

Still there is a need to solve "function call" to someone which disapear as the release are rolling. If we can have the following code

if @autoitversion > "3.0.101.0" then
       ; code with new function
else
       ; code with function working in 3.0.100
endif

that will ease the include implementation :whistle:

  • Administrators
Posted

Fixed the FOR bug with recursion.

It was a fairly fundamental change to the FOR/NEXT statements so make sure you all give them a good test :whistle:


 

Posted

actually I meant it doesn't display.

;Flip of coin
If Random(0, 1) >= 0.5 Then
   $msg = "Heads. 50% Win"
Else
   $msg = "Tails. 50% Loss"
Endif

should be

;Flip of coin
If Random(0, 1) >= 0.5 Then
   $msg = "Heads. 50% Win"
Else
   $msg = "Tails. 50% Loss"
Endif
msgbox(1,"Coin Toss",$msg)
Actually I meant it to be:

;Flip of coin
If Random() < 0.5 Then
   $msg = "Heads. 50% Win"
Else
   $msg = "Tails. 50% Loss"
Endif
msgbox(1,"Coin Toss",$msg)

I guess the (0, 1) args work, but are not needed.

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

  • Administrators
Posted

Updated with an FAQ section. God that was boring....

Fact of the day, the help file is now 630KB uncompressed! That's a lot of help. Thank you again to the help file editors - I know it is a nightmare job :whistle:


 

Posted

Updated with an FAQ section.  God that was boring....

Fact of the day, the help file is now 630KB uncompressed!  That's a lot of help.  Thank you again to the help file editors - I know it is a nightmare job  :whistle:

The help file is 4x larger than the program that it describes. I remember when the help file was smaller than AutoIt3.exe.
Posted

I like the FAQ section, I've learnt stuff I didn't know from this! Especially liking point 9 about using StringFormat with lots of variables, reminds me of C (arrrgh!).

Noticed a slight typo though:

Advanced: If you have many variables to add into a string then you may find the StringFormat() function use full.

use full should be useful

  • Administrators
Posted

I like the FAQ section, I've learnt stuff I didn't know from this! Especially liking point 9 about using StringFormat with lots of variables, reminds me of C (arrrgh!).

Noticed a slight typo though:

Advanced: If you have many variables to add into a string then you may find the StringFormat() function use full.

use full should be useful

Only some half-crazed person could have come up with StringFormat. *waves to JP*


 

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
×
×
  • Create New...