·· ħþø ·· Posted May 9, 2006 Share Posted May 9, 2006 (edited) So I'm trying to use a Global $array inside of a function, but as soon as I enter the function, $array becomes non-array, and I'm absolutely lost as to why. Here's the pseudo: Global $array[1] MsgBox(0,"...",IsArray($array)); returns '1' _myFunc Func _myFunc() MsgBox(0,"...",IsArray($array)); returns '0' EndFunc I tried adding a 'Global $array' inside of the function, didn't change anything. What am I doing wrong here? tia, ] asbo Edited May 9, 2006 by ·· ħþø ·· Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 9, 2006 Moderators Share Posted May 9, 2006 So I'm trying to use a Global $array inside of a function, but as soon as I enter the function, $array becomes non-array, and I'm absolutely lost as to why. Here's the pseudo: expandcollapse popup Global $array[1] _myFunc Func _myFunc()That's what you call pseudo code? Just post your issue, the way you have it, $array[0] is the only thing that could retain a value. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options... ·· ħþø ·· Posted May 9, 2006 ·· ħþø ·· Members 2 Author Share Posted May 9, 2006 That's what you call pseudo code? Just post your issue, the way you have it, $array[0] is the only thing that could retain a value.Sorry, I was tabbing around and accidentally submitted it Link to comment Share on other sites More sharing options... Moderators SmOke_N Posted May 9, 2006 SmOke_N Moderators 16.3k 49 It's not what you know ... It's what you can prove! Moderators Share Posted May 9, 2006 Well this would be considered pseudo code IMHO:Global $array[1] $array[0] = "Testing This Array" MyFunc($array) Func MyFunc(ByRef $aArray) If IsArray($aArray) Then For $iCount = 0 To UBound($aArray) - 1 MsgBox(64, 'Info:', '$aArray[' & $iCount & '] = ' & $aArray[$iCount]) Next EndIf EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options... 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 Share More sharing options... Followers 0
Recommended Posts
Recently Browsing 0 members