These are chat archives for ethereum/tutorials

7th
Mar 2016
Zac Mitton
@zmitton
Mar 07 2016 20:17
funders.length++ seems weird. I feel like funders.length should be enough
Maran
@maran
Mar 07 2016 20:18
You are increasing the number right
Zac Mitton
@zmitton
Mar 07 2016 20:19
yes but if length is currently 5 then index number 5 is next
Maran
@maran
Mar 07 2016 20:19
I have no context
What are you looking at
Zac Mitton
@zmitton
Mar 07 2016 20:19
oh. the crowdsale contract
Alex Van de Sande
@alexvandesande
Mar 07 2016 20:21
@zmitton test it without and report the results! ;-)
Maran
@maran
Mar 07 2016 20:21
I think you will overwrite if you don't increment
but I haven't tried it
Alex Van de Sande
@alexvandesande
Mar 07 2016 20:22
I don’t remember exactly why, but I don’t think it will work without the ++
Maran
@maran
Mar 07 2016 20:23
Because there probably will only ever be one funder that you just keep overwriting
Alex Van de Sande
@alexvandesande
Mar 07 2016 20:23
Probably..
Zac Mitton
@zmitton
Mar 07 2016 20:24
there is also a push method. not sure why that wasnt used. I'll keep reading :)
Alex Van de Sande
@alexvandesande
Mar 07 2016 20:24
I use a push method sometimes.
But of course, I’m pretty sure the code can be improved. Feel free to press the blue button on the bottom and make any optimization there
Zac Mitton
@zmitton
Mar 07 2016 20:27
i dont see any blue button
its ok, i dont think i should be trying to corrrect any solidity code at this time haha
Alex Van de Sande
@alexvandesande
Mar 07 2016 20:27
bottom: “improve this page"
Zac Mitton
@zmitton
Mar 07 2016 22:00
does anyone know what could be the cause of "Parser error: Expected primary expression. "
im trying to create a stuct instance like this: users.push(User({ userAddress: msg.sender, cardHashes: ['hash1righthere'], amounts: 2 }))
sorry im a newb, but I dont know where else to ask. I've been working on this for weeks