Please enable JavaScript to view this site.

Vensim Help

Dim timeval As Single

result = vensim_command("SIMULATE>RUNNAME|bobblah")

If result = 0 Then Exit Sub

num$ = Text1.Text

comstr$ = "SIMULATE>SETVAL|POPULATION INITIAL = " + num$

result = vensim_command(comstr$)

If result = 0 Then Exit Sub

result = vensim_command("GAME>GAMEINTERVAL|5")

If result = 0 Then Exit Sub

result = vensim_command("MENU>GAME")

If result = 0 Then Exit Sub

result = vensim_get_val("Time", timeval)

If result = 1 Then
stime$ = timeval
Label3.Caption = "Time = " + stime$

End If

result = vensim_get_val("Population", timeval)

If result = 1 Then
stime$ = timeval
Label4.Caption = "Population = " + stime$

End If

In order to run a game it is necessary to first start the game and then continue it.  This is true whether you are using the vensim_start_simulation function or just the GAME>GAMEON command.  This code starts the game and then retrieves some indicators of the games status for display.