Because SmartArrays data objects are managed by the SmartArrays engine, their internal details cannot be inspected directly by a debugger. Instead, the SmartArrays SDK provides facilities to allow debugging of SmartArrays programs.
If you are working in a console project or Windows project, you can use the methods show() and showDebug() to display arrays in the Visual Studio output window or the console output stream. These techniques work well with client applications where an output stream is available.
You can see these techniques in use in the samples distributed with this SDK. The tutorial Working with SmartArrays is accompanied by a set of simple console applications. These use show() and showDebug() to write debugging output to the console window. The tutorial Working with the SmData Toolkit uses a simple windowed client program and displays SmartArrays objects in the development environment's output window.
Finally, it is possible to call see() on the array to write formatted HTML to a file that can be viewed in a browser. This writes an array to an HTML trace file that you can open in a browser. see() is particularly useful for nested arrays because it uses table boundaries in the HTML to indicate nesting. You can set the trace file with the method setSeeFile(filename), which directs all subsequent output from see() into an HTML file of the specified name.
When the SmartArrays engine detects an error condition it throws an exception of class SmException to the calling program. These exceptions provide additional information in the result of toString() -- summarizing the operation being performed and its arguments. See Exceptions.
SmartArrays is often used as a component in server-side applications where the output of show() and showDebug() are not visible. If you attach a debugger to the server application, you can use it to inspect SmartArrays objects with the techniques described below. It is also possible to insert calls to see() into code to generate HTML that you can view. If your server application keeps an event or exception log, you can call toDebugString() on any SmArray to get a summary description of the array that often explains why an exception occurred.