Tools Notepad/en: Unterschied zwischen den Versionen
Cg (Diskussion | Beiträge) |
Cg (Diskussion | Beiträge) |
||
Zeile 68: | Zeile 68: | ||
or equations like: |
or equations like: |
||
x^2 + 3x = 4 |
x^2 + 3x = 4 |
||
[[Datei:Workspace math.png|mini]] |
|||
== See Also == |
== See Also == |
Version vom 15. September 2021, 23:14 Uhr
Inhaltsverzeichnis
Introduction[Bearbeiten]
Workspaces (notepads) are simple text-editor windows. These can be used to prepare or inspect test-data, texts and similar. They also provide a calculator and scripting-language capability: you can type in an expression (expressed as Smalltalk or JavaScript code fragment) and evaluate it. Finally, they can be used as "PostIt-Note", to remember fragments of text or code. Workspaces are very useful to compute test-vectors, hex- or binary numbers or to generate string data, which can be copy-pasted into a freeze-value, an attachment or (using the File Browser) into a file.
The following screenshot displays a script/code fragment being evaluated:
Multiple Tabs[Bearbeiten]
Workspaces support multiple tabs. Click on the "Add Page" button or menu function, to get another tab.
Timer Functions[Bearbeiten]
There is also a Stopwatch and an AlarmTimer found in the Tab-Page menu. Use them for simple measuring tasks, or to get a timed feedback (for example, to get reminded of something to do or check during a long running test-task). The Alarm-Timer can be configured to ring after a time-period or at a final alarm time (good as a tea-timer !).
Snippet Management[Bearbeiten]
All text editors inside expecco share a common snippet database. Snippets are little text fragments which can be quickly pasted into any text editor by pressing some abbreviation followed by ALT-SPACE. For example, a programmer who often needs the string "self" to be typed in, might want to attach the word "self " to the snipplet-abreviation "s" and get the full string via "s"-ALT-SPACE. A number of predefined snippets (mostly for programmers) can be found and managed in the snippet manager. You may want to customize them according to your domain's requirements.
Collecting Text from Various Places[Bearbeiten]
A very common task is to collect text-fragments via copy-paste from various places (such as different input fields of a tested GUI application) and place them as a single line collection into a freeze-value, attachment or other string-field. The "Autofetch Selection" option found in the "Edit" menu does exactly that for you: it monitors the clipboard, and appends every copied string (from any other application) into the workspace's text area.
Sorting[Bearbeiten]
Under the editor's right-button-menu, you will find various items under "More" → "Tools" → "Sort". These operate on the currently selected line-range. For example, to sort a number of lines, select them, and apply the "Sort Lines" function.
Generating Unique IDs[Bearbeiten]
The right-button-menu also provides a function to generate globally unique IDs (GUIDs or UUIDs). Try "More" → "More" → "Insert new UUID"
Code Evaluation[Bearbeiten]
Workspaces include code interpreters for JavaScript and Smalltalk Code. To evaluate a piece of code, select it, and apply the "doIt" menu function. Use "printIt" to paste the result. Finally "inspectIt" will open an inspector window on the result.
For example, to compute the square-root of the number 2, type:
2.sqrt()
apply "printIt", to get the result pasted at the current text-cursor position (already selected, so you can Cut or Copy it immediately for further use).
The syntax of the interpreter can be changed via the main-menu (under the "Workspace"-item), or via the right-click-menu in the lower-right syntax indicator field. Notice that the syntax-indicator field's visibility can be controlled via the "View"-menu's "Show Info" item. You may have to turn it on first.
The above example works when "JavaScript" is set as syntax. With Smalltalk syntax, you would have to enter:
2 sqrt
More Features[Bearbeiten]
The expecco Notepad as described here is a somewhat stripped-down version of the full Smalltalk-Workspace application. It has smaller menus and less functions as the full featured version, in order to be more "beginner friendly".
You will find many more features (text-filters, variables, languages etc.) in this application, which can be opened via:
Smalltalk.WorkspaceApplication.open()
or (if you prefer Smalltalk), with:
Smalltalk::WorkspaceApplication open
or by changing the default notepad in the "Settings" → "Internal Tools" dialog to "Smalltalk".
Language Selection[Bearbeiten]
The Smalltalk notepad (aka "workspace") supports multiple programming languages, which can be switched via the top menu's "Workspace" menu.
For example, when switching to the "Physic/Math" language, you can enter expressions like:
10 Ω * 5 A
or equations like:
x^2 + 3x = 4
See Also[Bearbeiten]
The workspace's full documentation is part of the official Smalltalk/X Online Documentation.
Back to Online Documentation.
Back to Tools.