0 votes

[copied from GT FB group]

I have a program that I update frequently but I want users to resume with their variables intact, so I use *events *startup. In the latest update, I added some variables that I initialize to 0. I want these to initialize for anyone new since the update, but I don't want it to overwrite to 0 every time they return. So I have something like this:

*if: not iterations
    >>iterations=0

That will NOT reset it back down to 0 for returning users, right?

 

by (5.8k points)

1 Answer

0 votes

This is correct, this way returning users won't lose their progress.


You can also set it to empty with

*if: not iterations
    >> iterations = []

Also, note that there's a bug with *set for the moment that may prevent you from using it in this context; using *set below an *if in this manner can currently cause problems. (Basically, the *set will not persist outside of a nested child program that it's *set in.) This should change soon.

 

Using the >>...= format, as you did, is still fine.

 

by (5.8k points)
Welcome to Guidedtrack Q&A, where you can ask questions and receive answers from other members of the community.
134 questions
144 answers
55 comments
40 users