Please enable JavaScript to view this site.

Vensim Help

 

C/C++int VEFCC vensim_get_state(char *runname, float *attime, void *buf, int maxbuflen) ;

int VEFCC VensimCGetState(int context, char *runname, float *attime, void *buf, int maxbuflen) ;

 

The vensim_get_state function allows you to retrieve the state of a simulation from the named run. This state can then be used to resume the simulation. This, combined with vensim_set_state provides the same results as resuming from a run but is faster to execute. This is especially true in the multicontext DLL.

If vensim_get_state is called with a 0 or negative buffer size (maxbuflen), it will return the space needed for the buffer, without actually writing the state to *buf (which may be NULL).

 

Arguments

runnameThe run from which to obtain the state
attimeThe time from which to resume
bufA buffer into which the state will be placed.
maxbuflenThe maximum amount of space (in bytes) that can be used in buf.

 

Returns

0 if the state is empty

A negative error message (see vendllerr.h)

Otherwise, upon success, the size of the state buffer.

 

See Also

vensim_set_state