next up previous contents
Next: YODA tcl Commands Up: The Hoc Language Previous: Communication between Hard and

String manipulation

The data type for variables in the hoc-language is always double. Thus string variables are not fully supported in yoda. The sprintf function (Table 5.1) allows to format strings ``on the fly'' to be used in function calls. Sometimes, however, it may be useful to store string values, e.g. in an array for future reference in function calls (like histogram names). For this purpose the builtin-functions pack_string and unpack_string are available:
 
Table 5.13: List of Available String Functions
var = pack_string("string-constant"); Stores the string constant and returns a pointer to it.
var = some_function(unpack_string(var)); Returns the string in a function call, where a string argument is needed.
 



Heiko Rohdjess
2001-07-19