【正文】
yed as it is processed. If this resource is piled without the X pilation flag, the debugging message will be excluded from the piled resource. 11 You can create up to 26 userdefined pilation flags, one for each letter of the alphabet. In a resource file, you can mark lines for conditional pilation by using the character (to exclude) or (to include) character in column 1 of the file, followed immediately by one or more pilation flags. Here are some examples: Macro extremely silly macro A ShowMessage(The A flag was used ) B ShowMessage(The B flag was used ) AB ShowMessage(A, B, or both A and B were used ) A ShowMessage(The A flag was not used) B ShowMessage(The B flag was not used) AB ShowMessage(Neither the A nor B flag was used) endMacro To pile a resource file using custom pilation flags, follow the instructions below: Compilation method How to use flags GISDK Toolbox Type the flags in the Flags box in the toolbox Standalone piler Use the d switch in the mand line (., rscc dABC...) LoadResourceFile() Pass a string containing the flags as the third argument Here is another example. This menu (from a custom application) includes menu items that have conditional pilation flags. Different binations of flags can produce four different versions of the finished application. Menu Main Menu Menuitem File menu file menu A Menuitem Make Maps menu map menu B Menuitem Use Databasemenu data menu endMenu menu file menu Menutem Open... Menuitem Close... Separator B Menuitem Import Data... B Menuitem Export Data... B Separator A Menuitem Print Map... A Separator Menuitem Exit 12 endMenu Menu map menu Menuitem Region 1 Menuitem Region 2 Menuitem Region 3 Menuitem Region 4 endMenu Menu data menu Menuitem Use 1995 Data Menuitem Use 1994 Data Menuitem Use 1993 Data Menuitem Use 1992 Data endMenu As shown in the table below, various binations of userdefined flags result in different menu systems, providing different capabilities for different users: Flags Capabilities None The simplest system, for an untrained user (., clerical or upper management) A A version that includes mands for map production B A version that includes mands for database management AB The system administrator version, providing all functions For this particular application, you could even automate production of all four versions of the custom application using a batch file like this one: rscc c u basic_ui @ rscc c dA u map_ui @ rscc c dB u data_ui @ rscc c dAB u sysad_ui @ Working with the GISDK Debugger GISDK includes a debugger that helps you find and fix runtime problems in your GISDK macros. You can set breakpoints in resource files, see the call stack, see the values of variables, and set up a watch list. The look and feel of this debugger is very similar to other debuggers, such as the one for Microsoft Visual Studio. The GISDK Debugger runs along side TransCAD, in a separate window. You start the GISDK 13 Debugger from the GISDK Toolbox. You can set breakpoints at lines in the resource files that have been piled into a UI Database. When you run macros in that UI Database and reach a breakpoint, focus shifts to the GISDK Debugger window, where you have considerable control over subsequent execution. For example, you can: ?? Step through line by line in the resource file ?? Execute up to a line ?? Return to the calling macro ?? Move the point of execution to a different line ?? Change values of variables and subelements of arrays and pound variables ?? Continue normal execution For more information, see... Setting Up the GISDK Debugger Managing the GISDK Debugger Windows Using the GISDK Debugger Setting Up the GISDK Debugger You can set up the GISDK Debugger by opening one or more resource files and setting breakpoints. When you start running the macros in the UI Database into which these resources files have been piled, execution will halt at the breakpoints. Breakpoints for dialog boxes must be set in a do/endItem section of code, such as the Init macro. The GISDK Debugger is normally started by clicking in the GISDK Toolbox. You can also start the GISDK Debugger, or open the debugger window, with StartDebugger(). The Variables window keeps track of all of the variables. If there are certain variables that you want to track, you can add them as items in the Watch window. You can also keep track of the value of any expression in this window. ? To Set Up the GISDK Debugger 1. Choose ToolsAddIns, highlight GIS Developer’s Kit, and click OK to display the GISDK Toolbox. 2. Click to start the GISDK Debugger, and click GISDK Debugger on the Windows Taskbar to display the GISDK Debugger program window. 3. Make settings as follows: To do this... Do this... Open a resource file Click or choose FileOpen, choose the resource file that you wish to debug, and click Open. The resource file is displayed in a source code window. You can have more than one resource file open. Set a breakpoint Click on a line in a source code window and click , choose DebugToggle Breakpoint, or press F9. A red dot is added before the 14 line. Breakpoints for dialog boxes must be set in a do/endItem section of code, such as the Init macro. Find a breakpoint Doubleclick on the breakpoint in the Breakpoints window. The line will be highlighted in the appropriate source code window, which will be brought to the front and scrolled if necessary. Remove a breakpoint Click on a line in a source code window that is marked as a breakpoint and click , choose DebugToggle Breakpoint, or press F9. You can also highlight a breakpoint in the Breakpoints window and press Del or