Prev | Current Page 1059 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

When receiving data into a function written in C/C++ from a
Neko script, you will often just want to know what is stored at a glance within the value struct
container. Now, usually, in order to examine its content, you would have to extract the data contained
in the value and somehow convert it to a format that you can output. This can certainly be a pain in the
rear if the value type is complex, such as a Neko object. Thankfully, Neko provides the val_print
function, which accepts a value struct as a parameter, and writes the content of the value struct to the
command console as a string.
neko_error()
neko_error doesn ??™ t currently do a lot. Its use is currently exactly the same as returning the C NULL
value from a function, which inevitably raises a Neko exception. However, this may be subject to change
in the future, so its use is preferred over the explicit use of NULL in a return value.
If you wish to return the Neko equivalent of NULL , use val_null .
Summary
This chapter is more of a reference than a learning aid.


Pages:
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071