我认为返回值会转移到__finally语句中吗? [英] Am I right in thinking a return value is carried over into a __finally statement?

查看:73
本文介绍了我认为返回值会转移到__finally语句中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的意思是,这是正确的吗?


尝试

{

Screen-> Cursor = crHourglass;

做坏事

返回false;

else

返回true;

}

__finally

{

Screen-> Cursor = crDefault;

//这里不需要return语句。

}


问题是,返回值(真或假)是否会正确返回

如图所示__finally声明?


THX!


Dean

I mean, is this correct?

try
{
Screen->Cursor = crHourglass;
Do something bad
return false;
else
return true;
}
__finally
{
Screen->Cursor = crDefault;
// No need for return statement here.
}

The question is, will the return value (true or false) be returned
correctly as shown, in the __finally statement?

THX!

Dean

推荐答案

de*********@yahoo.com 写道:
我的意思是,这是正确的吗?

{
屏幕 - >光标= crHourglass;
做点坏事
返回false;

返回true;
}
__finally


这不是C ++。如果这是另一种语言,请查看涵盖该语言的新闻组

。如果这是一个编译器扩展,请

发布到专用于该编译器的新闻组。

{
Screen-> Cursor = crDefault;
//这里不需要返回语句。

问题是,返回值(true或false)是否正确返回
如__finally语句所示?
I mean, is this correct?

try
{
Screen->Cursor = crHourglass;
Do something bad
return false;
else
return true;
}
__finally
This is not C++. If this is another language, look up the newsgroup
that covers that language. If this is a compiler extension, please
post to the newsgroup dedicated to that compiler.
{
Screen->Cursor = crDefault;
// No need for return statement here.
}

The question is, will the return value (true or false) be returned
correctly as shown, in the __finally statement?




根据C ++语言规范无法判断,因为它确实没有__ finally事情。


V



No way to tell based on the C++ language specification because it does
not have the "__finally" thing.

V


de ********* @ yahoo.com 写道:
我的意思是,这是正确的吗?
I mean, is this correct?




根据什么来纠正?它显然没有被C ++所涵盖,因为用户不允许甚至说出某些名称,例如:那些

以下划线开头,后跟下划线或

大写字母。特定的C ++实现可以作为

扩展,授予用户使用其中一些名称和

的权利,以便将它们想要的任何内容与这些名称相关联。


因此,你应该把你的文章引导到一个合适的环境

特定的论坛。


C ++做你的方式想要使用一个析构函数

进行清理的对象。您可能想要寻找RAII。

-

< mailto:di *********** @ yahoo.com> < http://www.dietmar-kuehl.de/>

< http://www.contendix.com> - 软件开发&咨询



Correct according to what? It is clearly not covered by the C++ as
a user is not allowed to even utter certain names, e.g. those
starting with an underscore followed by an underscore or an
uppercase letter. A particular C++ implementation may, as an
extension, grant the user the right to use some of these names and
to associate whatever it desires with these names.

Thus, you should direct your article to an appropriate environment
specific forum.

The C++ way of doing what you want uses an object whose destructor
does the clean-up. You may want to look for RAII.
--
<mailto:di***********@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.contendix.com> - Software Development & Consulting


这是Borland C ++ Builder编译器。

This is with the Borland C++ Builder compiler.


这篇关于我认为返回值会转移到__finally语句中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆