Macro Language Issues

Posted by Louis Wolf on
URL: http://imagej.273.s1.nabble.com/Macro-Language-Issues-tp5002660.html

Hi,

I'm running into a couple of issues with the macro language that seem to be bugs to me:

1) Dialog.addChoice("Label", array, default) doesn't set default value, but selects the first array item

macro "Test" {
                values = newArray(10, 100, 1000);

                Dialog.create("Test");
                Dialog.addChoice("Label", values, 2);    // 1000 expected, 10 given
                Dialog.show();
}


2) Returning a string from a function doesn't always work:

macro "Test" {
                print(returnStringBroken("broken"));
                print(returnStringWorking("working"));

                function returnStringBroken(value) {
                                return value + " example";          // breaks: Number or numeric function expected
                }

                function returnStringWorking(value) {
                                return "" + value + " example" ;                 // works
                }
}

Cheers,
Louis



Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629.
The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629.


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html