PCSDK - "Use of possibly unassigned field" error
John Wiberg
✭✭✭
Comments
-
-
Hi ertugrulkaya,
That is a Visual Studio warning regarding a standard programming issue. It has nothing to do with the PC SDK.
http://msdn.microsoft.com/en-us/library/vstudio/bb384216(v=vs.100).aspx
What that is saying is that you are using a null type declaration [ToolData aTool;] but you have an IF{} surrounding the allocation/assign [aTool = (ToolData)rd.Value;] so when it reaches the row in question it doesn't know if the IF{} really happened or not. If the IF{} didn't happen you'd get an unhandled exception.
The error would go away if you had the reading inside the IF{} or if you had an IF/ELSE scenario with an Exit if it wasn't a tooldata.
John
Developer Center0
Categories
- All Categories
- 5.5K RobotStudio
- 395 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings