Use this forum to post Vensim related questions.
almoon
Senior Member
Posts: 77 Joined: Tue May 06, 2008 9:20 am
Post
by almoon » Sun Nov 07, 2010 8:39 pm
I have a problem with the listvar it keeps give me that the listvar is empty so what is going on ?
do I need to change anything in my model to make it work ?
Administrator
Super Administrator
Posts: 4592 Joined: Wed Mar 05, 2003 3:10 am
Post
by Administrator » Sun Nov 07, 2010 11:55 pm
Can you post anything here that demonstrates the error?
bob@vensim.com
Senior Member
Posts: 1107 Joined: Wed Mar 12, 2003 2:46 pm
Post
by bob@vensim.com » Mon Nov 08, 2010 11:42 am
The message occurs when the variable referred to is not a constant (or a gaming variable in game mode)
almoon
Senior Member
Posts: 77 Joined: Tue May 06, 2008 9:20 am
Post
by almoon » Mon Nov 08, 2010 2:27 pm
LISTVAR,"FINAL TIME",88,24,7,4,L|System|10|B|255-0-0,[0|60]10|20|30|40|50|60
so this is what I wrote, so what do you think the problem?
Administrator
Super Administrator
Posts: 4592 Joined: Wed Mar 05, 2003 3:10 am
Post
by Administrator » Mon Nov 08, 2010 3:12 pm
Are you running a game while trying to access the listbox?
almoon
Senior Member
Posts: 77 Joined: Tue May 06, 2008 9:20 am
Post
by almoon » Mon Nov 08, 2010 3:15 pm
Yes.
Administrator
Super Administrator
Posts: 4592 Joined: Wed Mar 05, 2003 3:10 am
Post
by Administrator » Mon Nov 08, 2010 5:50 pm
That's the reason. FINAL TIME is a constant, you cannot modify it during a game (you can only change it before the game starts).
almoon
Senior Member
Posts: 77 Joined: Tue May 06, 2008 9:20 am
Post
by almoon » Mon Nov 08, 2010 6:58 pm
mmmm and am not sure how to do that...
Administrator
Super Administrator
Posts: 4592 Joined: Wed Mar 05, 2003 3:10 am
Post
by Administrator » Mon Nov 08, 2010 7:48 pm
Have a screen where you set constants (like final time etc). Then move to a new screen when you start the run where you can change the gaming decisions.
almoon
Senior Member
Posts: 77 Joined: Tue May 06, 2008 9:20 am
Post
by almoon » Tue Nov 09, 2010 11:55 am
Thanks, I did that but the problem is still available ,,,
but I was thinking is the final time is the same one in the model when we put the setting of the model?
maybe from there the problem ?
bob@vensim.com
Senior Member
Posts: 1107 Joined: Wed Mar 12, 2003 2:46 pm
Post
by bob@vensim.com » Wed Nov 10, 2010 10:45 am
You need to look at the equation for FINAL TIME. Normally this is a constant, but many models, especially project models, make this a variable. If it is not a constant you won't be able to change it. I would not recommend making FINAL TIME a game variable.
A more useful question might be why you would want to change FINAL TIME anyway? If the user is tired of the game they can just stop playing.