Help with Arrays in my code?
https://paste.mod.gg/giovsrlllnke/0
Having a bit of an issue with my code. Working on an assignment where I have to load code in from a textfile and it's supposed to load in blocks. My teacher has detailed some header comments on the process, but I keep getting this error When I load in the file
looking at this portion, I'm not sure how to set all my code to be unselected
BlazeBin - giovsrlllnke
A tool for sharing your source code with the world!
16 Replies
Looks like
Selected
is null
I don't see you setting Selected
anywhereRight !! @ZZZZZZZZZZZZZZZZZZZZZZZZZ
There you have it, then.
A "nothing" cannot have a length
I have to make the colours un selected, so I have to find a way to sort of use that selected variable and assign it to the colors array and make it false
Probably is, I;m not sure how to
Or rather, how do I give it a length?
Or maybe I can just make selected false?
@ZZZZZZZZZZZZZZZZZZZZZZZZZ sorry to ping, but any chance you can hep me out
You do not give it a length
You need to set it to... something if you want to use it
That something might have a length, if it's some sort of a collection, for example
I think I need to create a new array of bool and store it in Selected maybe?
I'm a bit lost on how to do this though
Or any ideas on what I should set it to? The idea is that the blocks on the textfile display
It really doesn't need like you need any sort of
Selected
here, judging by the text you sent
Like, this seems to be basically it
Just gotta hook the Colors
array to... something to display themI did this and it worked
It would set all items in the
Selected
array to false
, yesYay I got it to work for this portion
Thank you @ZZZZZZZZZZZZZZZZZZZZZZZZZ
I didn't do much, admittedly, but you're welcome
You notice how I named it //size colours Array? Do you have any ideas for a better headercomment name
If I had to have a comment there, it would probably be "initializing the arrays"
Because I did worked with the Selected thing
Gotcha
Thank you