How to move through a list of variables each time a collision occurs?

I have set up an educational game, where there is a list of questions to answer. Each question has been stored to a variable. For example:
Do = “What color is the sky?” to the text of global variable 0001
Do = “What color is tree bark?” to the text of global variable 0002
Do = “What color is charcoal?” to the text of global variable 0003

Each time the player character collides with any object, a text box object named QuestionBox opens up with a question, using:
Do = GlobalVariableString(0001) to the text of QuestionBox

The player can then choose which answer to click on. If they choose the correct answer, the game resumes.

My question: how to move on to variable 0002 for the next question? I would like to nest a variable that can be added to, like this:
Do = GlobalVariableString(ProblemNumber) to the text of QuestionBox
And each time the player answers a question, just add one to the value of the ProblemNumber variable. But it seems the GlobalVariableString does not allow a variable nested inside. Is there another workaround?

I think it would be much nicer to use the dialogue tree feature, no?

Anyway, to answer your question, go to the wiki page on variables and scroll down to “structures” and “dynamic access”.

Cheers

I’m with @Gruk about using dialogue, but if you wanna try other method, instead of global variable try to add variables to the object QuestionBox, like
Instance variables

So check when player collides with QuestionBox you select which of the QuestionBox variable is selected, then go to the next dialog or question.

Thanks for the replies! I am trying the dialogue tree as you suggested, I’ll report back soon on how it goes for future designers interested in a similar problem.