Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

void arguments

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Desdemona   Members   

158
Like
0Likes
Like

Posted 10 October 2004 - 06:55 AM

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

#2 Andreas Jonsson   Moderators   

4627
Like
0Likes
Like

Posted 10 October 2004 - 07:20 AM

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.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.