This method forces the linking of parameters - if any other parameters changed by another function or addon.
Is this really better?
This would mean if I adjust param3, param4, param5, etc., then param1 is always going to be forced to equal param2 (which it should already be).
Params 3, 4, 5, etc., probably have nothing to do with the other two so why make the script perform more computations than it needs to every time any parameter is changed?
I know we are talking nano-seconds in computing time but is there really a need to do it?
As for learning GDL the reference manual (and now GDL Centre) are fine ut lack examples.
I still find the GDL Cookbook by David Nicholson-Cole is quite good - although a little out-dated now.
It explains things quite well and has example objects you can make.
Google it or search in this forum for links.
One of the forum moderators. Versions 6.5 to 27 Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10 Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
I think that the "if GLOB_MODPAR_NAME then ... else ... endif" method is much better, as in my mind the most important role of parameter script is to keep the consistency between an objects parameters. Without forcing parameter linking, you can have problems with changing parameters with multiple selection or parameter transfer.
About the speed I don't think that my method is slower than yours, as in your solution there is always 2 string comparisons in the 2 "if GLOB_MODPAR_NAME ..." lines - and string comparisons are a quite slow thing in any programming languages.
If you have any questions about a specific topic, please send your requests to us via the GDL center's forum or by mail - we try to answer as many problems as possible in the Tips&Tricks section of the site.
_________________ Gergely Fehér
Team Leader, Library Team