Jump to content
Sign in to follow this  
VladimirM

SPL Code MISC function

Recommended Posts

Hi,

I would like to return value from function to other function. for example:

cnt::z_cnt_change(...)
{
    string desc;
    desc = misc::insert_desc();
    logf(ERROR, format("description is: %s", desc));
}

misc::insert_desc()
{
    string log;
    log = "test";
    return ((string)log);
}

I get this log: description is: 0

how can I get the value from "insert_desc" function?

 

Edited by VladimirM

Share this post


Link to post
Share on other sites

hi,

you need to specify return type, eg:

string z_echo(string input) {
	return input;
}

void z_echo_call() {
	printf(z_echo("hello")); // output: hello
}

 

Share this post


Link to post
Share on other sites

and one more tip, using bop_cmd could save a lot of time debuging spel code

 

Share this post


Link to post
Share on other sites
16 minutes ago, cdtj said:

hi,

you need to specify return type, eg:


string z_echo(string input) {
	return input;
}

void z_echo_call() {
	printf(z_echo("hello")); // output: hello
}

 

Hi,

Thank you, it works :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...