« first day (2895 days earlier)      last day (2069 days later) » 

10:00 PM
the elements would be the individual values (after separating by a comma)
so, assuming the first line is "Ray,12,hello"
the value would be ["Ray", "12", "hello"] right?
 
I would think it would be, but in the situation when I run this code and print out employee[0] it prints out the entire line
Which is super awkward
 
> Console.WriteLine(line);
you print the entire line
 
oh seriously
 
but... even then
 
time to google one sec
 
10:02 PM
one line after the split, you have this: line = sr.ReadLine();
now, what will that do to the employee variable and its value?
@Twissted like this?
 
If I changed the line = sr.ReadLine() to like employee[0] would that print out Ray?
funny
 
not entirely
lets go back to my question first
> now, what will that do to the employee variable and its value?
 
Well it's reading an entire line and assigning said value to line
You are making my brain hurt
 
yes, and what will that do to the employee variable and its value?
 
If I put the line=sr.ReadLine(); first would that fix anything?
 
10:08 PM
just answer my question :)
 
Because it's assigning an entire line to the variable line but not splitting it into anything
 
but line is supposed to be the entire line
so that would be fine
 
I'm totally lost honestly. The only ideas I can come up with are laid out. The employee variable shouldn't be changing in my mind. It's been saved as line.Split. Assuming it looks like you previously stated and therefore employee[0] should be Ray. If I wanted to specifically print out employee[0] I would imagine there is a Console.Write function that I haven't learned to print it out as just [0]
 
> The employee variable shouldn't be changing in my mind.
this is exactly right
 
Gah
 
10:14 PM
a lot of people would think that the employee changes because the value of employee is line.Split(",")
 
So is this technically reading my file and putting them all into an array already?
 
but because C# is procedural, it will not make it reference stuff like that
 
I just have to figure out how to work with it
 
the line = sr.ReadLine() is oddly placed imho though
I would recommend you to first read out the content from the file and put it into a string or a List<String>
then iterate over it
it will prevent you from mixing lines
it also allows you to change the code more easily and a lot of other good things, but we want to avoid making these silly (easy to make) mistakes
on the other hand, you shouldnt fix code that isnt broken
but since this is a learning excersize, I would encourage you to try to split things up
the same way how you split things up in different actions so you can search for them and stuff, you should split the code in that same way
 
Yeah cause I need to be able to move things around based on different parts of those lines
 
10:19 PM
I am not sure if you have made functions before, but making a separate function to read out the lines and making a separate function to "process" them would be very appropriate
 
So I imagine I need to separate and save into 3 different arrays
It's very different from java having to work with a .txt file
 
I assume the rows would remain the same, only the order changes
so one array would be better
wait...
one array (where the elements are rows)
each element could also be an array
so an array of arrays of strings
 
oooooh
 
Java and C# are not really different
in terms of learning programming
 
That makes sense because then you could determine which are greater or less than in each position and organize the array itself based on that
 
10:22 PM
Java and C# start having differences on more advanced levels though
where I then would favour Java
 
I mean i'm excited to learn c# because I enjoy a challenge
 
C# is a fine language to learn and use
 
But it's hard when your instructor goes off talking about content that doesn't seem relevant to the homework we have to do
I literally learned java using the textbook and never went to a class and got an 90
Because the instructor was so bad
 
at school, I learned how to do println
that took them about 2 years
the other 2, I just played games
 
lol
 
10:24 PM
I think learning programming from hobby projects and sharing code like you did just now is a very good learning approach
it gives you a much more relatable goal
it gives you your own pace
 
It was very helpful and I appreciate your time
 
no problem
 

« first day (2895 days earlier)      last day (2069 days later) »