# void arguments

This topic is 5034 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

void i_return_void()
{}

void i_take_no_params()
{}

void foobar()
{
i_take_no_params(i_return_void());
}


Angelscript doesn't support this at the moment, and although it seems a little odd, it does have an occasional use (and is valid in C++). Would it be too much to ask to add this functionality? Below is why I'm asking. When using ExecuteString it is nice sometimes to be able to catch and view arbitrary return values.
void cmd_execute_test(string& buffer)
{
buffer = "catch(" + buffer + ")";

string output = Execute(buffer);

this->EnqueueOutput(output);
}

void catch()			{} // This one does not work
void catch(Data* obj)		{ dump(obj); }
void catch(bool retval)		{ this->EnqueueOutput(retval ? "Return: true\r\n" : "Return: false\r\n"); }
void catch(int retval)		{ this->EnqueueOutput("Return: " + retval + "\r\n"); }
void catch(float retval)	{ this->EnqueueOutput("Return: " + retval + "\r\n"); }
void catch(string retval)	{ this->EnqueueOutput("Return: " + retval + "\r\n"); }


Joe

##### Share on other sites
I see your point. That does indeed look handy.

I can't say how much work it would take to implement something like it though, but I suspect that most of the work would be to analyze what would have to be changed and not the actual change itself.

I'll put your suggestion in my to-do list and I'll see when I can get it done.

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5

• 10
• 14
• 30
• 13
• 11
• ### Forum Statistics

• Total Topics
631790
• Total Posts
3002365
×