且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在当前上下文中不存在名称“...”

更新时间:2023-02-16 15:25:48

错误消息说明了一切:CPUOption不存在,i。即你没有在你使用它的范围内定义它。



问题是你在内部do循环中定义它,因此它最终不再存在do循环。超出该结尾的while语句不在do循环的范围内,因此它不知道CPUOption。
The error message says it all: CPUOption does not exist, i. e. you didn't define it within the scope you are using it.

The problem is you defined it within the inner do loop, therefore it ceases to exist at the end of the do loop. The while statement beyond that end is not within the scope of the do loop, therefore it doesn't know of CPUOption.