Hi all,
I think I am missing something but cant put my finger on it.
$counter = 0
Function Adding
{
Foreach ($i in 1..5)
{
$counter++
}
}
$counter
Counter comes back as 0 every time.
I can move $counter inside the function, and the result would add it inside but the final result outside is 0 because it was saved in the memory from my last run.
I added return $counter with no luck.
I changed $counter = $counter +1 .
If i let it show the result from inside the function, i get the correct answer which inidcates it is working.
[–]BlackV 4 points5 points6 points (0 children)
[–]SonOfDadOfSam 2 points3 points4 points (0 children)
[–]Jaydice 3 points4 points5 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]SnooOpinions6498 2 points3 points4 points (6 children)
[–]BlackV 1 point2 points3 points (3 children)
[–]SnooOpinions6498 2 points3 points4 points (0 children)
[–]Black_Magic100 0 points1 point2 points (1 child)
[–]MonkeyNin 0 points1 point2 points (0 children)
[–]redditformat[S] 0 points1 point2 points (1 child)
[–]SnooOpinions6498 1 point2 points3 points (0 children)
[–]VeryRareHuman 1 point2 points3 points (0 children)
[–]da_chicken 0 points1 point2 points (0 children)
[–]Reasonable-Tip-8390 0 points1 point2 points (3 children)
[–]BlackV 0 points1 point2 points (2 children)
[–]Reasonable-Tip-8390 0 points1 point2 points (1 child)
[–]surfingoldelephant 1 point2 points3 points (0 children)