Please enable JavaScript to view this site.

Vensim Help

If tpoints1 < tpoints2 Then tpoints = tpoints1 Else tpoints = tpoints2

Graph1.DrawMode = 0

Graph1.NumPoints = tpoints

Graph1.NumSets = 2

Graph1.ThisSet = 1

For i = 1 To tpoints
Graph1.ThisPoint = i
Graph1.GraphData = rval(i)
Next i
Graph1.ThisSet = 2
For i = 1 To tpoints
Graph1.ThisPoint = i
Graph1.GraphData = rval2(i)

Next i

Graph1.DrawMode = 2

A simple Visual Basic graph capability is used to display results.  There are probably more efficient ways to do this, but it is important to stop the graph from drawing itself every time a new point is added and that is why DrawMode is changed twice.