On Error Resume Next
frmDetail.Description<%=nLineCount%>.readonly = False
frmDetail.DetailedDescription<%=nLineCount%>.readonly = False
On Error GoTo 0
我有上面的vb脚本代码段。我需要将其转换为 java 脚本。我该怎么做 ?
On Error Resume Next
frmDetail.Description<%=nLineCount%>.readonly = False
frmDetail.DetailedDescription<%=nLineCount%>.readonly = False
On Error GoTo 0
我有上面的vb脚本代码段。我需要将其转换为 java 脚本。我该怎么做 ?
// The direct translation:
try {
frmDetail.Description<%=nLineCount%>.readonly = false;
} catch(err) {}
try {
frmDetail.DetailedDescription<%=nLineCount%>.readonly = false;
} catch(err) {}
// The right way:
if (frmDetail)
{
if (frmDetail.Description<%=nLineCount%>){
frmDetail.Description<%=nLineCount%>.readonly = false;
}
if (frmDetail.DetailedDescription<%=nLineCount%>){
frmDetail.DetailedDescription<%=nLineCount%>.readonly = false;
}
}