The first line of each macro must be a section header of the
form ...
[API Macro:macro-name]
The macro name used by tlaMDE is extracted from
this section header.
Assume that the the file associated with the buffer is
e:\Temporary\testPackage.cwa
and assume that the buffer contains ...
1: [API Macro:testDriver]
2: // --------------------------------
3: // testDriver
4: // --------------------------------
5: string testDriver( string strParm )
6: {
7: int iReturn ;
8: iReturn = testMessage( strParm );
9: return ( iReturn );
10: }
11: // --------------------------------
12: // 2002.11.18 00:13
13:
14: [API Macro:testMessage]
15: // --------------------------------
16: // testMessage
17: // --------------------------------
18: int testMessage( string strParm )
19: {
20: int iReturn ;
21: if ( strParm == "empty" )
22: iReturn = -1 ;
23: else
24: iReturn = 0 ;
25: XXXMsgNotify( strParm );
26: return ( iReturn );
27: }
28: // --------------------------------
29: // 2002.11.18 00:13
30:
If you issue a tlaMDE( "compile" )
command you will get the following error information in the
Output window Build pane:
[API Macro:testDriver],E:\Temporary\testPackage.cwa
(8,12)function or macro doesn't exist
[API Macro:testMessage],E:\Temporary\testPackage.cwa
(25,2)function or macro doesn't exist
If you have the API Error Filter (_Apiarist) enabled for
this project you can double-click on any error in the Build
pane and it will move the cursor to the error in the Current
buffer.
If you try the same example in CodeWright for .NET you will
get the same result. Since there is no Output window, Build
pane in CodeWright for .NET the output will be placed in the
Output window ClipView pane for the Clipboard. You can still
see all the errors at once. The convenience of double-clicking
to navigate to the error location is, however, not available.
Fetch Example
A buffer used as input to tlaMDE( "fetch"
) is simply a list of headers. An example is:
1: [API Macro:testDriver]
2: [API Macro:testAnother]
3: [API Macro:testMessage]
4:
If the example macros above were added to your "cwright.mac"
macro repository, the result of the tlaMDE( "fetch"
) would be:
1: [API Macro:testDriver]
2: [API Macro:testAnother] - not found in "cwright.mac"
3: [API Macro:testMessage]
4:
5:
6: [API Macro:testDriver]
7: // --------------------------------
8: // testDriver
9: // --------------------------------
10: string testDriver( string strParm )
11: {
12: int iReturn ;
13: iReturn = testMessage( strParm );
14: return ( iReturn );
15: }
16: // --------------------------------
17: // 2002.11.18 00:13
18:
19: [API Macro:testMessage]
20: // --------------------------------
21: // testMessage
22: // --------------------------------
23: int testMessage( string strParm )
24: {
26: int iReturn ;
27: if ( strParm == "empty" )
28: iReturn = -1 ;
29: else
30: iReturn = 0 ;
31: XXXMsgNotify( strParm );
32: return ( iReturn );
33: }
34: // --------------------------------
35: // 2002.11.18 00:13
36:
Purchase
The tlaMDE DLL, that operates in both CodeWright and
CodeWright for .NET, can be purchased by selecting the Buy button on
this page. When the new window opens, follow the ordering
instructions.
|