基础知识: 跳转语句
try
if cb_index_way.ItemIndex=0 then
begin
//1
end;
...
...
except
on E:Exception do
Application.MessageBox(PChar('数据库服务器连接失败:'+E.Message),
'错误提示',MB_OK+MB_ICONERROR);
end;
//2
---------------
请问一下,在IF内写什么语句直接会跳出Try,也就是从1处到2处,小弟基础不好,谢谢!!!!
[解决办法]
LABEL lab1;
begin
try
if cb_index_way.ItemIndex=0 then
begin
GOTO lab1; //1
end;
...
...
except
on E:Exception do
Application.MessageBox(PChar('数据库服务器连接失败:'+E.Message),
'错误提示',MB_OK+MB_ICONERROR);
end;
//2
lab1:
showmessage('2');
end