Jump to content

Recommended Posts

Posted

#include <Array.au3>
;Outputs A-Z
Dim $array[26]
For $i = 0 to 25
    $array[$i] = Chr (65+$i) 
Next
_ArrayDisplay ($array)

;Outputs a-z
Dim $array[26]
For $i = 0 to 25
    $array[$i] = Chr (97+$i) 
Next
_ArrayDisplay ($array)

;Outputs random case.

Dim $array[26]
For $i = 0 To 25
    $cap = Random (0, 1, 1)
    If $cap = 1 Then
        $pre = 65
    Else
        $pre = 97
    EndIf
    $array[$i] = Chr ($pre+$i) 
Next
_ArrayDisplay ($array)

Cheers,

Brett

:P

Posted (edited)

Ok, I had to do some performance testing. :P

On my laptop (Celeron 1.7Ghz) here were my results.

PsaltyDS' Method

Zedna's Method

BrettF's Method

To be honest, my first attempt looked exactly like BrettF's. I really need to get it in my head to check out the RegExpr functions when I deal with strings; but it appears in this particular case a good 'ol stringsplit does the trick.

a_z_test.au3

Edited by spudw2k

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...