Hi all I have a script that creates fields named "Point1", "Point2" ... describing certain data points on a graph. This works fine. However, when the number of Points on the new graphic is smaller than on the old, I have old "PointX" that remain from the previous graphc. Thus I want to implement a delete routine to get rid of all fields and recreate them.
In the current example I have 6 data points called Point1 to Point6 <code> *repeat* with tField = 1 to the number of fields *on* card targetCard * put* the short name of field tField into tFieldName * if* tFieldName contains "Point" *then ** put* "Deleting field no." && tField && "named" && tFieldName *delete* field tFieldName *end* *if* *end* *repeat *</code> However, the following shows a very strange behavior I cannot understand just now. When I run it, it deletes Point1, Point3, Point5 but does not care about the even numbers and breaks with an error message "Chunk: no such object". When I run it again just afterwards, Point4 is the only survivor, same error message. When I run it a third time, Point4 is removed and the new graph is drawn correctly. Can you spot the issue? It is LiveCode Community 6.1.1. RC4 Thanks, Pascal _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode