User can create Shared Blocks with same name in one project (v54)

Report bugs. Post bug workarounds or fixes

Moderator: MSandro

Post Reply
MrSteve
Posts: 61
Joined: Jun 16th, '16, 01:22

User can create Shared Blocks with same name in one project (v54)

Post by MrSteve » Aug 1st, '16, 17:12

A user can create two different shared blocks with the same name in one project. This can lead to confusion when looking at code and trying to determine which method is called.

Similar issue occurs when creating a class with the same name, in this case GP auto-magically appends a digit to the end of the class name. I think I would prefer an Alert notifying the user of the naming conflict and giving them the option to rename, be curious as to what others think.

See attached project for example.
Also to ponder: How can you find where Shared Blocks are defined when there are multiple classes? You would need to find the class where the shared block was defined. Which is fine in most cases where small number of classes/scripts

V.54
Attachments
sameBlockName.gpp
(5.69 KiB) Downloaded 528 times

JohnM
Posts: 379
Joined: Sep 11th, '15, 14:42

Re: User can create Shared Blocks with same name in one project (v54)

Post by JohnM » Aug 8th, '16, 00:35

Yes, this is potentially confusing. Behind the scenes, every user-defined block maps to a unique function name, but if the labels on the blocks are the same how is user to know which is which?

At the very least, we should probably warn users about such name conflicts, and perhaps require them to choose a unique name.

Shared blocks is a new feature and we're still working out the details...

Post Reply