Editor improvements and dimension restriction when accessing multi-dimensional waves

I am dreaming of a more advanced editor. I am missing standard functions of modern programming editors like:


  • Bracket/block matching: When the cursor is on an opening bracket, the corresponding closing bracket should be highlighted, and vice versa. The same thing should work for for...endfor or if...endif blocks. This might improve debugging if numbers of brackets is not matching.

  • Multiline comments by /*...*/. Sometimes it might be helpful to comment multiple lines out without going through every line.

  • Indentation of multiple lines: Other editors usually have the option to select multiple lines and increase/decrease their indentation by Tab or Shift+Tab.

  • Igor commands not always follow a systematic notation. Thus it is necessary to know the exact notation of a command. Other editors often offer AutoCompletion features. It might be helpful to have a QuickInfo (a little box above/below the cursor position) that shows you available completions of the command. So I start writing "Ima" and then the box is opened below the cursor and shows me lines with "imag", "ImageAnalyzeParticles", "ImageBlend", ... Now I should be able to select one of the lines with the arrow keys and select the command. When I am no continuing in this line I would like to have a little box above the line which shows me the general syntax. For example if I have "ImageHistogram" in the beginning, it shows me "ImageHistogram [/I/P=plane /R=roiWave /S] imageMatrix"


Another thing that could ease life is the possibility to restrict the effect of command on a wave in a general way by the [...][...] notation. For example if I want to have the WaveStats of a single column in myWave I want to be able to write "WaveStats myWave[][3]" or even restrict it to some lines by "WaveStats myWave[3,9][3]". I know that some commands offer a way to restrict the command to subsets of the wave. However, this does not work always and sometimes is very complicated because sometimes I have to make a ROIwave before.

Regards,
Alexander
a.kaiser wrote:
I am dreaming of a more advanced editor. I am missing standard functions of modern programming editors like: ...


You can edit Igor Pro procedure files in off-line editors with such capabilities. Some of them offer the ability to be tailored to Igor command language syntax. I also believe some folks have already written some levels of Igor-aware macros for various text editors.

I would think, the IgorExchange site would be an appropriate place to post command sets to allow a richer level of program editing in various flavors of third party text editors. Maybe this post will prompt such action.

My request would rather be to have dynamic linking between third party text/programming editors and Igor Pro, so that an IgorPro file being edited in a third party text editor can automatically be re-loaded and recompiled in Igor Pro. It should be possible to do this within the Mac/AppleScript environment for example. Again, perhaps someone might start posting scripts here to do this with for example BBEdit or TextMate.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
a.kaiser wrote:
I am dreaming of a more advanced editor. I am missing standard functions of modern programming editors like:


  • Multiline comments by /*...*/. Sometimes it might be helpful to comment multiple lines out without going through every line.

  • Indentation of multiple lines: Other editors usually have the option to select multiple lines and increase/decrease their indentation by Tab or Shift+Tab.

  • Igor commands not always follow a systematic notation. Thus it is necessary to know the exact notation of a command. Other editors often offer AutoCompletion features. It might be helpful to have a QuickInfo (a little box above/below the cursor position) that shows you available completions of the command. So I start writing "Ima" and then the box is opened below the cursor and shows me lines with "imag", "ImageAnalyzeParticles", "ImageBlend", ... Now I should be able to select one of the lines with the arrow keys and select the command. When I am no continuing in this line I would like to have a little box above the line which shows me the general syntax. For example if I have "ImageHistogram" in the beginning, it shows me "ImageHistogram [/I/P=plane /R=roiWave /S] imageMatrix"



I also dream of such a day. However, there are some features in the current version that you might not know of that would address some of your problems.

1. There is not a way to do multiline comments, but it is possible to block comment or block uncomment many lines at once. Select the code and choose Edit -> Commentize or Decommentize.

2. You can do something similar to indent or de-indent. Choose Edit -> Indent Right or Indent Left. These two commands even have a keyboard shortcut. You can also highlight a block of code and select Edit -> Adjust Indentation and Igor will fix the indentation so that blocks match up properly.

3. I'd love to have command completion and tooltips with the function prototype and descriptions of the parameters a function takes. Igor does provide something similar to this, though not as advanced. If you type in the name of a function or operation in a procedure window, when the color of the word changes to either brown or blue, you can then hit Ctrl + F1 (on windows) and a template for the function or operation will be inserted. As a warning, I find that on my computer I often have to hit this combination 2 or 3 times to get the template to be inserted. I'm not sure if that's due to an Igor bug or issues with my keyboard.

Hopefully these will make the procedure editor a bit less painful. If you already knew about all of these then Jeff brings up a good point about using external editors.



Thank you for the hints. I didn't know some of the things. Igor has many hidden features! :-))