evalstrInstrument Control:Compilationevalstrevalstr
Evalstrs evaluates a string containing Csound code, returning a value.
Description
Evalstr compiles and runs Csound code and returns a value from the global space (instr 0). This opcode can be
also used to compile new instruments (as compilestr).
Syntaxires evalstr Scode kres evalstr Scode, ktrig InitializationScode -- a string to be compiled and evaluated.
Performancektrig -- triggers the compilation/evaluation if non-zero.
Examples
Here is an example of the evalstr opcode in conjunction with return:
ival evalstr "return 2 + 2"
print ival
Here is a complete example of the evalstr opcode. It uses the file evalstr.csd.
Example of the evalstr opcode.See AlsoString Manipulation OpcodesCreditsAuthor: &namevictor;, 2013