C# 错误CS0177:输出参数';Wx';必须在控件离开当前方法之前指定给
在方法的开头写上:C# 错误CS0177:输出参数';Wx';必须在控件离开当前方法之前指定给,c#,C#,在方法的开头写上: pass1.cs(51,18): error CS0177: The out parameter 'Wx' must be assigned to before control leaves the current method pass1.cs(51,18): error CS0177: The out parameter 'Wy' must be assigned to before control leaves the current method pass1.cs(5
pass1.cs(51,18): error CS0177: The out parameter 'Wx' must be assigned to before control leaves the current method
pass1.cs(51,18): error CS0177: The out parameter 'Wy' must be assigned to before control leaves the current method
pass1.cs(51,18): error CS0177: The out parameter 'Vx' must be assigned to before control leaves the current method
pass1.cs(51,18): error CS0177: The out parameter 'Vy' must be assigned to before control leaves the current method
在方法的开头写上:
pass1.cs(51,18): error CS0177: The out parameter 'Wx' must be assigned to before control leaves the current method
pass1.cs(51,18): error CS0177: The out parameter 'Wy' must be assigned to before control leaves the current method
pass1.cs(51,18): error CS0177: The out parameter 'Vx' must be assigned to before control leaves the current method
pass1.cs(51,18): error CS0177: The out parameter 'Vy' must be assigned to before control leaves the current method
我认为错误信息是不言自明的。放
Wx = 0f;
Wy = 0f;
Vx = 0f;
Vy = 0f;
在方法的顶部。我可以从您的逻辑中看出,代码保证在返回之前将值设置为某个值,但编译器用于确定该值的静态分析相对简单,有时有点悲观。我认为错误消息是不言自明的。放
Wx = 0f;
Wy = 0f;
Vx = 0f;
Vy = 0f;
在方法的顶部。我可以从您的逻辑中看出,代码保证在返回之前将值设置为某个值,但编译器用于确定该值的静态分析相对简单,有时有点悲观。Morten就是这样的人!工作得很有魅力。基于错误消息,我认为这是一个不明显的解决方案。谢谢莫顿,桑尼·莫顿就是那个人!工作得很有魅力。基于错误消息,我认为这是一个不明显的解决方案。谢谢莫顿,孩子