Hi,
I have a report from a user that my Shadow macro is crashing. When I asked for additional information I was sent a 'shad.log' file which he states was in his temp folder. My macro does not create this file, but it seems to contain DataCAD log information (not just specific to my macro). An extract of the last few lines of this log file is pasted below:
I am not familiar with this log file, and cannot find an equivalent on my machine at a quick glance. Can anybody provide any information about the log files that DataCAD produces? Is this file just produced because of the crash (and named with the first 4 characters of the macro that was running at the time)?
Looking at the last line of the log file (which I assume is where the crash occurred), it appears to be adding a system attribute named 'ShadSunPosMg ' (with a space at the end). The space takes the length of the string to 13, which is obviously more than the maximum length of 12 for an attribute name, so I assume this is what is causing the crash?
I cannot reproduce the crash, and a search through my macro code finds references to my SaveStr procedure passing 'ShadSunPosMg' as the name parameter(without the space), but nothing with a space at the end. My SaveStr code is pasted below:
I can see a potential problems in this code: it assumes a found attribute is a string without checking (I should probably fix this, but it is not the cause of the problem)
Can anybody offer any advice as to what could be causing the crash ??. I have only had one other report of the macro crashing (and that was from a user who had DataCAD 10, so I believed the old version was the cause of that problem), so I don't think that this problem is widespread, but the user who sent the log file states that it is happening on both his desktop and laptop machines.
Thanks,
David
p.s. as I was about to submit this post, I glanced through my SaveStr code again and realised that there was another potential problem ... Could the fact that I am assigning the attribute name using ':=' (instead of strassign) be causing the problem? ... I think it's a long shot, but I am updating this code to use strassign and will send a new version to the user to see if it fixes his problem, but any feedback regarding this problem would still be most welcome.
I have a report from a user that my Shadow macro is crashing. When I asked for additional information I was sent a 'shad.log' file which he states was in his temp folder. My macro does not create this file, but it seems to contain DataCAD log information (not just specific to my macro). An extract of the last few lines of this log file is pasted below:
Code: Select all
Error line: Auto-recover file created.
Menu: Edit
Message line: Select option from menu.
Menu: Toolbox
Action: Change Attrib '19.00.01.03' at (2, 384) attached to ??? at (-1, 0)
Action: Add Attrib 'ShadSunPosMg ' at (66, 384) to System at (-1, 0)
I am not familiar with this log file, and cannot find an equivalent on my machine at a quick glance. Can anybody provide any information about the log files that DataCAD produces? Is this file just produced because of the crash (and named with the first 4 characters of the macro that was running at the time)?
Looking at the last line of the log file (which I assume is where the crash occurred), it appears to be adding a system attribute named 'ShadSunPosMg ' (with a space at the end). The space takes the length of the string to 13, which is obviously more than the maximum length of 12 for an attribute name, so I assume this is what is causing the crash?
I cannot reproduce the crash, and a search through my macro code finds references to my SaveStr procedure passing 'ShadSunPosMg' as the name parameter(without the space), but nothing with a space at the end. My SaveStr code is pasted below:
Code: Select all
PROCEDURE SaveStr (name : string; value : string; toini : boolean); PUBLIC;
BEGIN
if atr_sysfind (name, atr) then
atr.str := value;
atr_update (atr);
else
atr_init (atr, atr_str);
atr.name := name;
strassign (atr.str, value);
atr_add2sys (atr);
end;
if toini then
SaveIniStr (name, value);
end;
END SaveStr;
I can see a potential problems in this code: it assumes a found attribute is a string without checking (I should probably fix this, but it is not the cause of the problem)
Can anybody offer any advice as to what could be causing the crash ??. I have only had one other report of the macro crashing (and that was from a user who had DataCAD 10, so I believed the old version was the cause of that problem), so I don't think that this problem is widespread, but the user who sent the log file states that it is happening on both his desktop and laptop machines.
Thanks,
David
p.s. as I was about to submit this post, I glanced through my SaveStr code again and realised that there was another potential problem ... Could the fact that I am assigning the attribute name using ':=' (instead of strassign) be causing the problem? ... I think it's a long shot, but I am updating this code to use strassign and will send a new version to the user to see if it fixes his problem, but any feedback regarding this problem would still be most welcome.
David Henderson
dhSoftware - Add-on Macros for DataCAD
dhSoftware - Add-on Macros for DataCAD