Return Char string from Function?
fogled@mizzou
Posts: 549
The NetLinx Help manual states, "the return type cannot be a structure or a class". Does this mean that a NetLinx function cannot handle a CHAR type larger than 1? It appears so because I get a compile error for this:
Of course it compiles fine if I leave off the square brackets from the function name, but then I don't get anything returned from the function:
When I use this function elsewhere in my code, I get nothing returned from it. Can someone tell me whether or not this *should* work or not? Will I have to change this into a DEFINE_CALL to get text from it?
Thanks,
DEFINE_FUNCTION CHAR playinginroom[20] (INTEGER this_device[]) {
Of course it compiles fine if I leave off the square brackets from the function name, but then I don't get anything returned from the function:
DEFINE_FUNCTION CHAR playinginroom (INTEGER this_device[]) { STACK_VAR this_text[20] this_text = "'AB,C,DE,GR'" //Actually a stack of code that produces this result SEND_STRING debug,"'Text Returned from Function: ',this_text" //Shows AB,C,DE,GR RETURN this_text }
When I use this function elsewhere in my code, I get nothing returned from it. Can someone tell me whether or not this *should* work or not? Will I have to change this into a DEFINE_CALL to get text from it?
Thanks,
0
Comments
That's it.
Ah - thanks for the quick reply! That worked, I was just making a stupid syntax error.
I really do appreciate getting the tip on the correct syntax so quickly on this forum. Thanks Marc!