26 Replies
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/
Why I can't return the array max?
It says " the name 'max' does not exist in the curretn context"
Missing a bracket
there is bracket under
Also max only exists in the scope of the first for since that's where it's defined
its just not seen
$scope
you probably want
$scopes
$scopes
thing a
is available in scope A
and scope B
thing b
is available only in scope B
oh
if I create it outside the for
and then define it inside for
Then it will be available to return
with the variables?
or empty?
When you create it inside for, it also creates the array every iteration of the loop
You can define it outside and set the value in the loop
But then it will be null if the first loop never runs
But it will return the value even tho it's defined inside the loop, right?
like this
When you define the array, since it's a nullable type it will start as null if not assigned
You right
and then if I define it inside the for loop
You can only reference things defined in the same scope or an outer scope
will it return it's values that he got inside the loop?
If it was assigned that then yes
Whenever the loop iterates, a new array is created and the old one is discarded
oh yeah
that was dumb xd
Please name your title better
I didn't think about that
be more descriptive of what the issue is in your title
I will be sure to do so next time
Thank you BoxyBear
♥️
np