]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.tutorial/scl/Tutorial/1.01 Console.md
Import org.simantics.scl.tutorial from incubator SVN repo
[simantics/platform.git] / bundles / org.simantics.scl.tutorial / scl / Tutorial / 1.01 Console.md
diff --git a/bundles/org.simantics.scl.tutorial/scl/Tutorial/1.01 Console.md b/bundles/org.simantics.scl.tutorial/scl/Tutorial/1.01 Console.md
new file mode 100644 (file)
index 0000000..011db66
--- /dev/null
@@ -0,0 +1,73 @@
+# Console\r
+\r
+The easiest way of getting started with SCL is to use SCL console that is normally included in\r
+Simantics-based products. You can open the console by pressing ALT-SHIFT-q and s or\r
+from menu **Window/Show View/SCL Console**.\r
+\r
+## Executing commands \r
+\r
+SCL console works by executing commands you write into the input box in the bottom of the view.\r
+After the command has been written, it can be executed by pressing ENTER. If the command\r
+contains syntax errors they are written to the console in red text and indication for the\r
+error position.\r
+\r
+Multi-line commands can be written by creating a new line with CTRL-ENTER. \r
+The command history can be browsed with CTRL-UP and CTRL-DOWN.\r
+Also the standard keybindings CTRL-c (Copy), CTRL-v (Paste), CTRL-x (Cut), CTRL-a (Select all) work as expected\r
+both in the input and output area of the console depending on which of them has a focus.\r
+You can also write (or paste) multiple commands at the same time.\r
+\r
+If the command you write into console results as an ordinary value, it is printed\r
+to the console. Here are couple of examples you can try:\r
+\r
+~~~\r
+> 13\r
+13\r
+> 1+2\r
+3\r
+> sin 1\r
+0.8414709848078965\r
+> "Hello " + "world!"\r
+Hello world!\r
+> [1,3,5]\r
+[1, 3, 5]\r
+~~~\r
+\r
+The console remembers the variables you declare, but they are forgotten when the\r
+console (or the whole application) is closed.\r
+\r
+~~~\r
+> x = 35\r
+> y = 40\r
+> x + y\r
+75\r
+> x * y\r
+1400\r
+~~~\r
+\r
+If you write a command that prints something as a side-effect, the prints are shown in the console:\r
+\r
+~~~\r
+> print "Hello" ; print "world!"\r
+Hello\r
+world!\r
+~~~\r
+\r
+The currently running command can be interrupted with **Interrupt current command** button\r
+in the top right corner of the console.\r
+All commands don't support interruption.\r
+The output area of the console can be cleared with **Clear console** button.\r
+\r
+## Importing modules\r
+\r
+The rightmost button in the console opens a dialog for managing modules that are available\r
+for the console. It shows currently imported modules and contains buttons for importing\r
+modules from different sources. The imported modules are remembered even when the console\r
+is closed if the import is marked persistent. \r
+\r
+The another way to import modules is run import command from the console, for example\r
+\r
+    import "Simantics/DB"\r
+\r
+The button with two arrows reloads the modules that are imported to the console. It\r
+is useful if you develop your own module and want to test modified definitions.
\ No newline at end of file