The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.

Moderator: pjdixit

#72638 by dhs
Tue Nov 07, 2017 4:21 pm
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 allError line: Auto-recover file created.
Menu: Edit
Message line: Select option from menu.
Menu: Toolbox
Action: Change Attrib '' 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 allPROCEDURE SaveStr (name : string;  value : string; toini : boolean);      PUBLIC;
   if atr_sysfind (name, atr) then
      atr.str := value;
      atr_update (atr);
      atr_init (atr, atr_str); := name;
      strassign (atr.str, value);
      atr_add2sys (atr);
   if toini then
      SaveIniStr (name, value);
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.


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.
#72639 by dhs
Wed Nov 08, 2017 1:39 pm
Changing the string assignments to strassign did not cause any change to the symptoms. It was a long shot, but I thought it was worth a try.

Can anybody throw any light on the log file or it's creation? Based on what I see in the log file, I think the problem is being caused by trying to add an attribute with a 13 character name - can anybody who is familiar with the log file creation process in DataCAD confirm my understanding of the log file entry?

David H.
#72680 by dhs
Sat Nov 11, 2017 3:07 pm
I did resolve this after much debugging on the users machine....

The log file entry was not entirely accurate. The problem was being caused by trying to read an attribute with more than 12 characters in its name, but the actual location of the problem in the code was several dozen of lines after the call using the attribute name indicated by the log file. There were several attribute reads between the location indicated by the log file and the location where the actual problem was, so it was not even a 'recent' attribute name that was contained in the log file.

Interestingly, my code bug did not appear to be causing a problem in DataCAD 19.01 (the user who experienced the problem was running 19.00.03).
#72683 by Jsosnowski
Sun Nov 12, 2017 10:18 pm

I checked my temporary files folder and found I too had a log file posted based upon one of my macro experiments a couple weeks ago. The name of the log file matched the name of the file running in Datacad and appears to log the menu selections, error and message text lines invoked by the user. I tried using one of my test macros that causes an error message to be generated by Datacad, but the log file does not make any entry upon the error. This file could be of some use in tracking steps but I have not tested it in any depth.

Who is online

Users browsing this forum: No registered users and 1 guest

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.


Software for AEC Professionals Since 1984