1) NMODL variables are accessible to VERBATIM blocks by prepending "_l". (Note: That's an underscore and lowercase "L").
2) VERBATIM can return from a function by returning "_lfunctionName".
Both of these points are illustrated in the following example
Code: Select all
FUNCTION addargs(arg1, arg2) {
VERBATIM {
_laddargs = _larg1 + _larg2;
}
ENDVERBATIM
}
If you write a PROCEDURE or FUNCTION and pass doubles, you can simply put them in the method declaration:
Code: Select all
PROCEDURE myfun(arg1, arg2) { }
Code: Select all
PROCEDURE myFileFunction() {
VERBATIM {
if (ifarg(1)) { // FILE * object passed in from hoc
FILE* file = hoc_obj_file_arg(1);
// Do stuff with the file
}
}
ENDVERBATIM
}