Miscellaneous IDE

From TeamDeveloperWiki

Jump to: navigation, search

This page covers miscellaneous IDE tips & tricks.

Contents


Image:Pointer.pngJump from implementation to declaration in IDE using F2

The next feature is available starting in TD 2005 (4.0) and higher.

When you are in the Outline tab of SQLWindows and you have highlighted a symbol name (such as a function name or class name), pressing F2 will "jump" to the section of the outline where the symbol is declared, so that you can view details of the implementation.
Pressing Ctrl+F2 will "jump" back to your starting point.


Image:Pointer.pngTracing debug output to an external viewer

Various aspects of an application are difficult to debug, like certain Message Actions. Setting a breakpoint can significantly change the behaviour of time critical parts of a program. One common option is to log trace output into a file, with the disadvantage that we can see the results only delayed and not synchronized to the actions being logged.

So, why not sending the trace output to an external viewer? There is a windows api called OutputDebugStringA (OutputDebugStringW for Unicode). It sends any strings to the so called system debugger. A system debugger is a debugger which registers itself at Windows as a debugger. The MS VC++ Debugger does this, DbgView.exe does it, TeamDeveloper does not.

Very easy to use is DbgView.exe. (Infos and Download)

Declare the external function:

Library name: Kernel32.dll
   Function: OutputDebugStringA
      Description: Sends a string to the debugger for display.
	Export Ordinal: 0
	Returns
	Parameters
	   String: LPCSTR


Call this function whenever your program has something to tell:

Data Field: dfField1
...
   On SAM_SetFocus
      ...
      Call OutputDebugStringA( "dfField1 received focus. Previous ctrl was " 
                               || SalNumberToStrX( wParam, 0 ) ) 
      ...


When finished with debugging a specific problem, it is a good idea to remove the OutputDebugString-Statements from the source codes for two reasons: 1. they cost a little (not much) performance, 2. to keep the code clean and readable.

Image:Pointer.pngIssue: can not open multiple TD instances

It could happen you are unable to open multiple instances of Team Developer.
For instance, when you try to open another source along already opened sources in TD by double clicking on a source file in Explorer.
Or when pressing F5, no new instance of TD opens.
You might see that when you close the first instance of TD, suddenly your earlier attempt to open a source is honoured by opening TD.

Another issue could be TD crashes when starting it (with or without opening a source).

You can resolve this issue by deleting a key in the registry. Follow these steps :
(Always backup your registry before using the Registry Editor).

  • First close all TD instances
  • Go to Start -> Run
  • Type regedt32 and press ENTER (it will start the Registry Editor)
  • Go to HKEY_CURRENT_USER\Software\Gupta and expand that level
  • Look for the TD version you are having this issue with, eg SQLWindows 4.2, and expand that level
  • Look for the key UI and select it
  • press DEL to delete the key, apply the change
  • Close the Registry Editor


Image:TDRegistry_UI_Key.jpg


Image:Pointer.pngApplication properties:Suppress tab stops and selection on non-editable datafields

In older TD versions, when you set the datafield property Editable to No the field is excluded from tabstops and the text displayed in the field could not be selected.
In fact, the field is then in a disabled state.
Image:DatafieldEditableProperty.gif

To be more in line with windows defaults, starting from TD 2000 (???), the property Editable for datafields sets the field in ReadOnly mode.
This mode differs from the disabled state. The field is part of tabstops and the text inside can be selected (and therefore copied to clipboard).

To be backward compatible with the older versions, you can disable this changed feature in the application properties, by checking the checkbox Suppress tab stops and selection on non-editable datafields.
You can access this option by right clicking the top level item at the left pane in the IDE and select in the displayed context menu the menu item Properties.
On the Properties dialog, select the Runtime tab and check the lower checkbox:
Image:ApplicationProperties1.gif

Personal tools