contents   index   previous   next



seVarParse

 

syntax:

   sebool

seVarParse(secontext se,

           seobject start_object,

           seconstcharptr string,

           seobject *object,

           sestring *member,

           uint flags);

where:

se the context to look for the variable in

 

start_object the object to start seaching from

 

string the string name of the variable

 

object an output parameter filled in with the object

 

member an output parameter filled in with the member

 

flags flags to control variable resolution.

 

return:

A boolean indicating if the variable was found.

 

description:

Turn a text variable name into the correspond Object,member pair. Both output-only parameters, object and member, follow the usual ScriptEase lifetime rules for the returned value types. See seGetObject and seInternalizeString for more information on the object and member respectively.

 

This routine parses a variable name and returns the given variable's location. This allows you to read and update the variable's value. The variable name must be constant. For instance, foo[5].goo is acceptable but foo[goo].goo is not because in this case [goo] would mean to access the variable goo as a string and use that member name. Similarly, goo(5).zoo is not allowed because it calls a function. The reasoning is that this routine is used to access variables by name, but it should be quick. If you need to use full-fledged expressions, you should use the seEval routine instead although that is much slower.

 

The primary return is the output parameters which are filled in with an Object,Member pair you use to access or update that variable. You would later pass the object and SE_STR(member) to any of the other API functions to manipulate that variable. These return values follow standard rules for Lifetimes, and so may need extra code for cleaning up if this is not called in a wrapper function. You may often choose SE_COMPOUND_MEM or SE_COMPOUND_UNIMEM along with standard seGet and sePut calls for simple access to complex representations of a single variable.

 

The flags may be any combination of the follows, |'ed togethor:

 

SE_DEFAULT

 

SE_GF_COMPOUND_CREATE - objects will be created if they don't yet exist. see VARIABLE READING for more information on this flag.

 

see:

seGetObject, seInternalizeString

 


seGetName