Software … powerful tools for your research & development!

New Feature: Code Snippets Library

Dr. Rüdiger Paschotta

I have just implemented a nice new feature for the software RP Fiber Power, RP Coating, RP ProPulse and RP Resonator. There is now the so-called code snippets library. Its purpose is to conveniently provide certain parts (snippets) of script code, which you can directly insert in the script editor. You will normally find it quite easy to understand the snippets, which also contain some comments, and can adapt them to your application.

You can reach the code snippet library with the Edit menu or (more quickly) with a new item in the toolbar of the main window, and here is what you will see (in the case of RP Fiber Power):

code snippets library

(In other programs, you will find a different set of specialized snippets.)

The library is very easy to handle. You just select a snippet in the list on the left side, and see its content on the right side. With the button “Copy to clipboard” you can copy it to the Windows clipboard; with “Insert into script editor” it is also inserted into the active script editor – just at the location of the cursor. (If you got the wrong position, press Ctrl-Z to redo, move the cursor to the correct location, and press Ctrl-V for pasting again.)

Using this feature is certainly easier than searching for some solution in the documentation, e.g. in the online help system, or in the demo files. When you find a command or function in the code which you do not know, just place the cursor on it in the script editor and press F2 to call the corresponding help page.

The software comes with some set of code snippets, and you can also add your own snippets quite easily. With the button at the bottom, you can open a file in a user folder where you can place your own snippets; these will be used in addition, and will not be lost if the original snippets file is changed due to a software update, for example.

I will probably add quite a few more snippets in the coming weeks, trying to provide useful things for a lot of common purposes.

As always, users of our software can have a free update in order to get this feature – just contact us. This holds even if you are using a quite old version. You know, many other software companies want you to regularly pay for maintenance subscriptions, while we are very generous to our customers.


This article is a posting of the RP Photonics Software News, authored by Dr. Rüdiger Paschotta. You may link to this page, because its location is permanent.

Note that you can also receive the articles in the form of a newsletter or with an RSS feed.

Questions and Comments from Users

Here you can submit questions and comments. As far as they get accepted by the author, they will appear above this paragraph together with the author’s answer. The author will decide on acceptance based on certain criteria. Essentially, the issue must be of sufficiently broad interest.

Please do not enter personal data here; we would otherwise delete it soon. (See also our privacy declaration.) If you wish to receive personal feedback or consultancy from the author, please contact him, e.g. via e-mail.

Spam check:

By submitting the information, you give your consent to the potential publication of your inputs on our website according to our rules. (If you later retract your consent, we will delete those inputs.) As your inputs are first reviewed by the author, they may be published with some delay.

preview

Share this with your friends and colleagues, e.g. via social media:

These sharing buttons are implemented in a privacy-friendly way!