我可以明确地去最后一部分吗? [英] can i go explicitly to FINALLY part ?

查看:87
本文介绍了我可以明确地去最后一部分吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。


假设我有这段代码:

------------------ --------

尝试

如果x = 10则y = 1

如果x = 200则转到最后


抓住


终于


结束尝试

---- ----------------------


问题:

我怎么能去表达最后当x = 200时?

hi.

let say i have this code:
--------------------------
try
if x=10 then y =1
if x=200 then goto finally

catch

finally

end try
--------------------------

the question :
how can i go explicity to finally when x= 200 ?

推荐答案



" Daylor" <沓**** @ 012.net.il>在消息中写道

news:3f ******** @ news.012.net.il ...

"Daylor" <Da****@012.net.il> wrote in message
news:3f********@news.012.net.il...
hi。

让我说我有这个代码:
--------------------------
如果x =,请尝试
10然后y = 1
如果x = 200那么转到最后

抓住

结束尝试
- ------------------------

问题:
当x = 200时,我怎么能明白到最后?
hi.

let say i have this code:
--------------------------
try
if x=10 then y =1
if x=200 then goto finally

catch

finally

end try
--------------------------

the question :
how can i go explicity to finally when x= 200 ?




哦,甜蜜的耶稣没有!


Goto是邪恶的。忘记它甚至存在。最终的代码将始终执行

,如果没有异常发生在try块之后,或者在catch之后,如果

引发异常。

把它放在试块中:


如果x = 200那么

''做点什么

结束如果


HTH



Oh sweet jesus no!

Goto is evil. Forget it even exists. The code in finally will always be
executed, after the try block if no exceptions occur or after the catch if
an exception is raised.

Put this in the try block:

If x = 200 Then
''Do something
End If

HTH


" Daylor" <沓**** @ 012.net.il> schrieb
"Daylor" <Da****@012.net.il> schrieb
嗨。

让我说我有这段代码:
-------------------- ------
尝试
如果x = 10则y = 1
如果x = 200则转到最后

抓住
终于试试了
--------------------------

问题:
当x = 200时我怎样才能明白?
hi.

let say i have this code:
--------------------------
try
if x=10 then y =1
if x=200 then goto finally

catch

finally

end try
--------------------------

the question :
how can i go explicity to finally when x= 200 ?



尝试

如果x = 10则y = 1

如果x<> 200则

''...

结束如果

catch


终于


结束尝试

-

Armin


try
if x=10 then y =1
if x<>200 then
''...
end if
catch

finally

end try
--
Armin


如果x<>,请尝试

200然后

如果x = 10则y = 1

结束如果

结束如果

Catch ex as exeption

messagebox.show(e.message)

最终

x = 200''如果出现错误或此后的任何x

总是200

结束尝试
Try
if x<> 200 then
if x = 10 then y =1
end if
end if
Catch ex as exeption
messagebox.show(e.message)
Finaly
x=200 '' if there was an error or whatever x will be after this
always 200
End Try


这篇关于我可以明确地去最后一部分吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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