Jump to content

Recommended Posts

Posted

Dim $aArray[2]

$aArray['a'] = "AA"

$aArray['b'] = "BB"

Msgbox(0,'Array:' , $aArray['a']) ;;; return "BB"

Why?

--------------javascript-----------------

<script language='javascript'>

<!--

var arr = new Array();

arr['a'] = "AA";

arr['b'] = "BB";

alert(arr['a']); // return "AA"

//-->

</SCRIPT>

--------------php Script--------------

<?php

$arr = array(

"a" => "AA",

"b" => "BB",

);

echo $arr["a"]; // return "AA"

?>

Posted

AutoIt does not convert characters to numeric values like php. In fact both 'a' and 'b' will evaluate to zero in this usage.

Thus:

Dim $aArray[2]

$aArray['a'] = "AA" ;assigned to element 0

$aArray['b'] = "BB" ;overwrites previous assignment

For $i = 0 to 1

MsgBox(4096,$i, $aArray[$i])

Next

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

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