MACRO Language | List of all built-in functions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

MACRO Language | List of all built-in functions

Rainer M. Engel
Hello there..

I'd like to get a list of all built-in functions of the macro language.

Is there a way to achieve this?

Regards,
Rainer

--
Rainer M. Engel, Dipl. Digital Artist
scientific|Media GbR
Pichelsdorferstr. 143
D-13595 Berlin
Reply | Threaded
Open this post in threaded view
|

Re: MACRO Language | List of all built-in functions

John Oreopoulos
This list is located here:

http://rsbweb.nih.gov/ij/developer/macro/functions.html

John Oreopoulos


On 2012-02-21, at 10:34 AM, Rainer M. Engel wrote:

> Hello there..
>
> I'd like to get a list of all built-in functions of the macro language.
>
> Is there a way to achieve this?
>
> Regards,
> Rainer
>
> --
> Rainer M. Engel, Dipl. Digital Artist
> scientific|Media GbR
> Pichelsdorferstr. 143
> D-13595 Berlin
Reply | Threaded
Open this post in threaded view
|

Re: MACRO Language | List of all built-in functions

Rainer M. Engel
That is true.

But I'd like to get them perhaps like this..

f = getFunctionsList;
print(f);

And the output would be like this..
abs acos Array.concat Array.copy Array.fill .. aso


This is not the best way, I'm afraid but supposing the html file is up
to date, this would do it for a start..

// Macro to get all built in macro-functions (fetch from URL)
URLsrc =
File.openUrlAsString("http://rsbweb.nih.gov/ij/developer/macro/functions.html");
SRClines= split(URLsrc,"\n");
bif = newArray();
for (i=0; i<SRClines.length; i++){
        if (matches(SRClines[i], ".*<a name=.*") ){
                if (matches(SRClines[i], ".*<a name=\".*") ){
                } else {
                        redux = replace(SRClines[i], ".*<a name=", "");
                        redux = replace(redux, ">.*", "");
                        if (matches(redux, "[A-Z]{1}") ){
                        } else {
                                bif = Array.concat(bif,redux); }}}}
print("Functions found: "+lengthOf(bif));
bifs = Array.print(bif);
// END OF MACRO


I just thought there might be a function or a way to get this list directly.

Regards,
Rainer



Am 21.02.2012 16:42, schrieb John Oreopoulos:

> This list is located here:
>
> http://rsbweb.nih.gov/ij/developer/macro/functions.html
>
> John Oreopoulos
>
>
> On 2012-02-21, at 10:34 AM, Rainer M. Engel wrote:
>
>> Hello there..
>>
>> I'd like to get a list of all built-in functions of the macro language.
>>
>> Is there a way to achieve this?
>>
>> Regards,
>> Rainer
>>
>> --
>> Rainer M. Engel, Dipl. Digital Artist
>> scientific|Media GbR
>> Pichelsdorferstr. 143
>> D-13595 Berlin
Reply | Threaded
Open this post in threaded view
|

Re: MACRO Language | List of all built-in functions

dscho
In reply to this post by Rainer M. Engel
Hi Rainer,

On Tue, 21 Feb 2012, Rainer M. Engel wrote:

> Hello there..
>
> I'd like to get a list of all built-in functions of the macro language.
>
> Is there a way to achieve this?

I had to write a parser for the language documentation (and add a few
missing anchors, which Wayne gracefully accepted) to support syntax
highlighting in Fiji's Script Editor. The parser is written in Beanshell,
which is easy enough to understand:

        http://fiji.sc/extract-macro-tokens.bsh

You could imitate that, using the File.openUrlAsString() function and the
string processing functions you seem to like so much in the macro language
;-) But note that the macro language is really a bit slow for what you
want to do.

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: MACRO Language | List of all built-in functions

David Eccles (gringer)
In reply to this post by Rainer M. Engel
From:    "Rainer M. Engel"<[hidden email]>
> I'd like to get a list of all built-in functions of the macro language.

http://rsbweb.nih.gov/ij/developer/macro/functions.html [for macros]

http://rsbweb.nih.gov/ij/developer/api/index.html [for plugins]

http://imagejdocu.tudor.lu/doku.php?id=howto:plugins:the_imagej_eclipse_howto [tutorial for creating
ImageJ plugins in eclipse]