Callout - how to get something beyond simple datatype (or return several datatypes)
Is there a way to get one of:
- Struct
- $lb
- Subscripted local variable
- List/array
As a return type from callout call?
And related question: is there a way to return several values (which may contain commas) from one callout call. Or rather what's the best approach when doing that?
Consider the following example:
#define ZF_DLL #include "cdzf.h" #include <stdio.h> int GetTwoStrings(char* a, char* b, char* retval) { sprintf(b,"%s",a); sprintf(retval,"%s",a); return ZF_SUCCESS; } ZFBEGIN ZFENTRY("GetTwoStrings","1c1C1C",GetTwoStrings) ZFEND
And the corresponding Caché code:
ClassMethod GetTwoStrings(a) As %String { set b="" set path = "libsimplecallout.dll" set retval = $ZF(-3, path, "GetTwoStrings", a, b) zw a, b, retval }
When I execute GetTwoStrings I get the following output:
do ..GetTwoStrings("my,Text") a="my,Text" b="" retval="my,Text,my,Text"
retval returned from callout call contains both b and retval from C, but what's the best approach on parsing it into separate variables?