Realm Posted August 23, 2010 Share Posted August 23, 2010 (edited) I have a large CSV file that collects stats, and adds to the first stat option, for some reason, It will not convert the $data array back into a string. I have tried a few options with no avail. Maybe some1 can find what is wrong here. this is a the snip from the larger script, I do have all the proper includes. _arraydisply() will properly show the $data as an array before attempting to convert into a string. While 1 $r=_ArraySearch($statArray, $name, $sr, 0, 0, 1) If @error Then _ArrayAdd($statArray, $name&";1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0") Else $data=StringSplit($statArray[$r],";") If $data[1]=$name Then $data[2] +=1 _ArrayDisplay($data) _ArrayToString($data,";",1);<<===Is not converting $data back to string MsgBox(0,"$data",$data) $statArray[$r]=$data MsgBox(0,"$statArray[$r]",$statArray[$r]) Else $sr=$r+1 ContinueLoop EndIf EndIf WEnd Edited August 23, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
targeter Posted August 23, 2010 Share Posted August 23, 2010 What error are you getting? It always helps to throw in some consolewrites along the way to help debug the code.... you can always comment them out as you move forward towards the end of the code. Link to comment Share on other sites More sharing options...
Realm Posted August 23, 2010 Author Share Posted August 23, 2010 It's not throwing an error, its just not converting the array, $data, back in to a string where I pointed., I noticed it in a later _arraydisplay() as a blank line My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
targeter Posted August 23, 2010 Share Posted August 23, 2010 $data=StringSplit($statArray[$r],";") what does $data look like right after this?.... Link to comment Share on other sites More sharing options...
Realm Posted August 23, 2010 Author Share Posted August 23, 2010 (edited) an array from $data with 0 showing number of elements, and 32 elements as it should read, than it shows the same right after $data[2] +=1 with the new stat correction. Edit:corrected typo Edited August 23, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
targeter Posted August 23, 2010 Share Posted August 23, 2010 (edited) _ArrayToString($data,";",1) shouldn't that one be like $data[1] I haven't used arraytostring before, so I am taking a stab out there. Edited August 23, 2010 by targeter Link to comment Share on other sites More sharing options...
Realm Posted August 23, 2010 Author Share Posted August 23, 2010 No, read the helpfile. It works in other parts of my script, for some reason it does not in this section My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
targeter Posted August 23, 2010 Share Posted August 23, 2010 (edited) My fault... just looked at the wiki. Do you need to spec the end index if you spec the start?Just started plugging away at some test code... you don't need to spec end...And I assume the _arraydisply($data) is just a typo in your code... Edited August 23, 2010 by targeter Link to comment Share on other sites More sharing options...
Realm Posted August 23, 2010 Author Share Posted August 23, 2010 (edited) Just started plugging away at some test codeFirst of All this is my 'test code'. Secondly, I had been 'plugging away' for over an hour. Third, I only ask for help here when I am truly stuck. Now, What kicks me in the butt, is that you have clearly pointed out that you have no clue how the functions in my code work, and somehow you believe you are the one that can help me. I do appreciate you wanting to help, and I encourage you to help as many as you can, but I suggest skipping the ones, that have a problem or code that you don't understand yourself. Edited August 23, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
Tvern Posted August 23, 2010 Share Posted August 23, 2010 (edited) Pretty harsh words against someone trying his best to help you. It clearly states in the help file that _ArrayToString returns a string, rather than converting the array into one. You're just trying to display the original array in a messagebox. Edited August 23, 2010 by Tvern Link to comment Share on other sites More sharing options...
Realm Posted August 23, 2010 Author Share Posted August 23, 2010 (edited) Nvm, solved it on my own, I forgot to assign it to a variable. $data=_ArrayToString($data,";",1) Edited August 23, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. 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