en:documentation:script_example
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:documentation:script_example [2014/06/15 18:58] – pch | en:documentation:script_example [2016/01/20 15:55] (current) – [Script example] pch | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| This page give tips and example of scripting functions.\\ | This page give tips and example of scripting functions.\\ | ||
| - | You can also look at the three [[toolbox|standard tool box]] code from within the program. | + | You can also look at the three [[toolbox|standard tool box]] code from within the program.\\ |
| + | For more details about a specific function see the [[script_reference|script reference]] page. | ||
| ===== Generality ===== | ===== Generality ===== | ||
| Line 22: | Line 22: | ||
| a: | a: | ||
| b: | b: | ||
| - | c: | + | |
| + | | ||
| c.add(' | c.add(' | ||
| c.add(a); | c.add(a); | ||
| c.add(b); | c.add(b); | ||
| r: | r: | ||
| - | c.free; | + | c.clear; |
| memo_1.lines.add(r); | memo_1.lines.add(r); | ||
| end | end | ||
| else memo_1.lines.add(rsTelescopeNot); | else memo_1.lines.add(rsTelescopeNot); | ||
| - | end. | + | end. |
| </ | </ | ||
| Line 90: | Line 91: | ||
| < | < | ||
| - | c: | + | GetSL(' |
| + | c.clear; | ||
| </ | </ | ||
| - | Create an instance of the TStringList object. | + | Request a TStringList object |
| ---- | ---- | ||
| Line 109: | Line 111: | ||
| </ | </ | ||
| Execute the command and store the result in the variable r. | Execute the command and store the result in the variable r. | ||
| - | |||
| - | ---- | ||
| - | |||
| - | < | ||
| - | c.free; | ||
| - | </ | ||
| - | As soon we no more need the stringlist we destroy it to free the memory. | ||
| ---- | ---- | ||
| Line 279: | Line 274: | ||
| var r: | var r: | ||
| begin | begin | ||
| - | r: | + | |
| + | | ||
| RunOutput(' | RunOutput(' | ||
| Memo_1.lines.assign(r); | Memo_1.lines.assign(r); | ||
| - | r.free; | ||
| end. | end. | ||
| </ | </ | ||
en/documentation/script_example.1402851480.txt.gz · Last modified: 2015/11/06 20:33 (external edit)
