AnsweredAssumed Answered

How to Return String from function

Question asked by Gutis Champion on Aug 7, 2015
Latest reply on Aug 7, 2015 by Gutis

I have created spel function that calls another spell function that do some actions and returns results. The problem I facing is that returned result is of unknown type so I am getting type mismatch error. Simplified example of code structure

 

chg::zmain();

{

string return_value;

return_value = api:zsecondary("test");

}

 

api::zsecondary(string var1)

{

set_return_data(var1);

}

 

 

if I rewrite code to return error message to user interface I will get "test" in error message:

 

 

chg::zmain();

{

string return_value;

    set_error(1);

    set_return_data(format("return result %s",api:zsecondary("test"));

    return;

}

 

When I try to cast returned data to string I get value of 0

 

return_value = (string)api:zsecondary("test");

 

 

 

It seems that I missing something.

Outcomes