Global Vars

In VB6 I used lots of global variables choice1, choice2… answer1, answer2… etc to track user input.
Is that good practice in Xojo?
Better to put all this into 1 array variable?
Thanks.

Globals are an awful idea for a lot of reasons besides making debugging really darned hard

Hard to give much more advice without knowing more about the context for your question

just make an array an put them in

it’s several pages of colours to choose, then several pages of questions. Sounds neat to put all user input into 1 array, yes.
Just a regular “array” ?

Create a module, etc, yes?

colors for ? are these “preferences” - ie/ what colors would you like to use for the questionairre ?

questions ? multiple choice ? … yes no true false ?

If the answers to both are “yes” then you might have a “user preferences” class that holds all those selected colors
And for questions you might have a Question class that holds the question itself + the users response (and a flag to know if they responded at all so maybe you can go back through them and see they all have answers)

Then you’d want to have an array of questions

thanks! - will try tomorrow - getting late here

Over some pages, user clicks and selects 20 colour choices (blue is “1” red is “2”).
(eg choice1 =“1”, choice2=“2” etc.)
Then the user clicks 20 multiple choice answers ( eg ans1=“a”, ans2=“b”)
Then I say final_choice = choice1+choice2+choice3+choice4
This could be “1212”
Then I look this up in a database.

Best with a module with a global array?

I have been using a dictionary for that kind of thing. It is far easier to use than an array.
http://developer.xojo.com/dictionary

Thank you all so much! I’m slowly grinding this thing out.