Amathian Posted May 17, 2014 Share Posted May 17, 2014 (edited) I can't figure out why this is happening! Any ideas or help? Thanks! Here's the code: **As a note, I did some testing and saw that the section names are printing correctly (inireadsectionnames) but the i am either having problems with inireadsection or when i write to the console. ** As another note .. the first section can read (in the inireadsection is it [1][0] and [1][1]) but once I hit the second section [2][0] and [2][1], this is where I have an error. Oh. and the error I am receiving is :Array variable has incorrect number of subscripts or subscript dimension range exceeded func Assessment() local $c = 0, $s, $q, $cn, $cf=1 while $c <> 156 $c = $c + 1 $cn = IniReadSectionNames ("hipaa.ini") ConsoleWrite ($cn[$cf]) $q = inireadsection ("hipaa.ini", $cn[$cf]) consolewrite ($q[2][0] & $q[2][1]) $cf = $cf + 1 wend EndFunc Edited May 17, 2014 by Amathian Link to comment Share on other sites More sharing options...
DicatoroftheUSA Posted May 17, 2014 Share Posted May 17, 2014 (edited) If your error is your keyboard exploding and your keys are getting stuck in your brain. It is because you made the hamster god angry. If you want a better answer your would be better off not making people you want to help you play guessing games. But when using arrays, makes sure to use "if isarray" and use _arraydisplay to check if its contents are what you expect. Edited May 17, 2014 by DicatoroftheUSA Statism is violence, Taxation is theft. Autoit Wiki Link to comment Share on other sites More sharing options...
Amathian Posted May 17, 2014 Author Share Posted May 17, 2014 If your error is your keyboard exploding and your keys are getting stuck in your brain. It is because you made the hamster god angry. If you want a better answer your would be better off not making people you want to help you play guessing games. But when using arrays, makes sure to use "if isarray" and use _arraydisplay to check if its contents are what you expect. Sorry. I edited it probably while you were looking t the page (I need sleep:P) Link to comment Share on other sites More sharing options...
DicatoroftheUSA Posted May 17, 2014 Share Posted May 17, 2014 After assigning your arrays, test them with "if issarray($YourArray)" and "_arraydisplay($YourArray)" Statism is violence, Taxation is theft. Autoit Wiki Link to comment Share on other sites More sharing options...
Amathian Posted May 17, 2014 Author Share Posted May 17, 2014 (edited) Tried it, worked successfully. From this I learned that the array itself won't work. Here is the updated code after testing and such func Assessment() local $c = 0, $s, $q, $cn, $cf=1, $i while $c <> 156 $c=$c+1 $cn=IniReadSectionNames ("hipaa.ini") $q=IniReadSection ("hipaa.ini", $cn[$cf]) ConsoleWrite($q[$cf][0] & $q[$cf][1]) $cf =$cf+1 WEnd EndFunc And here is the error I'm receiving: §164.308(a)(1)(i)Does your practice develop, document, and implement policies and procedures for assessing and managing risk to its ePHI?"C:UsersAdamDocumentstoolraw.au3" (28) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: ConsoleWrite($q[$cf][0] & $q[$cf][1]) ConsoleWrite(^ ERROR From the tests you recommended and I ran, the problem is within the command: ConsoleWrite($q[$cf][0] & $q[$cf][1]) The "inireadsectionnames" reads everything fine, the "inireadsection" reads everything fine. but when the array goes from [1][0] to [2][0] is where I receive the errors. I also used a for loop in place of the while loop and everything worked just fine. The problem is in that command for some reason ONLY when I use a while loop. I would just use a for loops but it's not optimal for the project I want to do. Any suggestions? Edited May 17, 2014 by Amathian Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 17, 2014 Moderators Share Posted May 17, 2014 (edited) Amathian,Using Iniread Section means that $q has 2 dimensions (0 & 1) so increasing $cf to more than 1 is what is causing the error.However, a closer look at your code leaves me struggling to understand what you are trying to do by continually increasing $cf. Perhaps if you explained the purpose of the code we might be able to offer you some help - at present doing so is difficult.M23 Edited May 17, 2014 by Melba23 Clarification (I hope) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jchd Posted May 17, 2014 Share Posted May 17, 2014 What is the 156 constant and why on Earth do you read the section names 156 times? Then is it correct that you want to display the first key and the first value in the first section, then the second pair key/value in the second section, then the third pair in the third section, and so on? (I guess no). This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now