BeanShellTutorial:1 Introduction

From jWork.ORG
Jump to: navigation, search
Limitted access. Reguest membership or login to this link first if you are already a member

BeanShell Tutorial

Left window is a code editor which can be used to type BeanShell commands. Press the [Run] button on the right to run these commands and to see the output. You can change vertical divider position with the mouse if the output does not fit to the right window.

Let's get familiar with the interactive prompt. Type:


and press [Run]. You will see "ok". This means that you can talk to the interactive BeanShell. In fact, now you have learned how to print a string (“ok”). You can type the same a new text in the editor, and press [Run]. For example, let's print ok on different lines using "\n" as a separator:

print("ok\nok\nok");  //  comment

where two backslashes indicate your comment for this code. Again, press [Run]. You will see a pop-up window with the 3 lines of "ok". The reason why you got a pop-up window instead inline output, is because the text did not fit to the on-line window. You can type several commands on one line, but separated them with ";"

print("ok"); print("ok"); print("ok"); // comment

In some cases you can edit example and run the modified code. In such cases you will see a green border around such codes. Try to change 'ok' to something else and print "output"

print("ok");  //  you can edit this command

If you are not the registered member, you cannot run the code and cannot see the outputs.

Using a standalone application

You can download the standalone application to work with symbolic math. Please use This application runs on any computer (Windows, Linux, Mac). Go to BeanShellTutorial:Download section.