#How to increment a global val with recursion

1 messages · Page 1 of 1 (latest)

tiny scrollBOT
#

<@&987246399047479336> please have a look, thanks.

tiny scrollBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

split remnant
#

Given the recursion you use, end nor start are ever increased or decreased

#

The first thing you'd gotta do is put the increment/decrement of the variables before the function call

#

Question, though: in this context, you probably wouldn't need global variables to control the index of the array you're using, so is this the only context or is there another context that those variables would be used in?

#

It's generally not a very good practice to use global variables unless absolutely necessary

tiny scrollBOT
#

Closed the thread due to inactivity.

If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you 👍