我想使用VBScript来捕获错误并记录它们(即错误"记录某些内容")然后恢复脚本的下一行.
例如,
On Error Resume Next 'Do Step 1 'Do Step 2 'Do Step 3
当在步骤1发生错误时,我希望它记录该错误(或用它执行其他自定义功能),然后在步骤2恢复.这可能吗?我该如何实现它?
编辑:我可以这样做吗?
On Error Resume myErrCatch 'Do step 1 'Do step 2 'Do step 3 myErrCatch: 'log error Resume Next
我想用C++"模仿"一款流行的Flash游戏Chrontron,需要一些帮助才能入门.(注意:不是为了发布,只是为自己练习)
Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing with a previous state. One of the states must complete all the objectives of the level before ending the stage. In addition, all the stages must be able to end the stage normally, without causing a state paradox (wherein they should have been able to finish the stage normally but, due to the interactions of another state, were not). …
所以我有一个类似下面的TreeView,隐藏了某些项目.如果我尝试使用箭头键浏览树,我会卡在"折叠"项目周围的项目中.亲自尝试一下.
<Window x:Class="Example.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="TreeViewBug" Height="300" Width="300">
<Grid>
<TreeView>
<TreeViewItem Header="a." />
<TreeViewItem Header="b" Visibility="Collapsed" />
<TreeViewItem Header="c." />
<TreeViewItem Header="d" />
<TreeViewItem Header="e." />
<TreeViewItem Header="f" Visibility="Collapsed"/>
<TreeViewItem Header="g." />
<TreeViewItem Header="h" />
</TreeView>
</Grid>
</Window>
似乎没有其他人发布过这个问题(或者是关于它的博客),所以我发布它是希望得到一个非hacky解决方案.所以这是我的问题:
我该如何解决这个错误?
我计划扩展默认的TreeView以跳过将Visibility设置为Hidden/Collapsed或IsEnabled设置为false的项目.有没有其他人遇到过这个并提出一个好的解决方案?