I have a submenu listing departments. Behind this, each department has an action, which is given the name "actPlan" + department.name.
Now I understand that it was a bad idea, because the name can contain any strange character in the world, but action.name cannot contain international characters. Obviously, the Delphi IDE itself calls some method to verify that the string name is correct. Does anyone know more about this?
I also have an idea to use
Action.name := 'actPlan' + department.departmentID;
instead of this. The advantage is that departmentID is a well-known format "xxxxx-x" (where x is 1-9), so I only need to replace the "-" with, for example, an underscore. The problem here is that those old actionnames are already saved in a personal text file. These will be exceptions if I suddenly switch from using department names to IDs.
I could, of course, first have an exception, and then call a method in which the search replaces this text file with the correct data and reloads it.
So basically I am looking for the most elegant and future method to solve this problem :) I am using D2007.
source
share