Reply To: Introduction to CMAC. 7: Multi-Edit Tags

Product Compare Forums Multi-Edit User Created Macros Introduction to CMAC. 7: Multi-Edit Tags Reply To: Introduction to CMAC. 7: Multi-Edit Tags

#6987
lancej
Participant

All,

I think I answered my own questions.

I looked at my v9.1 and see that it has project tagging and 8.0j does not.

I wrote a quick and dirty macro for project file tagging and it seems to work. (I am something of a CMac newbie so critiques are welcome.) Just in case anyone else needs it (for pre-9.0) here it is:

[code:3ehi7dhq]
#include Project.sh
macro tag_project_scan trans2
{
int origWinId, dbgId, prjWinId, tmpId, tmpId2;
str fname[260];
int noClose;

noClose = parse_int("/NOCLOSE=", mparm_str);
origWinId = window_id;
create_window;
dbgId = window_id;
create_window;
tmpId = window_id;
switch_win_id(dbgId);
tof;
insert_mode = 1;

make_window_visible(1);
prjWinId = GetProjectListFile(1);

switch_win_id(prjWinId);
make_window_visible(1);
tof;
while (!AT_EOF) {
fname = get_line;
if (file_attr(fname) & 0x10) {
down;
} else {
switch_win_id(tmpId);
if ( switch_file( fname ) ) {
tmpId2 = cur_window;
switch_win_id( tmpId );
link_window( tmpId2 );
} else {
return_str = fname;
rm( "LdFiles /NWS=1/NBF=1/NR=1/NSW=1/NHA=1/NC=1" );
}
switch_win_id(dbgId);
put_line( "scan: "+fname ); down;
if ( error_level == 0 ) {
switch_win_id(tmpId);
rm( "Tag_Build /WW=1" + "/HFILE=" + fname );
switch_win_id(dbgId);
}
switch_win_id(prjWinId);
down;
}
}
Tag_Save_TagFiles( );
switch_win_id(prjWinId);
delete_window;
switch_win_id(tmpId);
delete_window;
switch_win_id(dbgId);
if (!noClose) {
delete_window;
switch_win_id(origWinId);
}
make_window_visible(1);
}

[/code:3ehi7dhq]

By the way, while developing it (and learning CMac), I used a debug window to see what was happening. It turned out that having the file list it produces (in my case, almost 700 files) was handy, so I left a switch in the code to allow the window to remain.

Thanks,

Lance