Sign in to follow this  
Followers 0
Swimming_Bird

Error with _ArrayDisplay

4 posts in this topic

#1 ·  Posted (edited)

Here's my code:

#include <Array.au3>
$alarmini = IniReadSection ( 'alarmconfig.ini' , '13:07' )
_ArrayDisplay ( $alarmini , '' )

and here's the section it should be reading:

[13:07]
1=0
2=0
3=0
4=0
5=0
6=0
7=1
8=0

i cant figure out why i'm getting this error:

C:\Program Files\AutoIt3\Include\Array.au3 (172) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.:

$sMsg = $sMsg & "[" & $iCounter & "]= " & StringStripCR($avArray[$iCounter]) & @CR

$sMsg = $sMsg & "[" & $iCounter & "] = " & StringStripCR(^ ERROR

Edited by Swimming_BIrd

Share this post


Link to post
Share on other sites



Nevermind, it doesnt work because it's a 2d array :lmao:

Share this post


Link to post
Share on other sites

I can't see the $iCounter part of code, I don't know how it got out bound of array dimension, you probably have this $sMsg in a loop, may be try checking the $iCounter see if it need reset before or after the loop, or keep it below the array limited set in Dim.

Share this post


Link to post
Share on other sites

I can't see the $iCounter part of code, I don't know how it got out bound of array dimension, you probably have this $sMsg in a loop, may be try checking the $iCounter see if it need reset before or after the loop, or keep it below the array limited set in Dim.

_ArrayDisplay accepts 1 dimensional array

IniReadSection returns 2 dimensional array

Therefore the errors


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0