Please enable JavaScript to view this site.

Vensim Help

C/C++unsigned long VEFCC vensim_get_varoff(const char *varname) ;

unsigned long VEFCC VensimCGetVarOff(int context,const char *varname) ;

Javapublic static native int get_varoff(String varname) ;

public static native int CGetVaroff(int context,String varname) ;

VBPrivate Declare Function vensim_get_varoff Lib "vendll32.dll" (ByVal varname$) As Long
Pascalfunction vensim_get_varoff  (varname: PChar ):  Longint ; stdcall ; external 'vendll32.dll' ;

This function is intended for use with vensim_get_vecvals.  By filling up a vector of offsets you can speed the retrieval of multiple values.

Arguments

varname        This is a full subscripted variable name that you want the offset for.        

Returns

The offset of the variable name, or 0 if the variable name is not found or is not of the right type. Note that  the offset returned is 1 greater than the offsets used internally by Vensim. The internal offsets are passed to external function.

Notes

It is a Vensim convention that time is always offset 1.  

If you look at mdl.c you will notice that the offsets are 1 smaller than that returned by the function.  This is because internally Vensim uses 0 based, not 1 based offsets.  Do not adjust the offset returned since vensim_get_vecvals expects 1 based offsets.

See Also

vensim_get_vecvals, vensim_get_dpvecvals