I've written a macro- which my coworker wants to use.
However, it doesn't run as expected on his system (but it runs perfectly on my system).
When we load/run the macro on my co-worker's system, we immediately see the message
"Finished preprocessing all open files!"
displayed. It never iterates through the open buffers on his system. We usually try this with 30 or so files, so it takes 10-20 seconds.
On my system, I can see it iterating through all the open files/buffers, as well as see the names displayed of the files that do not have a .C or .H extension.
When I remove this line (and the associated else and {} )
if ( (stricmp(fileExt, "c") == 0) || (stricmp(fileExt, "h") == 0) )
the macro runs on his system.
We are both using SlickEdit 12.01, and and using XP SP2.
What could cause this anomaly?
Thanks
void My_SelectiveDisplay_Callback()
{
_str fileExt;
fileExt = pcextension(p_buf_name);
// process .C and .H files only
if ( (stricmp(fileExt, "c") == 0) || (stricmp(fileExt, "h") == 0) )
{
message("Preprocessing " strip_filename(p_buf_name,"PD"));
preprocess( " -w TRUE=1 FALSE=0 symbol1=1 symbol2=0 symbol3=1"); // arg is usually much longer
message("Finished preprocessing " strip_filename(p_buf_name,"PD"));
}
else
{
message("Not a valid file type -> " strip_filename(p_buf_name,"PD"));
}
}
//******************************************************************************************
_command void MyPreprocess() name_info(',')
{
for_each_buffer('My_SelectiveDisplay_Callback');
message("Finished preprocessing all open files!")
}