Please enable JavaScript to view this site.

Vensim Help

C/C++int VEFCC vensim_get_substring(char *fullstring,int offset,char *buf,int maxbuflen) ;

int VEFCC VensimCGetSubstring(int context,char *fullstring,int offset,char *buf,int maxbuflen) ;

VBPrivate Declare Function vensim_get_substring Lib "vendll32.dll" (ByVal fullstring$, ByVal frompos As Long, ByVal buf$, ByVal maxbuflen As Long) As Long
Pascalfunction vensim_get_substring(fullstring: PChar; frompos:Integer; buf:PChar; maxbuflen:Integer ):  Integer ; stdcall ; external 'vendll32.dll' ;
JavaNot useful

The vensim_get_substring function is utility function that is designed to make it easier to work with vensim_get_vernames, vensim_get_info and vensim_get_varattribs.  It is most useful when working in Basic where string manipulation is not that straightfoward.

Arguments

fullstring        The string that a substring is needed from.

offset        The offset at which the substring starts.

buf        A buffer into which the substring will be placed.

maxbuflen        The maximum amount of space that will be used in buf.

Returns

0 if the substring is empty, otherwise the number of characters in the substring including the null termination character.

Notes

The return val is the same as the number of non-null characters in the substring plus 1.  Thus, adding the return value to the old offset will give the location of the next substring.  If the return value exceeds maxbuflen the string will be truncated at maxbuflen (there will be maxbuflen-1 nonzero characters in the string).

See Also

vensim_get_vernames, vensim_get_info, vensim_get_varattribs