from dictionary to CSV

Discussion and feedback on Construct 2

Post » Thu Nov 13, 2014 2:16 am

Hi,

During a game i collect game data into dictionary. I then want to convert the dictionary data into a CSV file, however, for some strange reason I can't get the loop over the dictionary working. What seems simple just doesn't work for me.

Global aCSV: text

On Button Click
-- For Each ADictionary
---- Set aCSV = aCSV & "," & aDictionary.currentvalue


I can confirm that during testing the dictionary has at least two entries, however, for some reason the contents of aCSV is ", 0"

any thoughts would be much appreciated

Dan
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Post » Thu Nov 13, 2014 2:20 am

OK. Found my error.

I got confused between System.ForEach and Dictionary.ForEach.

I used the first, instead of the second. A subtle, yet, very important difference!

now it works.
B
8
S
4
G
1
Posts: 205
Reputation: 1,354


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests