This content has been marked as final. Show 2 replies
You'll need some sort of handler that initiates a new survey. If you
already do, that's the place to reinitialize your global. If you don't, you
need it. Right now, how do you differentiate between users? How does Lingo
know when a new surveyor is inputting data?
"curlimacue" <email@example.com> wrote in message
>I have a survey. At the beginning, I declare global variable called
> gAllAnswers. As I go through survey, the answers (radio button values) are
> appended and added to a string in this global gAllAnswers. Then at the
> end I write this data out to a txt file using FileIO.
> My problem is, as more than one user goes through the survey, the global
> variable is retaining all the users data. For ex, the first time thru it
> user 1's data. Then second time user 1's data is already there, and then
> adds on user 1's data again (because it persists) as well as user 2's
> data --So
> I have user 1's data twice which I don't need.
> How can I reset this global variable (I don't want to clear it, because I
> still need to use it)?
> I tried putting on a mouseUp event at end of my survey a
> set gAllAnswers = ""
> but that didn't work.
> I appreciate any hints/direction.
> Thank you.
I'm guessing that the 'end' of the project as far as a single user is
concerned is when their data is written out to a file, right? If so,
then after the data is no longer needed in memory (i.e. after it has
been written out to a file), then set your variable to VOID (or whatever
the starting value should be).