Login  Register

Re: Problem with using Radio Buttons in a plugin when called from a macro

Posted by Kenneth Sloan-2 on Apr 17, 2019; 8:27pm
URL: http://imagej.273.s1.nabble.com/Problem-with-using-Radio-Buttons-in-a-plugin-when-called-from-a-macro-tp5022095p5022098.html

Probably because the macro language is not Java.  In Java, "==" tests for identity.  Two objects compare as "==" if and only if they are the SAME OBJECT.  Two strings that have the same contents are not the same string.

I'm not an expert in the macro language, but I suspect that in a macro "==" test for equal VALUES, so two distinct
strings that happen to have the same sequence of characters are "==".

In Java, testing for equal values requires "equals".  Question: is there an "equals" in the macro language?

The question of "equality" vs "identity" is a tricky one.  Different languages answer it in different ways.

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.





> On Apr 17, 2019, at 14:11, Stein Rørvik <[hidden email]> wrote:
>
> Thanks, that works!
>
> But why the difference between running from the GUI and a macro?
> The comparison mycar=="Ford" works when the plugin is called via the GUI.
>
> Stein
 
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html