<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Christian</id>
	<title>STX Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Christian"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php/Special:Contributions/Christian"/>
	<updated>2026-05-06T10:58:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Template:STX&amp;diff=10416</id>
		<title>Template:STX</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Template:STX&amp;diff=10416"/>
		<updated>2019-06-05T20:55:44Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--J.W. 13.4.2015 Changed back to plain old &#039;STx&#039; to facilitate reading comprehension --&amp;gt;&amp;lt;!--{{#switch: {{#expr: {{CURRENTTIMESTAMP}} mod 8}}&lt;br /&gt;
 | 0 = {{#ifeq: {{{1}}} | caps |A|a}}stounding&lt;br /&gt;
 | 1 = {{#ifeq: {{{1}}} | caps |A|a}}mazingly amazing&lt;br /&gt;
 | 2 = {{#ifeq: {{{1}}} | caps |A|a}}mazing&lt;br /&gt;
 | 3 = {{#ifeq: {{{1}}} | caps |A|a}}mazingly inspiring&lt;br /&gt;
 | 4 = {{#ifeq: {{{1}}} | caps |A|a}}stonishing&lt;br /&gt;
 | 5 = {{#ifeq: {{{1}}} | caps |A|a}}wesome&lt;br /&gt;
 | 6 = {{#ifeq: {{{1}}} | caps |A|a}}mazingly stunning&lt;br /&gt;
 | 7 = {{#ifeq: {{{1}}} | caps |U|u}}nbelievable}} S_TOOLS-ST&amp;lt;sup&amp;gt;x&amp;lt;/sup&amp;gt;&lt;br /&gt;
--&amp;gt;ST&amp;lt;sup&amp;gt;x&amp;lt;/sup&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Main_Page&amp;diff=10415</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Main_Page&amp;diff=10415"/>
		<updated>2019-06-05T20:53:55Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== {{STx}} {{VERSION}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} is an amazing software tool for the analysis, signal processing and annotation of Wave sound files. {{STX}} runs on the Windows operating system. It was originally a port of the S_TOOLS application for dedicated DSP hardware developed at the [https://www.kfs.oeaw.ac.at Acoustics Research Institute] in the 1980s. This documentation is work in progress and by no means complete. If you fail to find something you need, please [[Contact|get in touch]] with the development team.&lt;br /&gt;
&lt;br /&gt;
=== Using {{STx}} ===&lt;br /&gt;
&lt;br /&gt;
* [[User_Guide|User Guide]]&lt;br /&gt;
&lt;br /&gt;
=== {{STx}} Programming ===&lt;br /&gt;
&lt;br /&gt;
* [[Programmer_Guide/STx_Guru|Starting with {{STx}} Programming]]&lt;br /&gt;
* [[Programmer_Guide|Programmer Guide]]&lt;br /&gt;
* [[Programmer_Guide/Quick_Reference|Quick Reference]]&lt;br /&gt;
&lt;br /&gt;
=== About {{STx}} {{VERSION}} ===&lt;br /&gt;
&lt;br /&gt;
* Platform: runs on Windows Vista and higher&lt;br /&gt;
* [[History of Changes]]&lt;br /&gt;
* [[Known Bugs]]&lt;br /&gt;
* [[Feature Requests]]&lt;br /&gt;
* [[Contact]]&lt;br /&gt;
* [[Running STx under Linux or macOS]]&lt;br /&gt;
&lt;br /&gt;
=== Download ===&lt;br /&gt;
&lt;br /&gt;
[https://www.kfs.oeaw.ac.at/pub/stx/stx-4.4.10.9712-freeware.exe STx 4.4.10]&lt;br /&gt;
&lt;br /&gt;
[https://www.kfs.oeaw.ac.at/pub/stx/ older releases]&lt;br /&gt;
&lt;br /&gt;
==MediaWiki Links==&lt;br /&gt;
* [[STx Documentation Style Guide|Style guide]] for documenting {{STx}} in this wiki.&lt;br /&gt;
* Consult the [http://meta.wikimedia.org/wiki/Help:Contents User&#039;s Guide] for information on using the wiki software.&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [http://www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Category:Shell_Item&amp;diff=10308</id>
		<title>Category:Shell Item</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Category:Shell_Item&amp;diff=10308"/>
		<updated>2019-01-23T13:31:30Z</updated>

		<summary type="html">&lt;p&gt;Christian: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Category:Programmer_Guide&amp;diff=9576</id>
		<title>Category:Programmer Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Category:Programmer_Guide&amp;diff=9576"/>
		<updated>2017-11-21T14:14:41Z</updated>

		<summary type="html">&lt;p&gt;Christian: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library&amp;diff=9575</id>
		<title>Programmer Guide/Macro Library</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library&amp;diff=9575"/>
		<updated>2017-11-20T17:56:10Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Macros and Classes of the Standard Library}}&lt;br /&gt;
&lt;br /&gt;
This section describes the {{STX}} standard macros and classes. They are all linked into the library file &#039;&#039;&#039;stx.lib&#039;&#039;&#039;, which is part of the standard installation, and loaded on program start. A detailed description is only given for the most useful macros and classes. For a description of all other macros and classes not described here, you must look to the source files.&lt;br /&gt;
&lt;br /&gt;
==Macros==&lt;br /&gt;
*[[Programmer Guide/Macro Library/BSF|BSF]] &amp;amp;rarr; soundfile management functions&lt;br /&gt;
*[[Programmer_Guide/Macro_Library/BUTIL|BUtil]] &amp;amp;rarr; misc. utility functions&lt;br /&gt;
*[[Programmer_Guide/Macro_Library/UM|UM or EM]] &amp;amp;rarr; simple message boxes&lt;br /&gt;
*[[Programmer Guide/Macro Library/CONLOG|ConLog]] &amp;amp;rarr; write messages to [[User_Guide|STX_Console]] Console and/or [[User_Guide/Log_Window|Log-window]]&lt;br /&gt;
*[[Programmer_Guide/Macro_Library/LOGWINDOW|LogWindow]] &amp;amp;rarr; [[User_Guide/Log_Window|Log-window]] control functions&lt;br /&gt;
*[[Programmer Guide/Macro Library/SHOWITEM|ShowItem]] &amp;amp;rarr; show [[Programmer_Guide/Shell_Items|shell item]] properties and/or data&lt;br /&gt;
&lt;br /&gt;
==Classes==&lt;br /&gt;
&lt;br /&gt;
*[[/COBJ|CObj - ths base class for all {{STX}} classes]]&lt;br /&gt;
&lt;br /&gt;
==Outdated Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
![[/ADesc|ADesc.stx]]&lt;br /&gt;
|-&lt;br /&gt;
| ||Implements a set of classes to store and retrieve audio descriptor data in a combined XML/binary format.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
![[/BDataSet|BDataSet.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BDataSet|BDataSet]]&amp;lt;BR&amp;gt;project document&#039;&#039;&#039;&lt;br /&gt;
|[[/BDataSet#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BSeq|BSeq.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSeq|BSeq]]&amp;lt;BR&amp;gt;signal sequence&#039;&#039;&#039;&lt;br /&gt;
|[[/CAppSetup#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BSF|BSF.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;macro [[/BSF|BSF]]&amp;lt;BR&amp;gt;soundfile handling&lt;br /&gt;
|[[/BSF#NewDialog|NewDialog]] &amp;amp;middot; [[/BSF#OpenDialog|OpenDialog]] &amp;amp;middot; [[/BSF#Open|Open]] &amp;amp;middot; [[/BSF#Close|Close]] &amp;amp;middot; [[/BSF#CloseAll|CloseAll]] &amp;amp;middot; [[/BSF#Select|Select]] &amp;amp;middot; [[/BSF#Truncate|Truncate]]&lt;br /&gt;
|-&lt;br /&gt;
![[/BSTXIni|BSTXIni.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSTXIni|BSTXIni]]&amp;lt;BR&amp;gt;workspace document&#039;&#039;&#039;&lt;br /&gt;
|[[/BSTXIni#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BUTIL|BUTIL.stx]]&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;macro [[/BUTIL|BUTIL]]&amp;lt;BR&amp;gt;misc. utility functions&#039;&#039;&#039;&lt;br /&gt;
|[[/BUTIL#MsgBox|MsgBox]] &amp;amp;middot; [[/BUTIL#EditBox|EditBox]] &amp;amp;middot; [[/BUTIL#FileDialog|FileDialog]] &amp;amp;middot; [[/BUTIL#FileCommands|Copy/Move/DeleteFile]] &amp;amp;middot; [[/BUTIL#DirectoryDialog|DirectoryDialog]] &amp;amp;middot; [[/BUTIL#GetDirectory|GetDirectory]] &amp;amp;middot; [[/BUTIL#Directory|Directory]] &amp;amp;middot; [[/BUTIL#GetSwitch|GetSwitch]] &amp;amp;middot; [[/BUTIL#GetKeyWord|GetKeyWord]] &amp;amp;middot; [[/BUTIL#GetKeyIndex|GetKeyIndex]] &amp;amp;middot; [[/BUTIL#SelectTable|SelectTable]]&lt;br /&gt;
|-&lt;br /&gt;
![[/BXMLDoc|BXMLDoc.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BXMLDoc|BXMLDoc]]&amp;lt;BR&amp;gt;xml document&#039;&#039;&#039;&lt;br /&gt;
|[[/BXMLDoc#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/CAppSetup|CAppSetup.stx]] &lt;br /&gt;
|-&lt;br /&gt;
| || Implements the setup dialogs, runtime control classes and the analysis methods for all Viewer-applications.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
![[/CGraphSetup|CGraphSetup.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CGraphSetup|CGraphSetup]]&amp;lt;BR&amp;gt;graphics profile&#039;&#039;&#039;&lt;br /&gt;
|[[/CGraphSetup#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/SGraphColors|SGraphColors]]&amp;lt;BR&amp;gt;graph settings&#039;&#039;&#039;&lt;br /&gt;
|[[/SGraphColors#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
!Classes.stx&amp;lt;BR&amp;gt;basic class library&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CObj|CObj]]&amp;lt;BR&amp;gt;the base class&#039;&#039;&#039;&lt;br /&gt;
|[[/CObj#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CObjEx|CObjEx]]&amp;lt;BR&amp;gt;extension class for scripts&#039;&#039;&#039;&lt;br /&gt;
|[[/CObjEx#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/ModalDialog|ModalDialog]]&amp;lt;BR&amp;gt;a modal dialog&#039;&#039;&#039;&lt;br /&gt;
|[[/ModalDialog#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/SetupSheet|SetupSheet]]&amp;lt;BR&amp;gt;property sheets&#039;&#039;&#039;&lt;br /&gt;
|[[/SetupSheet#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/PlayWave|PlayWave]]&amp;lt;BR&amp;gt;general play class&#039;&#039;&#039;&lt;br /&gt;
|[[/PlayWave#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class SetWaveIO&amp;lt;BR&amp;gt;wave device setup&#039;&#039;&#039;&lt;br /&gt;
|Implements the wave device settings dialog and some wave device select/query functions.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CalibSig|CalibSig]]&amp;lt;BR&amp;gt;signal calibration&#039;&#039;&#039;&lt;br /&gt;
|[[/CalibSig#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class CAppQueue&amp;lt;BR&amp;gt;batch queue&#039;&#039;&#039;&lt;br /&gt;
|This class is used to control the viewers and other applications started by the workspace application.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSignal|BSignal]]&amp;lt;BR&amp;gt;signal processing controller&#039;&#039;&#039;&lt;br /&gt;
|Implements the dialogs and execution modules for the signal modification methods (amplify, normalize, div. filters) included in the workspace application.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CDlgMap|CDlgMap]]&amp;lt;BR&amp;gt;enhanced modal dialog&#039;&#039;&#039;&lt;br /&gt;
|[[/CDlgMap#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CMenu|CMenu]]&amp;lt;BR&amp;gt;menu handling class&#039;&#039;&#039;&lt;br /&gt;
|[[/CMenu#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XWave|XWave]]&amp;lt;BR&amp;gt;enhanced wave object&#039;&#039;&#039;&lt;br /&gt;
|[[/XWave#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XPlot|XPlot]]&amp;lt;BR&amp;gt;general function plot&#039;&#039;&#039;&lt;br /&gt;
|[[/XPlot#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XGraph|XGraph]]&amp;lt;BR&amp;gt;a graph in a XPlot display&#039;&#039;&#039;&lt;br /&gt;
|[[/XGraph#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CTemplates|CTemplates]]&amp;lt;BR&amp;gt;manage XML templates&#039;&#039;&#039;&lt;br /&gt;
|Management class for the templates used by the workspace application (e.g. ASegTemplate).&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/NDLib|NDLib]]&amp;lt;BR&amp;gt;signal processing, audio descriptors, ...&#039;&#039;&#039;&lt;br /&gt;
|[[/NDLib#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/TBMGR|TBMGR]]&amp;lt;BR&amp;gt;toolbox manager and base class&#039;&#039;&#039;&lt;br /&gt;
|[[/TBMGR#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/KlattSyn|KlattSyn]]&amp;lt;BR&amp;gt;formant speech synthesis&#039;&#039;&#039;&lt;br /&gt;
|[[/KlattSyn#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/DataSetCmd|DataSet.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;macro [[/DataSetCmd|DataSetCmd]]&amp;lt;BR&amp;gt;execute dataset command&#039;&#039;&#039;&lt;br /&gt;
|[[/DataSetCmd#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/APar|APar]]&amp;lt;BR&amp;gt;parameter data management&#039;&#039;&#039;&lt;br /&gt;
|[[/APar#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/StdLib|StdLib.stx]]&amp;lt;BR&amp;gt;basic macro library&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;application management&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#AppLoad|AppLoad]] &amp;amp;middot; [[/StdLib#AppMain|AppMain]] &amp;amp;middot; [[/StdLib#AppCleanup|AppCleanup]] &amp;amp;middot; [[/StdLib#AppHelp|AppHelp]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;message handling&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#PostMessage|PostMessage]] &amp;amp;middot; [[/StdLib#SetMsgHandler|SetMsgHandler]] &amp;amp;middot; [[/StdLib#DispatchMsg|DispatchMsg]] &amp;amp;middot; [[/StdLib#MsgQueue|MsgQueue]] &amp;amp;middot; [[/StdLib#MsgFilter|MsgFilter]] &amp;amp;middot; [[/StdLib#GetMessage|GetMessage]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;utilities for standard&amp;lt;BR&amp;gt;{{STX}} applications&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#ExtSetup|ExtSetup]] &amp;amp;middot; [[/StdLib#PlayCursor|PlayCursor]] &amp;amp;middot; [[/StdLib#GenerateScaleParams|GenerateScaleParams]] &amp;amp;middot; [[/StdLib#MetaSegment|MetaSegment]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;file functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#stxFileTypeList|stxFileTypeList]] &amp;amp;middot; [[/StdLib#stxFileType|stxFileType]] &amp;amp;middot; [[/StdLib#SectionFile|SectionFile]] &amp;amp;middot; [[/StdLib#FileToolBox|FileToolBox]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;display functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#LogWindow|LogWindow]] &amp;amp;middot; [[/StdLib#ConLog|ConLog]] &amp;amp;middot; [[/StdLib#UM and EM|UM and EM]] &amp;amp;middot; [[/StdLib#ShowItem|ShowItem]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;dialog and window functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#CreateMenu|CreateMenu]] &amp;amp;middot; [[/StdLib#DoModalDialog|DoModalDialog]] &amp;amp;middot; [[/StdLib#SetModalWindow|SetModalWindow]] &amp;amp;middot; [[/StdLib#GetWindowPos|GetWindowPos]] &amp;amp;middot; [[/StdLib#SetWindowPos|SetWindowPos]] &amp;amp;middot; [[/StdLib#WindowSizeDlg|WindowSizeDlg]] &amp;amp;middot; [[/StdLib#GetMonitor|GetMonitor]] &amp;amp;middot; [[/StdLib#GetDesktop|GetDesktop]] &amp;amp;middot; [[/StdLib#ProgressBox|ProgressBox]] &amp;amp;middot; [[/StdLib#InitDialogItem|InitDialogItem]] &amp;amp;middot; [[/StdLib#SetControlMode|SetControlMode]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPU]] and [[Programmer_Guide/Shell_Items/Graph|graph]] functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#SetGraphXScale|SetGraphXScale]] &amp;amp;middot; [[/StdLib#GetOutputValue|GetOutputValue]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPUs]]&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#XScaleLinear|XScaleLinear]] &amp;amp;middot; [[/StdLib#XScaleBark|XScaleBark]] &amp;amp;middot; [[/StdLib#Table2Output|Table2Output]] &amp;amp;middot; [[/StdLib#Wave2output|Wave2output]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===alphabetical list of macros===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=bar&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library&amp;diff=9574</id>
		<title>Programmer Guide/Macro Library</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library&amp;diff=9574"/>
		<updated>2017-11-20T17:55:43Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Macros and Classes of the Standard Library}}&lt;br /&gt;
&lt;br /&gt;
This section describes the {{STX}} standard macros and classes. They are all linked into the library file &#039;&#039;&#039;stx.lib&#039;&#039;&#039;, which is part of the standard installation, and loaded on program start. A detailed description is only given for the most useful macros and classes. For a description of all other macros and classes not described here, you must look to the source files.&lt;br /&gt;
&lt;br /&gt;
==Macros==&lt;br /&gt;
*[[Programmer Guide/Macro Library/BSF|BSF]] &amp;amp;rarr; soundfile management functions&lt;br /&gt;
*[[Programmer_Guide/Macro_Library/BUTIL|BUtil]] &amp;amp;rarr; misc. utility functions&lt;br /&gt;
*[[Programmer_Guide/Macro_Library/UM|UM or EM]] &amp;amp;rarr; simple message boxes&lt;br /&gt;
*[[Programmer Guide/Macro Library/CONLOGConLog]] &amp;amp;rarr; write messages to [[User_Guide|STX_Console]] Console and/or [[User_Guide/Log_Window|Log-window]]&lt;br /&gt;
*[[Programmer_Guide/Macro_Library/LOGWINDOW|LogWindow]] &amp;amp;rarr; [[User_Guide/Log_Window|Log-window]] control functions&lt;br /&gt;
*[[Programmer Guide/Macro Library/SHOWITEM|ShowItem]] &amp;amp;rarr; show [[Programmer_Guide/Shell_Items|shell item]] properties and/or data&lt;br /&gt;
&lt;br /&gt;
==Classes==&lt;br /&gt;
&lt;br /&gt;
*[[/COBJ|CObj - ths base class for all {{STX}} classes]]&lt;br /&gt;
&lt;br /&gt;
==Outdated Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
![[/ADesc|ADesc.stx]]&lt;br /&gt;
|-&lt;br /&gt;
| ||Implements a set of classes to store and retrieve audio descriptor data in a combined XML/binary format.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
![[/BDataSet|BDataSet.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BDataSet|BDataSet]]&amp;lt;BR&amp;gt;project document&#039;&#039;&#039;&lt;br /&gt;
|[[/BDataSet#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BSeq|BSeq.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSeq|BSeq]]&amp;lt;BR&amp;gt;signal sequence&#039;&#039;&#039;&lt;br /&gt;
|[[/CAppSetup#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BSF|BSF.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;macro [[/BSF|BSF]]&amp;lt;BR&amp;gt;soundfile handling&lt;br /&gt;
|[[/BSF#NewDialog|NewDialog]] &amp;amp;middot; [[/BSF#OpenDialog|OpenDialog]] &amp;amp;middot; [[/BSF#Open|Open]] &amp;amp;middot; [[/BSF#Close|Close]] &amp;amp;middot; [[/BSF#CloseAll|CloseAll]] &amp;amp;middot; [[/BSF#Select|Select]] &amp;amp;middot; [[/BSF#Truncate|Truncate]]&lt;br /&gt;
|-&lt;br /&gt;
![[/BSTXIni|BSTXIni.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSTXIni|BSTXIni]]&amp;lt;BR&amp;gt;workspace document&#039;&#039;&#039;&lt;br /&gt;
|[[/BSTXIni#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BUTIL|BUTIL.stx]]&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;macro [[/BUTIL|BUTIL]]&amp;lt;BR&amp;gt;misc. utility functions&#039;&#039;&#039;&lt;br /&gt;
|[[/BUTIL#MsgBox|MsgBox]] &amp;amp;middot; [[/BUTIL#EditBox|EditBox]] &amp;amp;middot; [[/BUTIL#FileDialog|FileDialog]] &amp;amp;middot; [[/BUTIL#FileCommands|Copy/Move/DeleteFile]] &amp;amp;middot; [[/BUTIL#DirectoryDialog|DirectoryDialog]] &amp;amp;middot; [[/BUTIL#GetDirectory|GetDirectory]] &amp;amp;middot; [[/BUTIL#Directory|Directory]] &amp;amp;middot; [[/BUTIL#GetSwitch|GetSwitch]] &amp;amp;middot; [[/BUTIL#GetKeyWord|GetKeyWord]] &amp;amp;middot; [[/BUTIL#GetKeyIndex|GetKeyIndex]] &amp;amp;middot; [[/BUTIL#SelectTable|SelectTable]]&lt;br /&gt;
|-&lt;br /&gt;
![[/BXMLDoc|BXMLDoc.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BXMLDoc|BXMLDoc]]&amp;lt;BR&amp;gt;xml document&#039;&#039;&#039;&lt;br /&gt;
|[[/BXMLDoc#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/CAppSetup|CAppSetup.stx]] &lt;br /&gt;
|-&lt;br /&gt;
| || Implements the setup dialogs, runtime control classes and the analysis methods for all Viewer-applications.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
![[/CGraphSetup|CGraphSetup.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CGraphSetup|CGraphSetup]]&amp;lt;BR&amp;gt;graphics profile&#039;&#039;&#039;&lt;br /&gt;
|[[/CGraphSetup#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/SGraphColors|SGraphColors]]&amp;lt;BR&amp;gt;graph settings&#039;&#039;&#039;&lt;br /&gt;
|[[/SGraphColors#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
!Classes.stx&amp;lt;BR&amp;gt;basic class library&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CObj|CObj]]&amp;lt;BR&amp;gt;the base class&#039;&#039;&#039;&lt;br /&gt;
|[[/CObj#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CObjEx|CObjEx]]&amp;lt;BR&amp;gt;extension class for scripts&#039;&#039;&#039;&lt;br /&gt;
|[[/CObjEx#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/ModalDialog|ModalDialog]]&amp;lt;BR&amp;gt;a modal dialog&#039;&#039;&#039;&lt;br /&gt;
|[[/ModalDialog#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/SetupSheet|SetupSheet]]&amp;lt;BR&amp;gt;property sheets&#039;&#039;&#039;&lt;br /&gt;
|[[/SetupSheet#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/PlayWave|PlayWave]]&amp;lt;BR&amp;gt;general play class&#039;&#039;&#039;&lt;br /&gt;
|[[/PlayWave#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class SetWaveIO&amp;lt;BR&amp;gt;wave device setup&#039;&#039;&#039;&lt;br /&gt;
|Implements the wave device settings dialog and some wave device select/query functions.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CalibSig|CalibSig]]&amp;lt;BR&amp;gt;signal calibration&#039;&#039;&#039;&lt;br /&gt;
|[[/CalibSig#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class CAppQueue&amp;lt;BR&amp;gt;batch queue&#039;&#039;&#039;&lt;br /&gt;
|This class is used to control the viewers and other applications started by the workspace application.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSignal|BSignal]]&amp;lt;BR&amp;gt;signal processing controller&#039;&#039;&#039;&lt;br /&gt;
|Implements the dialogs and execution modules for the signal modification methods (amplify, normalize, div. filters) included in the workspace application.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CDlgMap|CDlgMap]]&amp;lt;BR&amp;gt;enhanced modal dialog&#039;&#039;&#039;&lt;br /&gt;
|[[/CDlgMap#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CMenu|CMenu]]&amp;lt;BR&amp;gt;menu handling class&#039;&#039;&#039;&lt;br /&gt;
|[[/CMenu#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XWave|XWave]]&amp;lt;BR&amp;gt;enhanced wave object&#039;&#039;&#039;&lt;br /&gt;
|[[/XWave#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XPlot|XPlot]]&amp;lt;BR&amp;gt;general function plot&#039;&#039;&#039;&lt;br /&gt;
|[[/XPlot#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XGraph|XGraph]]&amp;lt;BR&amp;gt;a graph in a XPlot display&#039;&#039;&#039;&lt;br /&gt;
|[[/XGraph#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CTemplates|CTemplates]]&amp;lt;BR&amp;gt;manage XML templates&#039;&#039;&#039;&lt;br /&gt;
|Management class for the templates used by the workspace application (e.g. ASegTemplate).&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/NDLib|NDLib]]&amp;lt;BR&amp;gt;signal processing, audio descriptors, ...&#039;&#039;&#039;&lt;br /&gt;
|[[/NDLib#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/TBMGR|TBMGR]]&amp;lt;BR&amp;gt;toolbox manager and base class&#039;&#039;&#039;&lt;br /&gt;
|[[/TBMGR#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/KlattSyn|KlattSyn]]&amp;lt;BR&amp;gt;formant speech synthesis&#039;&#039;&#039;&lt;br /&gt;
|[[/KlattSyn#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/DataSetCmd|DataSet.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;macro [[/DataSetCmd|DataSetCmd]]&amp;lt;BR&amp;gt;execute dataset command&#039;&#039;&#039;&lt;br /&gt;
|[[/DataSetCmd#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/APar|APar]]&amp;lt;BR&amp;gt;parameter data management&#039;&#039;&#039;&lt;br /&gt;
|[[/APar#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/StdLib|StdLib.stx]]&amp;lt;BR&amp;gt;basic macro library&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;application management&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#AppLoad|AppLoad]] &amp;amp;middot; [[/StdLib#AppMain|AppMain]] &amp;amp;middot; [[/StdLib#AppCleanup|AppCleanup]] &amp;amp;middot; [[/StdLib#AppHelp|AppHelp]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;message handling&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#PostMessage|PostMessage]] &amp;amp;middot; [[/StdLib#SetMsgHandler|SetMsgHandler]] &amp;amp;middot; [[/StdLib#DispatchMsg|DispatchMsg]] &amp;amp;middot; [[/StdLib#MsgQueue|MsgQueue]] &amp;amp;middot; [[/StdLib#MsgFilter|MsgFilter]] &amp;amp;middot; [[/StdLib#GetMessage|GetMessage]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;utilities for standard&amp;lt;BR&amp;gt;{{STX}} applications&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#ExtSetup|ExtSetup]] &amp;amp;middot; [[/StdLib#PlayCursor|PlayCursor]] &amp;amp;middot; [[/StdLib#GenerateScaleParams|GenerateScaleParams]] &amp;amp;middot; [[/StdLib#MetaSegment|MetaSegment]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;file functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#stxFileTypeList|stxFileTypeList]] &amp;amp;middot; [[/StdLib#stxFileType|stxFileType]] &amp;amp;middot; [[/StdLib#SectionFile|SectionFile]] &amp;amp;middot; [[/StdLib#FileToolBox|FileToolBox]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;display functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#LogWindow|LogWindow]] &amp;amp;middot; [[/StdLib#ConLog|ConLog]] &amp;amp;middot; [[/StdLib#UM and EM|UM and EM]] &amp;amp;middot; [[/StdLib#ShowItem|ShowItem]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;dialog and window functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#CreateMenu|CreateMenu]] &amp;amp;middot; [[/StdLib#DoModalDialog|DoModalDialog]] &amp;amp;middot; [[/StdLib#SetModalWindow|SetModalWindow]] &amp;amp;middot; [[/StdLib#GetWindowPos|GetWindowPos]] &amp;amp;middot; [[/StdLib#SetWindowPos|SetWindowPos]] &amp;amp;middot; [[/StdLib#WindowSizeDlg|WindowSizeDlg]] &amp;amp;middot; [[/StdLib#GetMonitor|GetMonitor]] &amp;amp;middot; [[/StdLib#GetDesktop|GetDesktop]] &amp;amp;middot; [[/StdLib#ProgressBox|ProgressBox]] &amp;amp;middot; [[/StdLib#InitDialogItem|InitDialogItem]] &amp;amp;middot; [[/StdLib#SetControlMode|SetControlMode]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPU]] and [[Programmer_Guide/Shell_Items/Graph|graph]] functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#SetGraphXScale|SetGraphXScale]] &amp;amp;middot; [[/StdLib#GetOutputValue|GetOutputValue]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPUs]]&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#XScaleLinear|XScaleLinear]] &amp;amp;middot; [[/StdLib#XScaleBark|XScaleBark]] &amp;amp;middot; [[/StdLib#Table2Output|Table2Output]] &amp;amp;middot; [[/StdLib#Wave2output|Wave2output]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===alphabetical list of macros===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=bar&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library&amp;diff=9573</id>
		<title>Programmer Guide/Macro Library</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library&amp;diff=9573"/>
		<updated>2017-11-20T17:53:55Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Macros and Classes of the Standard Library}}&lt;br /&gt;
&lt;br /&gt;
This section describes the {{STX}} standard macros and classes. They are all linked into the library file &#039;&#039;&#039;stx.lib&#039;&#039;&#039;, which is part of the standard installation, and loaded on program start. A detailed description is only given for the most useful macros and classes. For a description of all other macros and classes not described here, you must look to the source files.&lt;br /&gt;
&lt;br /&gt;
==Macros==&lt;br /&gt;
*[[Programmer Guide/Macro Library/BSF|BSF]] &amp;amp;rarr; soundfile management functions&lt;br /&gt;
*[[Programmer_Guide/Macro_Library/BUTIL|BUtil]] &amp;amp;rarr; misc. utility functions&lt;br /&gt;
*[[/UM|UM or EM]] &amp;amp;rarr; simple message boxes&lt;br /&gt;
*[[/CONLOG|ConLog]] &amp;amp;rarr; write messages to [[User_Guide|STX_Console]] Console and/or [[User_Guide/Log_Window|Log-window]]&lt;br /&gt;
*[[/LOGWINDOW|LogWindow]] &amp;amp;rarr; [[User_Guide/Log_Window|Log-window]] control functions&lt;br /&gt;
*[[/SHOWITEM|ShowItem]] &amp;amp;rarr; show [[Programmer_Guide/Shell_Items|shell item]] properties and/or data&lt;br /&gt;
&lt;br /&gt;
==Classes==&lt;br /&gt;
&lt;br /&gt;
*[[/COBJ|CObj - ths base class for all {{STX}} classes]]&lt;br /&gt;
&lt;br /&gt;
==Outdated Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
![[/ADesc|ADesc.stx]]&lt;br /&gt;
|-&lt;br /&gt;
| ||Implements a set of classes to store and retrieve audio descriptor data in a combined XML/binary format.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
![[/BDataSet|BDataSet.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BDataSet|BDataSet]]&amp;lt;BR&amp;gt;project document&#039;&#039;&#039;&lt;br /&gt;
|[[/BDataSet#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BSeq|BSeq.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSeq|BSeq]]&amp;lt;BR&amp;gt;signal sequence&#039;&#039;&#039;&lt;br /&gt;
|[[/CAppSetup#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BSF|BSF.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;macro [[/BSF|BSF]]&amp;lt;BR&amp;gt;soundfile handling&lt;br /&gt;
|[[/BSF#NewDialog|NewDialog]] &amp;amp;middot; [[/BSF#OpenDialog|OpenDialog]] &amp;amp;middot; [[/BSF#Open|Open]] &amp;amp;middot; [[/BSF#Close|Close]] &amp;amp;middot; [[/BSF#CloseAll|CloseAll]] &amp;amp;middot; [[/BSF#Select|Select]] &amp;amp;middot; [[/BSF#Truncate|Truncate]]&lt;br /&gt;
|-&lt;br /&gt;
![[/BSTXIni|BSTXIni.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSTXIni|BSTXIni]]&amp;lt;BR&amp;gt;workspace document&#039;&#039;&#039;&lt;br /&gt;
|[[/BSTXIni#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BUTIL|BUTIL.stx]]&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;macro [[/BUTIL|BUTIL]]&amp;lt;BR&amp;gt;misc. utility functions&#039;&#039;&#039;&lt;br /&gt;
|[[/BUTIL#MsgBox|MsgBox]] &amp;amp;middot; [[/BUTIL#EditBox|EditBox]] &amp;amp;middot; [[/BUTIL#FileDialog|FileDialog]] &amp;amp;middot; [[/BUTIL#FileCommands|Copy/Move/DeleteFile]] &amp;amp;middot; [[/BUTIL#DirectoryDialog|DirectoryDialog]] &amp;amp;middot; [[/BUTIL#GetDirectory|GetDirectory]] &amp;amp;middot; [[/BUTIL#Directory|Directory]] &amp;amp;middot; [[/BUTIL#GetSwitch|GetSwitch]] &amp;amp;middot; [[/BUTIL#GetKeyWord|GetKeyWord]] &amp;amp;middot; [[/BUTIL#GetKeyIndex|GetKeyIndex]] &amp;amp;middot; [[/BUTIL#SelectTable|SelectTable]]&lt;br /&gt;
|-&lt;br /&gt;
![[/BXMLDoc|BXMLDoc.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BXMLDoc|BXMLDoc]]&amp;lt;BR&amp;gt;xml document&#039;&#039;&#039;&lt;br /&gt;
|[[/BXMLDoc#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/CAppSetup|CAppSetup.stx]] &lt;br /&gt;
|-&lt;br /&gt;
| || Implements the setup dialogs, runtime control classes and the analysis methods for all Viewer-applications.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
![[/CGraphSetup|CGraphSetup.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CGraphSetup|CGraphSetup]]&amp;lt;BR&amp;gt;graphics profile&#039;&#039;&#039;&lt;br /&gt;
|[[/CGraphSetup#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/SGraphColors|SGraphColors]]&amp;lt;BR&amp;gt;graph settings&#039;&#039;&#039;&lt;br /&gt;
|[[/SGraphColors#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
!Classes.stx&amp;lt;BR&amp;gt;basic class library&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CObj|CObj]]&amp;lt;BR&amp;gt;the base class&#039;&#039;&#039;&lt;br /&gt;
|[[/CObj#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CObjEx|CObjEx]]&amp;lt;BR&amp;gt;extension class for scripts&#039;&#039;&#039;&lt;br /&gt;
|[[/CObjEx#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/ModalDialog|ModalDialog]]&amp;lt;BR&amp;gt;a modal dialog&#039;&#039;&#039;&lt;br /&gt;
|[[/ModalDialog#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/SetupSheet|SetupSheet]]&amp;lt;BR&amp;gt;property sheets&#039;&#039;&#039;&lt;br /&gt;
|[[/SetupSheet#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/PlayWave|PlayWave]]&amp;lt;BR&amp;gt;general play class&#039;&#039;&#039;&lt;br /&gt;
|[[/PlayWave#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class SetWaveIO&amp;lt;BR&amp;gt;wave device setup&#039;&#039;&#039;&lt;br /&gt;
|Implements the wave device settings dialog and some wave device select/query functions.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CalibSig|CalibSig]]&amp;lt;BR&amp;gt;signal calibration&#039;&#039;&#039;&lt;br /&gt;
|[[/CalibSig#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class CAppQueue&amp;lt;BR&amp;gt;batch queue&#039;&#039;&#039;&lt;br /&gt;
|This class is used to control the viewers and other applications started by the workspace application.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSignal|BSignal]]&amp;lt;BR&amp;gt;signal processing controller&#039;&#039;&#039;&lt;br /&gt;
|Implements the dialogs and execution modules for the signal modification methods (amplify, normalize, div. filters) included in the workspace application.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CDlgMap|CDlgMap]]&amp;lt;BR&amp;gt;enhanced modal dialog&#039;&#039;&#039;&lt;br /&gt;
|[[/CDlgMap#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CMenu|CMenu]]&amp;lt;BR&amp;gt;menu handling class&#039;&#039;&#039;&lt;br /&gt;
|[[/CMenu#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XWave|XWave]]&amp;lt;BR&amp;gt;enhanced wave object&#039;&#039;&#039;&lt;br /&gt;
|[[/XWave#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XPlot|XPlot]]&amp;lt;BR&amp;gt;general function plot&#039;&#039;&#039;&lt;br /&gt;
|[[/XPlot#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XGraph|XGraph]]&amp;lt;BR&amp;gt;a graph in a XPlot display&#039;&#039;&#039;&lt;br /&gt;
|[[/XGraph#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CTemplates|CTemplates]]&amp;lt;BR&amp;gt;manage XML templates&#039;&#039;&#039;&lt;br /&gt;
|Management class for the templates used by the workspace application (e.g. ASegTemplate).&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/NDLib|NDLib]]&amp;lt;BR&amp;gt;signal processing, audio descriptors, ...&#039;&#039;&#039;&lt;br /&gt;
|[[/NDLib#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/TBMGR|TBMGR]]&amp;lt;BR&amp;gt;toolbox manager and base class&#039;&#039;&#039;&lt;br /&gt;
|[[/TBMGR#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/KlattSyn|KlattSyn]]&amp;lt;BR&amp;gt;formant speech synthesis&#039;&#039;&#039;&lt;br /&gt;
|[[/KlattSyn#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/DataSetCmd|DataSet.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;macro [[/DataSetCmd|DataSetCmd]]&amp;lt;BR&amp;gt;execute dataset command&#039;&#039;&#039;&lt;br /&gt;
|[[/DataSetCmd#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/APar|APar]]&amp;lt;BR&amp;gt;parameter data management&#039;&#039;&#039;&lt;br /&gt;
|[[/APar#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/StdLib|StdLib.stx]]&amp;lt;BR&amp;gt;basic macro library&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;application management&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#AppLoad|AppLoad]] &amp;amp;middot; [[/StdLib#AppMain|AppMain]] &amp;amp;middot; [[/StdLib#AppCleanup|AppCleanup]] &amp;amp;middot; [[/StdLib#AppHelp|AppHelp]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;message handling&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#PostMessage|PostMessage]] &amp;amp;middot; [[/StdLib#SetMsgHandler|SetMsgHandler]] &amp;amp;middot; [[/StdLib#DispatchMsg|DispatchMsg]] &amp;amp;middot; [[/StdLib#MsgQueue|MsgQueue]] &amp;amp;middot; [[/StdLib#MsgFilter|MsgFilter]] &amp;amp;middot; [[/StdLib#GetMessage|GetMessage]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;utilities for standard&amp;lt;BR&amp;gt;{{STX}} applications&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#ExtSetup|ExtSetup]] &amp;amp;middot; [[/StdLib#PlayCursor|PlayCursor]] &amp;amp;middot; [[/StdLib#GenerateScaleParams|GenerateScaleParams]] &amp;amp;middot; [[/StdLib#MetaSegment|MetaSegment]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;file functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#stxFileTypeList|stxFileTypeList]] &amp;amp;middot; [[/StdLib#stxFileType|stxFileType]] &amp;amp;middot; [[/StdLib#SectionFile|SectionFile]] &amp;amp;middot; [[/StdLib#FileToolBox|FileToolBox]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;display functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#LogWindow|LogWindow]] &amp;amp;middot; [[/StdLib#ConLog|ConLog]] &amp;amp;middot; [[/StdLib#UM and EM|UM and EM]] &amp;amp;middot; [[/StdLib#ShowItem|ShowItem]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;dialog and window functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#CreateMenu|CreateMenu]] &amp;amp;middot; [[/StdLib#DoModalDialog|DoModalDialog]] &amp;amp;middot; [[/StdLib#SetModalWindow|SetModalWindow]] &amp;amp;middot; [[/StdLib#GetWindowPos|GetWindowPos]] &amp;amp;middot; [[/StdLib#SetWindowPos|SetWindowPos]] &amp;amp;middot; [[/StdLib#WindowSizeDlg|WindowSizeDlg]] &amp;amp;middot; [[/StdLib#GetMonitor|GetMonitor]] &amp;amp;middot; [[/StdLib#GetDesktop|GetDesktop]] &amp;amp;middot; [[/StdLib#ProgressBox|ProgressBox]] &amp;amp;middot; [[/StdLib#InitDialogItem|InitDialogItem]] &amp;amp;middot; [[/StdLib#SetControlMode|SetControlMode]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPU]] and [[Programmer_Guide/Shell_Items/Graph|graph]] functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#SetGraphXScale|SetGraphXScale]] &amp;amp;middot; [[/StdLib#GetOutputValue|GetOutputValue]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPUs]]&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#XScaleLinear|XScaleLinear]] &amp;amp;middot; [[/StdLib#XScaleBark|XScaleBark]] &amp;amp;middot; [[/StdLib#Table2Output|Table2Output]] &amp;amp;middot; [[/StdLib#Wave2output|Wave2output]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===alphabetical list of macros===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=bar&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library&amp;diff=9572</id>
		<title>Programmer Guide/Macro Library</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library&amp;diff=9572"/>
		<updated>2017-11-20T17:53:33Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:Macros and Classes of the Standard Library}}&lt;br /&gt;
&lt;br /&gt;
This section describes the {{STX}} standard macros and classes. They are all linked into the library file &#039;&#039;&#039;stx.lib&#039;&#039;&#039;, which is part of the standard installation, and loaded on program start. A detailed description is only given for the most useful macros and classes. For a description of all other macros and classes not described here, you must look to the source files.&lt;br /&gt;
&lt;br /&gt;
==Macros==&lt;br /&gt;
*[[/BSF|BSF]] &amp;amp;rarr; soundfile management functions&lt;br /&gt;
*[[Programmer_Guide/Macro_Library/BUTIL|BUtil]] &amp;amp;rarr; misc. utility functions&lt;br /&gt;
*[[/UM|UM or EM]] &amp;amp;rarr; simple message boxes&lt;br /&gt;
*[[/CONLOG|ConLog]] &amp;amp;rarr; write messages to [[User_Guide|STX_Console]] Console and/or [[User_Guide/Log_Window|Log-window]]&lt;br /&gt;
*[[/LOGWINDOW|LogWindow]] &amp;amp;rarr; [[User_Guide/Log_Window|Log-window]] control functions&lt;br /&gt;
*[[/SHOWITEM|ShowItem]] &amp;amp;rarr; show [[Programmer_Guide/Shell_Items|shell item]] properties and/or data&lt;br /&gt;
&lt;br /&gt;
==Classes==&lt;br /&gt;
&lt;br /&gt;
*[[/COBJ|CObj - ths base class for all {{STX}} classes]]&lt;br /&gt;
&lt;br /&gt;
==Outdated Documentation==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
![[/ADesc|ADesc.stx]]&lt;br /&gt;
|-&lt;br /&gt;
| ||Implements a set of classes to store and retrieve audio descriptor data in a combined XML/binary format.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
![[/BDataSet|BDataSet.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BDataSet|BDataSet]]&amp;lt;BR&amp;gt;project document&#039;&#039;&#039;&lt;br /&gt;
|[[/BDataSet#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BSeq|BSeq.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSeq|BSeq]]&amp;lt;BR&amp;gt;signal sequence&#039;&#039;&#039;&lt;br /&gt;
|[[/CAppSetup#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BSF|BSF.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;macro [[/BSF|BSF]]&amp;lt;BR&amp;gt;soundfile handling&lt;br /&gt;
|[[/BSF#NewDialog|NewDialog]] &amp;amp;middot; [[/BSF#OpenDialog|OpenDialog]] &amp;amp;middot; [[/BSF#Open|Open]] &amp;amp;middot; [[/BSF#Close|Close]] &amp;amp;middot; [[/BSF#CloseAll|CloseAll]] &amp;amp;middot; [[/BSF#Select|Select]] &amp;amp;middot; [[/BSF#Truncate|Truncate]]&lt;br /&gt;
|-&lt;br /&gt;
![[/BSTXIni|BSTXIni.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSTXIni|BSTXIni]]&amp;lt;BR&amp;gt;workspace document&#039;&#039;&#039;&lt;br /&gt;
|[[/BSTXIni#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/BUTIL|BUTIL.stx]]&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;macro [[/BUTIL|BUTIL]]&amp;lt;BR&amp;gt;misc. utility functions&#039;&#039;&#039;&lt;br /&gt;
|[[/BUTIL#MsgBox|MsgBox]] &amp;amp;middot; [[/BUTIL#EditBox|EditBox]] &amp;amp;middot; [[/BUTIL#FileDialog|FileDialog]] &amp;amp;middot; [[/BUTIL#FileCommands|Copy/Move/DeleteFile]] &amp;amp;middot; [[/BUTIL#DirectoryDialog|DirectoryDialog]] &amp;amp;middot; [[/BUTIL#GetDirectory|GetDirectory]] &amp;amp;middot; [[/BUTIL#Directory|Directory]] &amp;amp;middot; [[/BUTIL#GetSwitch|GetSwitch]] &amp;amp;middot; [[/BUTIL#GetKeyWord|GetKeyWord]] &amp;amp;middot; [[/BUTIL#GetKeyIndex|GetKeyIndex]] &amp;amp;middot; [[/BUTIL#SelectTable|SelectTable]]&lt;br /&gt;
|-&lt;br /&gt;
![[/BXMLDoc|BXMLDoc.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BXMLDoc|BXMLDoc]]&amp;lt;BR&amp;gt;xml document&#039;&#039;&#039;&lt;br /&gt;
|[[/BXMLDoc#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/CAppSetup|CAppSetup.stx]] &lt;br /&gt;
|-&lt;br /&gt;
| || Implements the setup dialogs, runtime control classes and the analysis methods for all Viewer-applications.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
![[/CGraphSetup|CGraphSetup.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CGraphSetup|CGraphSetup]]&amp;lt;BR&amp;gt;graphics profile&#039;&#039;&#039;&lt;br /&gt;
|[[/CGraphSetup#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/SGraphColors|SGraphColors]]&amp;lt;BR&amp;gt;graph settings&#039;&#039;&#039;&lt;br /&gt;
|[[/SGraphColors#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
!Classes.stx&amp;lt;BR&amp;gt;basic class library&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CObj|CObj]]&amp;lt;BR&amp;gt;the base class&#039;&#039;&#039;&lt;br /&gt;
|[[/CObj#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CObjEx|CObjEx]]&amp;lt;BR&amp;gt;extension class for scripts&#039;&#039;&#039;&lt;br /&gt;
|[[/CObjEx#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/ModalDialog|ModalDialog]]&amp;lt;BR&amp;gt;a modal dialog&#039;&#039;&#039;&lt;br /&gt;
|[[/ModalDialog#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/SetupSheet|SetupSheet]]&amp;lt;BR&amp;gt;property sheets&#039;&#039;&#039;&lt;br /&gt;
|[[/SetupSheet#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/PlayWave|PlayWave]]&amp;lt;BR&amp;gt;general play class&#039;&#039;&#039;&lt;br /&gt;
|[[/PlayWave#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class SetWaveIO&amp;lt;BR&amp;gt;wave device setup&#039;&#039;&#039;&lt;br /&gt;
|Implements the wave device settings dialog and some wave device select/query functions.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CalibSig|CalibSig]]&amp;lt;BR&amp;gt;signal calibration&#039;&#039;&#039;&lt;br /&gt;
|[[/CalibSig#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class CAppQueue&amp;lt;BR&amp;gt;batch queue&#039;&#039;&#039;&lt;br /&gt;
|This class is used to control the viewers and other applications started by the workspace application.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/BSignal|BSignal]]&amp;lt;BR&amp;gt;signal processing controller&#039;&#039;&#039;&lt;br /&gt;
|Implements the dialogs and execution modules for the signal modification methods (amplify, normalize, div. filters) included in the workspace application.&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CDlgMap|CDlgMap]]&amp;lt;BR&amp;gt;enhanced modal dialog&#039;&#039;&#039;&lt;br /&gt;
|[[/CDlgMap#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CMenu|CMenu]]&amp;lt;BR&amp;gt;menu handling class&#039;&#039;&#039;&lt;br /&gt;
|[[/CMenu#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XWave|XWave]]&amp;lt;BR&amp;gt;enhanced wave object&#039;&#039;&#039;&lt;br /&gt;
|[[/XWave#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XPlot|XPlot]]&amp;lt;BR&amp;gt;general function plot&#039;&#039;&#039;&lt;br /&gt;
|[[/XPlot#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/XGraph|XGraph]]&amp;lt;BR&amp;gt;a graph in a XPlot display&#039;&#039;&#039;&lt;br /&gt;
|[[/XGraph#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/CTemplates|CTemplates]]&amp;lt;BR&amp;gt;manage XML templates&#039;&#039;&#039;&lt;br /&gt;
|Management class for the templates used by the workspace application (e.g. ASegTemplate).&amp;lt;BR&amp;gt;Documentation included in source file.&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/NDLib|NDLib]]&amp;lt;BR&amp;gt;signal processing, audio descriptors, ...&#039;&#039;&#039;&lt;br /&gt;
|[[/NDLib#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/TBMGR|TBMGR]]&amp;lt;BR&amp;gt;toolbox manager and base class&#039;&#039;&#039;&lt;br /&gt;
|[[/TBMGR#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/KlattSyn|KlattSyn]]&amp;lt;BR&amp;gt;formant speech synthesis&#039;&#039;&#039;&lt;br /&gt;
|[[/KlattSyn#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/DataSetCmd|DataSet.stx]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;macro [[/DataSetCmd|DataSetCmd]]&amp;lt;BR&amp;gt;execute dataset command&#039;&#039;&#039;&lt;br /&gt;
|[[/DataSetCmd#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
!Parameter&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;class [[/APar|APar]]&amp;lt;BR&amp;gt;parameter data management&#039;&#039;&#039;&lt;br /&gt;
|[[/APar#...|...]] &amp;amp;middot; ...&lt;br /&gt;
|-&lt;br /&gt;
![[/StdLib|StdLib.stx]]&amp;lt;BR&amp;gt;basic macro library&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;application management&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#AppLoad|AppLoad]] &amp;amp;middot; [[/StdLib#AppMain|AppMain]] &amp;amp;middot; [[/StdLib#AppCleanup|AppCleanup]] &amp;amp;middot; [[/StdLib#AppHelp|AppHelp]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;message handling&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#PostMessage|PostMessage]] &amp;amp;middot; [[/StdLib#SetMsgHandler|SetMsgHandler]] &amp;amp;middot; [[/StdLib#DispatchMsg|DispatchMsg]] &amp;amp;middot; [[/StdLib#MsgQueue|MsgQueue]] &amp;amp;middot; [[/StdLib#MsgFilter|MsgFilter]] &amp;amp;middot; [[/StdLib#GetMessage|GetMessage]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;utilities for standard&amp;lt;BR&amp;gt;{{STX}} applications&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#ExtSetup|ExtSetup]] &amp;amp;middot; [[/StdLib#PlayCursor|PlayCursor]] &amp;amp;middot; [[/StdLib#GenerateScaleParams|GenerateScaleParams]] &amp;amp;middot; [[/StdLib#MetaSegment|MetaSegment]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;file functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#stxFileTypeList|stxFileTypeList]] &amp;amp;middot; [[/StdLib#stxFileType|stxFileType]] &amp;amp;middot; [[/StdLib#SectionFile|SectionFile]] &amp;amp;middot; [[/StdLib#FileToolBox|FileToolBox]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;display functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#LogWindow|LogWindow]] &amp;amp;middot; [[/StdLib#ConLog|ConLog]] &amp;amp;middot; [[/StdLib#UM and EM|UM and EM]] &amp;amp;middot; [[/StdLib#ShowItem|ShowItem]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;dialog and window functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#CreateMenu|CreateMenu]] &amp;amp;middot; [[/StdLib#DoModalDialog|DoModalDialog]] &amp;amp;middot; [[/StdLib#SetModalWindow|SetModalWindow]] &amp;amp;middot; [[/StdLib#GetWindowPos|GetWindowPos]] &amp;amp;middot; [[/StdLib#SetWindowPos|SetWindowPos]] &amp;amp;middot; [[/StdLib#WindowSizeDlg|WindowSizeDlg]] &amp;amp;middot; [[/StdLib#GetMonitor|GetMonitor]] &amp;amp;middot; [[/StdLib#GetDesktop|GetDesktop]] &amp;amp;middot; [[/StdLib#ProgressBox|ProgressBox]] &amp;amp;middot; [[/StdLib#InitDialogItem|InitDialogItem]] &amp;amp;middot; [[/StdLib#SetControlMode|SetControlMode]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPU]] and [[Programmer_Guide/Shell_Items/Graph|graph]] functions&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#SetGraphXScale|SetGraphXScale]] &amp;amp;middot; [[/StdLib#GetOutputValue|GetOutputValue]]&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPUs]]&#039;&#039;&#039;&lt;br /&gt;
|[[/StdLib#XScaleLinear|XScaleLinear]] &amp;amp;middot; [[/StdLib#XScaleBark|XScaleBark]] &amp;amp;middot; [[/StdLib#Table2Output|Table2Output]] &amp;amp;middot; [[/StdLib#Wave2output|Wave2output]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===alphabetical list of macros===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=bar&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Class_Library/BScript&amp;diff=9571</id>
		<title>Programmer Guide/Class Library/BScript</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Class_Library/BScript&amp;diff=9571"/>
		<updated>2017-11-20T17:50:18Z</updated>

		<summary type="html">&lt;p&gt;Christian: Redirected page to Programmer Guide/BScript&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Programmer_Guide/BScript]]&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library/Macro&amp;diff=9570</id>
		<title>Programmer Guide/Macro Library/Macro</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library/Macro&amp;diff=9570"/>
		<updated>2017-11-20T17:49:02Z</updated>

		<summary type="html">&lt;p&gt;Christian: Redirected page to Programmer Guide/Macro Library&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Programmer Guide/Macro Library]]&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9569</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9569"/>
		<updated>2017-11-20T17:42:23Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Scripts, Development, and Extending {{STX}} */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[User_Guide/Workspace|Workspace]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[User_Guide/Project|project]] file. You can use the [[User_Guide/FindFile|FindFile]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[User_Guide/Real_Time_Analyser|Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[User Guide/Waveform and Segmentation Viewer|Waveform and Segmentation Viewer]] - useful for segmenting signals&lt;br /&gt;
* [[User Guide/Spectrogram and Parameter Viewer|Spectrogram and Parameter Viewer]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[User Guide/Spectrum Viewer|Spectrum Viewer]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[User Guide/Recorder|Recorder]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[User Guide/Command-Line Parameters|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[User Guide/Tutorials|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[User Guide/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[User Guide/Toolbox|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[User Guide/The_Script_Controller|script controller]] dialog, the [[User Guide/STX_Console|command line console]], the integrated [[User Guide/Debugger|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9568</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9568"/>
		<updated>2017-11-20T17:41:36Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[User_Guide/Workspace|Workspace]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[User_Guide/Project|project]] file. You can use the [[User_Guide/FindFile|FindFile]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[User_Guide/Real_Time_Analyser|Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[User Guide/Waveform and Segmentation Viewer|Waveform and Segmentation Viewer]] - useful for segmenting signals&lt;br /&gt;
* [[User Guide/Spectrogram and Parameter Viewer|Spectrogram and Parameter Viewer]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[User Guide/Spectrum Viewer|Spectrum Viewer]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[User Guide/Recorder|Recorder]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[User Guide/Command-Line Parameters|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[User Guide/Tutorials|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9567</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9567"/>
		<updated>2017-11-20T17:41:19Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Command-Line Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[User_Guide/Workspace|Workspace]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[User_Guide/Project|project]] file. You can use the [[User_Guide/FindFile|FindFile]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[User_Guide/Real_Time_Analyser|Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[User Guide/Waveform and Segmentation Viewer|Waveform and Segmentation Viewer]] - useful for segmenting signals&lt;br /&gt;
* [[User Guide/Spectrogram and Parameter Viewer|Spectrogram and Parameter Viewer]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[User Guide/Spectrum Viewer|Spectrum Viewer]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[User Guide/Recorder|Recorder]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[User Guide/Command-Line Parameters|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[/Tutorials/|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9566</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9566"/>
		<updated>2017-11-20T17:40:59Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Command-Line Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[User_Guide/Workspace|Workspace]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[User_Guide/Project|project]] file. You can use the [[User_Guide/FindFile|FindFile]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[User_Guide/Real_Time_Analyser|Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[User Guide/Waveform and Segmentation Viewer|Waveform and Segmentation Viewer]] - useful for segmenting signals&lt;br /&gt;
* [[User Guide/Spectrogram and Parameter Viewer|Spectrogram and Parameter Viewer]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[User Guide/Spectrum Viewer|Spectrum Viewer]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[User Guide/Recorder|Recorder]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[User Guide/Command-Line Parameters/|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[/Tutorials/|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9565</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9565"/>
		<updated>2017-11-20T17:40:24Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[User_Guide/Workspace|Workspace]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[User_Guide/Project|project]] file. You can use the [[User_Guide/FindFile|FindFile]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[User_Guide/Real_Time_Analyser|Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[User Guide/Waveform and Segmentation Viewer|Waveform and Segmentation Viewer]] - useful for segmenting signals&lt;br /&gt;
* [[User Guide/Spectrogram and Parameter Viewer|Spectrogram and Parameter Viewer]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[User Guide/Spectrum Viewer|Spectrum Viewer]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[User Guide/Recorder|Recorder]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[/Command-Line Parameters/|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[/Tutorials/|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9564</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9564"/>
		<updated>2017-11-20T17:39:32Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[User_Guide/Workspace|Workspace]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[User_Guide/Project|project]] file. You can use the [[User_Guide/FindFile|FindFile]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[User_Guide/Real_Time_Analyser|Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[User Guide/Waveform and Segmentation Viewer|Waveform and Segmentation Viewer]] - useful for segmenting signals&lt;br /&gt;
* [[User Guide/Spectrogram and Parameter Viewer|Spectrogram and Parameter Viewer]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[User Guide/Spectrum Viewer]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[/Recorder/]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[/Command-Line Parameters/|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[/Tutorials/|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Category:User_Guide&amp;diff=9563</id>
		<title>Category:User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Category:User_Guide&amp;diff=9563"/>
		<updated>2017-11-20T17:37:37Z</updated>

		<summary type="html">&lt;p&gt;Christian: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9562</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9562"/>
		<updated>2017-11-20T17:32:56Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[User_Guide/Workspace|Workspace]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[User_Guide/Project|project]] file. You can use the [[User_Guide/FindFile|FindFile]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[User_Guide/Real_Time_Analyser|Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[User Guide/Waveform and Segmentation Viewer]] - useful for segmenting signals&lt;br /&gt;
* [[User Guide/Spectrogram and Parameter Viewer]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[User Guide/Spectrum Viewer]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[/Recorder/]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[/Command-Line Parameters/|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[/Tutorials/|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9561</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9561"/>
		<updated>2017-11-20T17:32:30Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[User_Guide/Workspace/]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[User_Guide/Project/|project]] file. You can use the [[User_Guide/FindFile/]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[User_Guide/Real_Time_Analyser|Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[User Guide/Waveform and Segmentation Viewer]] - useful for segmenting signals&lt;br /&gt;
* [[User Guide/Spectrogram and Parameter Viewer]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[User Guide/Spectrum Viewer]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[/Recorder/]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[/Command-Line Parameters/|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[/Tutorials/|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9560</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9560"/>
		<updated>2017-11-20T17:32:00Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[/Workspace/]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[/Project/|project]] file. You can use the [[/FindFile/]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[User_Guide/Real_Time_Analyser|Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[User Guide/Waveform and Segmentation Viewer]] - useful for segmenting signals&lt;br /&gt;
* [[User Guide/Spectrogram and Parameter Viewer]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[User Guide/Spectrum Viewer]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[/Recorder/]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[/Command-Line Parameters/|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[/Tutorials/|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9559</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9559"/>
		<updated>2017-11-20T17:31:24Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[/Workspace/]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[/Project/|project]] file. You can use the [[/FindFile/]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[User Guide/Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[User Guide/Waveform and Segmentation Viewer]] - useful for segmenting signals&lt;br /&gt;
* [[User Guide/Spectrogram and Parameter Viewer]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[User Guide/Spectrum Viewer]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[/Recorder/]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[/Command-Line Parameters/|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[/Tutorials/|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9558</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9558"/>
		<updated>2017-11-20T17:30:37Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[/Workspace/]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[/Project/|project]] file. You can use the [[/FindFile/]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[/Waveform and Segmentation Viewer/]] - useful for segmenting signals&lt;br /&gt;
* [[/Spectrogram and Parameter Viewer/]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[/Spectrum Viewer/]] - average the spectra of a signal segment.&lt;br /&gt;
* [[User Guide/Transcription Script|SPExL]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[/Recorder/]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[/Command-Line Parameters/|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[/Tutorials/|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9557</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=9557"/>
		<updated>2017-11-20T15:24:48Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
{{User Guide}}&lt;br /&gt;
==Organise your sound files==&lt;br /&gt;
&lt;br /&gt;
{{STX}} can play, analyse, annotate and modify wave files. The main application - the [[/Workspace/]] - is where you load your sound files and start your analysis from. Your sound files are organised in a [[/Project/|project]] file. You can use the [[/FindFile/]] application to search for wave files on disk and import them into {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Analyse a Signal==&lt;br /&gt;
&lt;br /&gt;
There are a number of applications for analysing signals in {{STX}}. &lt;br /&gt;
&lt;br /&gt;
* [[Real-Time Analyser]] - analyse the current sound input as a spectrum, wave or spectrogram graph&lt;br /&gt;
* [[/Waveform and Segmentation Viewer/]] - useful for segmenting signals&lt;br /&gt;
* [[/Spectrogram and Parameter Viewer/]] - calculate, edit and extract parameters from the signal. Segmentation is also easy here.&lt;br /&gt;
* [[/Spectrum Viewer/]] - average the spectra of a signal segment.&lt;br /&gt;
* [[/SPExL/]] - an application specifically designed for segmentation.&lt;br /&gt;
&lt;br /&gt;
==Record a Signal==&lt;br /&gt;
&lt;br /&gt;
The [[/Recorder/]] can be used to save an input stream to disk and whilst segmenting it on the fly.&lt;br /&gt;
&lt;br /&gt;
==Command-Line Parameters==&lt;br /&gt;
&lt;br /&gt;
There is a minimal set of [[/Command-Line Parameters/|command line parameters]] which can be passed to {{STX}}.&lt;br /&gt;
&lt;br /&gt;
==Tutorials==&lt;br /&gt;
&lt;br /&gt;
There are a few tutorials available [[/Tutorials/|here]].&lt;br /&gt;
&lt;br /&gt;
==Scripts, Development, and Extending {{STX}}==&lt;br /&gt;
&lt;br /&gt;
{{STX}} comes with a number of [[/Pre-installed scripts|pre-installed scripts]] - applications written in the {{STX}} scripting language, and loaded and run from a text file. You can write your own {{STX}} scripts, [[/Toolbox/|toolboxes]] and applications. All the functionality that you find in {{STX}} is available to you in the script language. The [[/The_Script_Controller|script controller]] dialog, the [[/STX_Console|command line console]], the integrated [[/Debugger/|debugger]] and the [[Programmer Guide]] will help you.&lt;br /&gt;
&lt;br /&gt;
==The Log Window==&lt;br /&gt;
The little window up on the left hand corner of the screen is the {{STX}} [[/Log Window/]]. You can start a number of applications from here, change some general {{STX}} settings, and view the log messages.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library/Kernal/StdLib&amp;diff=7115</id>
		<title>Programmer Guide/Macro Library/Kernal/StdLib</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library/Kernal/StdLib&amp;diff=7115"/>
		<updated>2014-05-19T13:01:47Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}__NOTOC__&lt;br /&gt;
;File: STDLIB.STX, linked to library STX.LIB&lt;br /&gt;
;Title: {{STX}} main library&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
:{|class=&amp;quot;keinrahmen&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;application management&#039;&#039;&#039; || &amp;amp;rarr;&lt;br /&gt;
|[[#AppLoad|AppLoad]] &amp;amp;middot; [[#AppMain|AppMain]] &amp;amp;middot; [[#AppCleanup|AppCleanup]] &amp;amp;middot; [[#AppHelp|AppHelp]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;message handling&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#PostMessage|PostMessage]] &amp;amp;middot; [[#SetMsgHandler|SetMsgHandler]] &amp;amp;middot; [[#DispatchMsg|DispatchMsg]] &amp;amp;middot; [[#MsgQueue|MsgQueue]] &amp;amp;middot; [[#MsgFilter|MsgFilter]] &amp;amp;middot; [[#GetMessage|GetMessage]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;utilities for standard&amp;lt;BR&amp;gt;{{STX}} applications&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#ExtSetup|ExtSetup]] &amp;amp;middot; [[#PlayCursor|PlayCursor]] &amp;amp;middot; [[#GenerateScaleParams|GenerateScaleParams]] &amp;amp;middot; [[#MetaSegment|MetaSegment]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;file functions&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#stxFileTypeList|stxFileTypeList]] &amp;amp;middot; [[#stxFileType|stxFileType]] &amp;amp;middot; [[#SectionFile|SectionFile]] &amp;amp;middot; [[#FileToolBox|FileToolBox]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;display functions&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#LogWindow|LogWindow]] &amp;amp;middot; [[#ConLog|ConLog]] &amp;amp;middot; [[#UM and EM|UM and EM]] &amp;amp;middot; [[#ShowItem|ShowItem]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;dialog and window functions&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#CreateMenu|CreateMenu]] &amp;amp;middot; [[#DoModalDialog|DoModalDialog]] &amp;amp;middot; [[#SetModalWindow|SetModalWindow]] &amp;amp;middot; [[#GetWindowPos|GetWindowPos]] &amp;amp;middot; [[#SetWindowPos|SetWindowPos]] &amp;amp;middot; [[#WindowSizeDlg|WindowSizeDlg]] &amp;amp;middot; [[#GetMonitor|GetMonitor]] &amp;amp;middot; [[#GetDesktop|GetDesktop]] &amp;amp;middot; [[#ProgressBox|ProgressBox]] &amp;amp;middot; [[#InitDialogItem|InitDialogItem]] &amp;amp;middot; [[#SetControlMode|SetControlMode]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPU]] and [[Programmer_Guide/Shell_Items/Graph|graph]] functions&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#SetGraphXScale|SetGraphXScale]] &amp;amp;middot; [[#GetOutputValue|GetOutputValue]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPUs]]&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#XScaleLinear|XScaleLinear]] &amp;amp;middot; [[#XScaleBark|XScaleBark]] &amp;amp;middot; [[#Table2Output|Table2Output]] &amp;amp;middot; [[#Wave2output|Wave2output]]&lt;br /&gt;
|}&lt;br /&gt;
;Variables and items used by this library:&lt;br /&gt;
:{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!name !!type !!description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==AppLoad==&lt;br /&gt;
===&amp;lt;code&amp;gt;APPLOAD &amp;lt;var&amp;gt;appname&amp;lt;/var&amp;gt; [ ; &amp;lt;var&amp;gt;appargs&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Load and run a registered {{STX}} application.&lt;br /&gt;
{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!argument !!description !!default&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;appname&amp;lt;/var&amp;gt;&lt;br /&gt;
|Name of a registered {{STX}} application.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;appargs&amp;lt;/var&amp;gt;&lt;br /&gt;
|Arguments for the application.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!RESULT !!description&lt;br /&gt;
|-&lt;br /&gt;
|void ||This macro has no return value.&lt;br /&gt;
|}&lt;br /&gt;
;Examples:&lt;br /&gt;
*Start the realtime analyser: &amp;lt;code&amp;gt;appload rtanalyse&amp;lt;/code&amp;gt;&lt;br /&gt;
*Start a script: &amp;lt;code&amp;gt;appload bscript run ; $@root\scripts\myscript.sts ; mymacro ; arg1 arg2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AppMain==&lt;br /&gt;
This is the {{STX}} application main macro. It is called by the application management system to initialize, run and finish {{STX}} applications. This macro can not be called from other macros.&lt;br /&gt;
&lt;br /&gt;
To end an application and return directly to &amp;lt;code&amp;gt;APPMAIN&amp;lt;/code&amp;gt; the command &amp;lt;code&amp;gt;EXIT -1&amp;lt;/code&amp;gt; can be used.&lt;br /&gt;
&lt;br /&gt;
;Note: At the end of an application, the sourcecode is unloaded. To avoid unloading the variable &amp;lt;code&amp;gt;AppNoUnload&amp;lt;/code&amp;gt; must be set to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; before returning to &amp;lt;code&amp;gt;APPMAIN&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==AppCleanup==&lt;br /&gt;
This macro is called by &amp;lt;code&amp;gt;APPMAIN&amp;lt;/code&amp;gt; to cleanup shell items. It deletes all shell items created by an application. It can also be called from the application to remove all shell items (&amp;lt;code&amp;gt;APPCLEANUP ALL&amp;lt;/code&amp;gt;) or spu-items only (&amp;lt;code&amp;gt;APPCLEANUP SPU&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==AppHelp==&lt;br /&gt;
This macro implements an interface to the online-help for {{STX}}. &lt;br /&gt;
It is currently &#039;&#039;&#039;under development&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==PostMessage==&lt;br /&gt;
===&amp;lt;code&amp;gt;POSTMESSAGE &amp;lt;var&amp;gt;shellid msgid&amp;lt;/var&amp;gt; [ &amp;lt;var&amp;gt;msgpar&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Post a message to a shell. The meaning of the message depends on the target shell. The target shell must implement message handling for shell messages.&lt;br /&gt;
{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!argument !!description !!default&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;shellid&amp;lt;/var&amp;gt;&lt;br /&gt;
|Unique id of the target shell.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;msgid&amp;lt;/var&amp;gt;&lt;br /&gt;
|The message id.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;msgpar&amp;lt;/var&amp;gt;&lt;br /&gt;
|The optional message parameter(s).&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!RESULT !!description&lt;br /&gt;
|-&lt;br /&gt;
|0 ||success&lt;br /&gt;
|-&lt;br /&gt;
|1 ||failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following special values can be used for the argument &amp;lt;var&amp;gt;shellid&amp;lt;/var&amp;gt; to the specify the target shell(s):&lt;br /&gt;
*&amp;lt;code&amp;gt;CALLER&amp;lt;/code&amp;gt; &amp;amp;rarr; the caller of the application&lt;br /&gt;
*&amp;lt;code&amp;gt;MASTER&amp;lt;/code&amp;gt; &amp;amp;rarr; the {{STX}} master shell&lt;br /&gt;
*&amp;lt;code&amp;gt;SELF&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;THIS&amp;lt;/code&amp;gt; &amp;amp;rarr; the shell itself&lt;br /&gt;
*&amp;lt;code&amp;gt;ALL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; &amp;amp;rarr; all running shells except the sender&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The id of the &#039;&#039;current shell&#039;&#039; and the &#039;&#039;calling shell&#039;&#039; are stored in the variable &amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;SHELL = &amp;lt;var&amp;gt;current_shell_id calling_shell_id&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The shell id is 8 digit hex number.&lt;br /&gt;
&lt;br /&gt;
;See also: command [[Programmer_Guide/Command_Reference/MESSAGE|MESSAGE]]&lt;br /&gt;
&lt;br /&gt;
==SetMsgHandler==&lt;br /&gt;
===&amp;lt;code&amp;gt;SETMSGHANDLER &amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;handler&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Install the message handler &amp;lt;var&amp;gt;handler&amp;lt;/var&amp;gt; for messages from &amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt;.&lt;br /&gt;
===&amp;lt;code&amp;gt;SETMSGHANDLER &amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Remove the message handler for messages from &amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt;.&lt;br /&gt;
{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!argument !!description !!default&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt;&lt;br /&gt;
|A typen of a [[Programmer_Guide/Shell_Items|shell item]] or the keyword &amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt; (see [[#PostMessage|PostMessage]]).&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;&lt;br /&gt;
|The name of the shell item or the id of the shell. The character &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; can be used to catch the messages of all shell items of the specified type or of all shells.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;handler&amp;lt;/var&amp;gt;&lt;br /&gt;
|The message handler:&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; &amp;amp;rarr; messages are passed to the macro &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;var&amp;gt;function instance&amp;lt;/var&amp;gt; &amp;amp;rarr; messages are passed to the memberfunction &amp;lt;var&amp;gt;function&amp;lt;/var&amp;gt; of the instance-item &amp;lt;var&amp;gt;instance&amp;lt;/var&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;IGNORE&amp;lt;/code&amp;gt; &amp;amp;rarr; the messages are ignored (not processed)&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RETURN&amp;lt;/code&amp;gt; &amp;amp;rarr; the messages are returned to the message loop&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;KILLSPUONSTOP&amp;lt;/code&amp;gt; &amp;amp;rarr; the sending spu-item is finished and deleted when the &amp;lt;code&amp;gt;STOP&amp;lt;/code&amp;gt; message is received&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;KILLSPUONEXIT&amp;lt;/code&amp;gt; &amp;amp;rarr; the sending spu-item is deleted when the &amp;lt;code&amp;gt;EXIT&amp;lt;/code&amp;gt; message is received&amp;lt;BR&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!RESULT !!description&lt;br /&gt;
|-&lt;br /&gt;
|void ||no return value&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;Notes&lt;br /&gt;
*A message handler function receives the whole message &amp;lt;code&amp;gt;type name msgid msgpar&amp;lt;/code&amp;gt; as argument string.&lt;br /&gt;
*If type equals &amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;, the built-in message handler functions KILLSPUONSTOP and KILLSPUONEXIT can be used for argument handler. Both functions delete the spu-item when receiving the STOP/EXIT message from the spu.&lt;br /&gt;
*If a message handler is installed for &amp;lt;code&amp;gt;type name&amp;lt;/code&amp;gt; the macro [[#GetMessage|GETMESSAGE]] calls the handler function (via [[#DispatchMsg|DISPATCHMSG]] when receiving messages from the sender &amp;lt;code&amp;gt;type name&amp;lt;/code&amp;gt;. Messages passed to a handler are not returned to the message loop (except if the keyword &amp;lt;code&amp;gt;RETURN&amp;lt;/code&amp;gt; was used as handler argument).&lt;br /&gt;
*The message dispatching system is only active while the macro [[#GetMessage|GETMESSAGE]] is running!&lt;br /&gt;
*For message handlers in classes the member functions [[Programmer_Guide/Macro_Library/CObj#AttachItem|AttachItem]] and [[Programmer_Guide/Macro_Library/CObj#DetachItem|DetachItem]] should be used.&lt;br /&gt;
&lt;br /&gt;
==DispatchMsg==&lt;br /&gt;
===&amp;lt;code&amp;gt;DISPATCHMSG &amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;msgid&amp;lt;/var&amp;gt; [ &amp;lt;var&amp;gt;msgpar&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Forward the message to the message handler. The macro can be called from message loops or message handlers to forward or translate messages and it is also called by [[#GetMessage|GETMESSAGE]] to perform standard message handling.&lt;br /&gt;
{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!argument !!description !!default&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt;&lt;br /&gt;
|The type of the sender.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;&lt;br /&gt;
|The name of the sender.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;msgid&amp;lt;/var&amp;gt;&lt;br /&gt;
|The message id (depends on sender).&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;msgpar&amp;lt;/var&amp;gt;&lt;br /&gt;
|The message parameter(s). (depends on sender and &amp;lt;var&amp;gt;msgid&amp;lt;/var&amp;gt;)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!RESULT !!description&lt;br /&gt;
|-&lt;br /&gt;
|1 ||The message was processed by the message handler.&lt;br /&gt;
|0 ||The message was &#039;&#039;&#039;not&#039;&#039;&#039; processed by the message handler or, no message handler is installed for &amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==MsgQueue==&lt;br /&gt;
===&amp;lt;code&amp;gt;MSGQUEUE &amp;lt;var&amp;gt;type name msgid&amp;lt;/var&amp;gt; [ &amp;lt;var&amp;gt;msgpar&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:This macro stores the message &amp;lt;var&amp;gt;type name msgid msgpar&amp;lt;/var&amp;gt; in a secondary message queue. It can be used in &#039;&#039;sub-message-loops&#039;&#039; (e.g. as used for playback, spu-processing or modal dialogs) to queue messages which can not be processed at the time. &lt;br /&gt;
&lt;br /&gt;
;Note: While messages are queued in the secondary message queue, the argument &amp;lt;var&amp;gt;queued&amp;lt;/var&amp;gt; of the [[#GetMessage|GETMESSAGE]] call must be set to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, to avoid the processing of messages stored in the secondary queue.&lt;br /&gt;
&lt;br /&gt;
==MsgFilter==&lt;br /&gt;
===&amp;lt;code&amp;gt;MSGFILTER &amp;lt;var&amp;gt;type name msgid&amp;lt;/var&amp;gt; [ &amp;lt;var&amp;gt;acopy&amp;lt;/var&amp;gt; ] &amp;lt;/code&amp;gt;===&lt;br /&gt;
:Remove all messages defined by &amp;lt;var&amp;gt;type name msgid&amp;lt;/var&amp;gt; from the internal msg-queues.  If the argument &amp;lt;var&amp;gt;acopy&amp;lt;/var&amp;gt; is the name of a  simple tableitem, it is used to save a copy of the removed messages. The macro returns the number of removed messages.&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
:&amp;lt;code&amp;gt;msgfilter spu * *&amp;lt;/code&amp;gt; &amp;amp;rarr; remove all spu messages&lt;br /&gt;
:&amp;lt;code&amp;gt;msgfilter * &amp;lt;var&amp;gt;itemname&amp;lt;/var&amp;gt; * &amp;lt;var&amp;gt;msgtab&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; remove all messages from the item &amp;lt;var&amp;gt;itemname&amp;lt;/var&amp;gt; from the queue and store them in the simple table &amp;lt;var&amp;gt;msgtab&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetMessage==&lt;br /&gt;
===&amp;lt;code&amp;gt;GETMESSAGE &amp;lt;var&amp;gt;queued noreturn nodispatch&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:This macro retrieves and dispatches messages. If a message handler is installed, the message is forwarded to the handler to perform message processing, otherwise the message is returned to the caller.&lt;br /&gt;
{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!argument !!description !!default&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;queued&amp;lt;/var&amp;gt;&lt;br /&gt;
|process messages from secondary queue (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;=no, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;=yes)&lt;br /&gt;
|&amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;noreturn&amp;lt;/var&amp;gt;&lt;br /&gt;
|do not dispatch messages, return always - even if a message handler is installed (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;=no, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;=yes)&amp;lt;BR&amp;gt;if set to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, all messages are returned&lt;br /&gt;
|&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!RESULT !!description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt; ||The first message not processed by the message handler.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;* * * * *&amp;lt;/code&amp;gt; ||If the application has been finished (variable &amp;lt;code&amp;gt;AppMode&amp;lt;/code&amp;gt; &amp;amp;lt; 1)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*If the argument &amp;lt;var&amp;gt;noreturn&amp;lt;/var&amp;gt; equals 0, all messages which were not processed by a handler, are returned. If it equals 1, all not processed messages are ignored and &amp;lt;code&amp;gt;GETMESSAGE&amp;lt;/code&amp;gt; stays active until the application is finished (variable &amp;lt;code&amp;gt;APPMODE&amp;lt;/code&amp;gt; &amp;amp;lt; 1). Most applications uses the call &amp;lt;code&amp;gt;getmessage 1 1&amp;lt;/code&amp;gt; (process secondary queue, return &#039;&#039;never&#039;&#039;), to implement the main message loop.&lt;br /&gt;
*The argument &amp;lt;var&amp;gt;queued&amp;lt;/var&amp;gt; controls the procesing of messages stored in the secondary queue. This queue is filled with messages which can not be processed at the time. The processing of the secondary queue must be disabled in sub-message loops which queues (unknown) messages by calling the macro [[#MsgQueue|MSGQUEUE]].&lt;br /&gt;
*If the argument &amp;lt;var&amp;gt;nodispatch&amp;lt;/var&amp;gt; is set to 1, message dispatching is disabled and all messages are returned to the caller.&lt;br /&gt;
*Following special variables and items are used:&lt;br /&gt;
**&amp;lt;code&amp;gt;AppMode&amp;lt;/code&amp;gt;: application mode (&amp;amp;lt; 1 &amp;amp;rarr; application finished, &amp;amp;ge; 1 &amp;amp;rarr; application running)&lt;br /&gt;
**&amp;lt;code&amp;gt;@LOGMSG&amp;lt;/code&amp;gt;: controls the {{STX}} log-level; all received messages are logged if &amp;lt;code&amp;gt;@LOGMSG&amp;lt;/code&amp;gt; &amp;amp;ge; 1&lt;br /&gt;
**&amp;lt;code&amp;gt;tMsgQueue&amp;lt;/code&amp;gt;: secondary message queue (a simple table)&lt;br /&gt;
**&amp;lt;code&amp;gt;HWndTab, MWndTab&amp;lt;/code&amp;gt;: simple tables used to manage displays and modal dialogs of the shell&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The script [http://mediawiki.kfs.oeaw.ac.at/stx/script_examples/gui_basic_example.sts gui_basic_example.sts] shows a simple example how message handling can be used in a {{STX}} GUI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;include src=&amp;quot;script_examples/gui_basic_example.sts&amp;quot; highlight=&amp;quot;cpp&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ExtSetup==&lt;br /&gt;
:This macro implements some special settings functions used by the {{STX}} applications.&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP SEGNAME [ &amp;lt;var&amp;gt;aset&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Retrieve the next automatic segment name according to segname-settings and arguments. If an audioset reference &amp;lt;var&amp;gt;aset&amp;lt;/var&amp;gt; is specified, the segment information is used to compute the next possible index. Otherwise the last used index is incremented by 1. The macro returns the generated segment id.&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP SEGNAMEDLG&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Show the settings dialog for automatic segment names.&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP PRINTOUT &amp;lt;var&amp;gt;item&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Print the specified item (graph or display). Returns 0 for success or a numeric error code.&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP PRINTOUT &amp;lt;var&amp;gt;item&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Show the print settings dialog.&lt;br /&gt;
&lt;br /&gt;
==PlayCursor==&lt;br /&gt;
:Implements a set of functions to display a running cursor in one or more graphs during signal playback.&lt;br /&gt;
:Note: This implementation uses the variable &amp;lt;code&amp;gt;PlayCrsPar&amp;lt;/code&amp;gt; and the table &amp;lt;code&amp;gt;PlayCrsTab&amp;lt;/code&amp;gt; to store the settings and state values. Therefore a shell ({{STX}} application or script) can only use one &#039;&#039;instance&#039;&#039; of the &amp;lt;code&amp;gt;PlayCursor&amp;lt;/code&amp;gt;.&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR ADD &amp;lt;var&amp;gt;gitem xmin xmax&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Add the graphitem &amp;lt;var&amp;gt;gitem&amp;lt;/var&amp;gt; to the playcursor graph-list. The arguments &amp;lt;var&amp;gt;xmin&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;xmax&amp;lt;/var&amp;gt; specify the x-range where the playcursor should be visibile in graph &amp;lt;var&amp;gt;gitem&amp;lt;/var&amp;gt;.&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR SET &amp;lt;var&amp;gt;x1 x2 dt t2x&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Set the start- and end-time (&amp;lt;var&amp;gt;x1..x2&amp;lt;/var&amp;gt;, values must be specified in the x-unit of the graphs), the time-increment (&amp;lt;var&amp;gt;dt&amp;lt;/var&amp;gt;, timer step in ms) and the factor &amp;lt;var&amp;gt;t2x&amp;lt;/var&amp;gt; to convert timer-values (ms) to the x-unit of the graphs (e.g. if x-values are specified in seconds t2x must be set to 0.001)&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR ON [ &amp;lt;var&amp;gt;witem&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:If playcursor is &#039;&#039;&#039;inactive&#039;&#039;&#039; &amp;amp;rarr; Start the playcursor and, if &amp;lt;var&amp;gt;witem&amp;lt;/var&amp;gt; is a waveitem, the playback of &amp;lt;var&amp;gt;witem&amp;lt;/var&amp;gt;.&lt;br /&gt;
:If playcursor is &#039;&#039;&#039;active&#039;&#039;&#039; &amp;amp;rarr; If &amp;lt;var&amp;gt;witem&amp;lt;/var&amp;gt; is a waveitem, update the playback gain.&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR OFF&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Stop the playcursor, reset settings and empty the graph-list.&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR GETPOS&amp;lt;/code&amp;gt;===&lt;br /&gt;
:If playcursor is &#039;&#039;&#039;inactive&#039;&#039;&#039; &amp;amp;rarr; Return always 0.&lt;br /&gt;
:If playcursor is &#039;&#039;&#039;active&#039;&#039;&#039; &amp;amp;rarr; Return the current x-position of the playcursor.&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR VALUE ...&amp;lt;/code&amp;gt;===&lt;br /&gt;
:This is the message handler entry for the timer (valueitem) which is used by the playcursor functions. This entry should not be called directly (only via the message handling system).&lt;br /&gt;
&lt;br /&gt;
==GenerateScaleParams==&lt;br /&gt;
===&amp;lt;code&amp;gt;GENERATESCALEPARAMS &amp;lt;var&amp;gt;&amp;lt;var&amp;gt;min max&amp;lt;/var&amp;gt; ; [&amp;lt;var&amp;gt;unit&amp;lt;/var&amp;gt;=s] ; [&amp;lt;var&amp;gt;format&amp;lt;/var&amp;gt;=clock] ; [&amp;lt;var&amp;gt;nlabels&amp;lt;/var&amp;gt;=6] ;  [&amp;lt;var&amp;gt;nminor&amp;lt;/var&amp;gt;=3] ;  [&amp;lt;var&amp;gt;srate&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Generate the paramaters for the &amp;lt;code&amp;gt;SET graph XSCALE ...&amp;lt;/code&amp;gt; command which is used to assign the time-scale settings of the viewer-graphs.&lt;br /&gt;
::{|class=&amp;quot;keinrahmen&amp;quot;&lt;br /&gt;
|&amp;lt;var&amp;gt;min max&amp;lt;/var&amp;gt; || ||The minimum and maximum x-value.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;unit&amp;lt;/var&amp;gt; || ||The unit of the minimum and maximum x-value; either seconds (&amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;) or milliseconds (&amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;format&amp;lt;/var&amp;gt; || ||The scale label format (&amp;lt;code&amp;gt;clock|s|ms|samples&amp;lt;/code&amp;gt;). Note that the &amp;lt;var&amp;gt;unitStr&amp;lt;/var&amp;gt; parameter is returned for the formats &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt;, but not for &amp;lt;code&amp;gt;clock&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;samples&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;nlabels&amp;lt;/var&amp;gt; || ||Number of labels; must be &amp;amp;ge; 2&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;nminor&amp;lt;/var&amp;gt; || ||Number of minor ticks; must be &amp;amp;ge; 2&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;srate&amp;lt;/var&amp;gt; || || The signal sampling rate in &amp;lt;code&amp;gt;Hz&amp;lt;/code&amp;gt;. This argument is required only for the &amp;lt;var&amp;gt;format&amp;lt;/var&amp;gt; &amp;lt;code&amp;gt;samples&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
:The function returns the string &amp;lt;code&amp;gt;minval maxval unitstr formatStr&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;minval maxval unitstr labelTab&amp;lt;/code&amp;gt; for success and the error code &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; if the scale parameter generation fails. The result can be directly used to assign the x-scale settings: &amp;lt;SET&amp;gt;SET graph XSCALE $RESULT&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==MetaSegment==&lt;br /&gt;
This macro implements a set of functions to display, edit and manage the meta-segments (segment marker) in the applications &amp;lt;code&amp;gt;VIEWER1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;VIEWER2&amp;lt;/code&amp;gt;. It is very deep connected with the internals of the viewer applications and should not be used for other purposes.&lt;br /&gt;
&lt;br /&gt;
==stxFileTypeList==&lt;br /&gt;
===&amp;lt;code&amp;gt;STXFILETYPELIST Workspace|Project|SMDF|Segments|Wave|Script|Export&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Returns the semi-colon seperated list of filename-extensions for the selected type. The result can be used to pass filetype-arguments to the [[../BUTIL#FileDialog|BUTIL FileDialog functions]].&lt;br /&gt;
:Example: The macro call &amp;lt;code&amp;gt;stxfiletypelist smdf&amp;lt;/code&amp;gt; returns the string &amp;lt;code&amp;gt;stxsm=STX Segment Metadata; xml=STX Segment Metadata (old)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==stxFileType==&lt;br /&gt;
===&amp;lt;code&amp;gt;STXFILETYPE Workspace|Project|SMDF|Segments|Wave|Script|Export&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Returns the default filename-extensions for the selected type.&lt;br /&gt;
:Example: The macro call &amp;lt;code&amp;gt;stxfiletype smdf&amp;lt;/code&amp;gt; returns the string &amp;lt;code&amp;gt;stxsm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==SectionFile==&lt;br /&gt;
===&amp;lt;code&amp;gt;SECTIONFILE &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt; ; &amp;lt;var&amp;gt;todo table type name&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:[[Programmer_Guide/Shell_Items/File/NEW_FILE#Section_Files|Section file]] handling. In {{STX}} files in the INI-file format are called section-files. All source files (scripts, macros, ..) and some data files are stored in this format. &lt;br /&gt;
:Note: A file processed with this macro may contain pre-processor commands, continuation-lines and comments.&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;var&amp;gt;todo&amp;lt;/var&amp;gt;=&amp;lt;code&amp;gt;LOAD&amp;lt;/code&amp;gt;: Load the content of section &amp;lt;code&amp;gt;[&amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt; or section &amp;lt;code&amp;gt;[&amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt; from file &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt; into &amp;lt;var&amp;gt;table&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;table&amp;lt;/var&amp;gt; is set to &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; a new table is created.&lt;br /&gt;
::Result: The table containing the loaded data (success) or an empty string (error)&lt;br /&gt;
:;&amp;lt;var&amp;gt;todo&amp;lt;/var&amp;gt;=&amp;lt;code&amp;gt;LIST&amp;lt;/code&amp;gt;: List all sections (&amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt; not specified) or matching sections defined in file &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;table&amp;lt;/var&amp;gt; is set to &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; a new table is created.&lt;br /&gt;
::Result: The table containing the section-list (success) or an empty string (error)&lt;br /&gt;
:;&amp;lt;var&amp;gt;todo&amp;lt;/var&amp;gt;=&amp;lt;code&amp;gt;SAVE&amp;lt;/code&amp;gt;: Save the &amp;lt;var&amp;gt;table&amp;lt;/var&amp;gt; in the section &amp;lt;code&amp;gt;[&amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt; or section &amp;lt;code&amp;gt;[&amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt; of file &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt;. If the section exists already its content is replaced by the new data. If &amp;lt;var&amp;gt;table&amp;lt;/var&amp;gt; is set to &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; the section is &#039;&#039;&#039;deleted&#039;&#039;&#039;.&lt;br /&gt;
::Result: Always an empty string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==FileToolBox==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==LogWindow==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ConLog==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==UM and EM==&lt;br /&gt;
===&amp;lt;code&amp;gt;UM &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt; [; &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:User Message &amp;amp;rarr; Display &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt; in a message box with the caption &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt;. This macro is an alias for &amp;lt;code&amp;gt;BUTIL MSGBOX MSG ; &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt; ; &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The return value is always 0.&lt;br /&gt;
===&amp;lt;code&amp;gt;EM [ &amp;lt;var&amp;gt;rc&amp;lt;/var&amp;gt; [ &amp;lt;var&amp;gt;n&amp;lt;/var&amp;gt; ]] ; &amp;lt;var&amp;gt;emsg&amp;lt;/var&amp;gt; [; &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Error Message &amp;amp;rarr; Display the text &amp;quot;&amp;lt;code&amp;gt;ERROR (&amp;lt;var&amp;gt;rc&amp;lt;/var&amp;gt;): &amp;lt;var&amp;gt;emsg&amp;lt;/var&amp;gt; &amp;lt;/code&amp;gt;&amp;quot; in a message box with the caption &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt;. The macro exits from &amp;lt;var&amp;gt;n&amp;lt;/var&amp;gt; (default: 2 = exit from caller) and returns the value &amp;lt;var&amp;gt;rc&amp;lt;/var&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==ShowItem==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CreateMenu==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DoModalDialog==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SetModalDialog==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GetWindowPos==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SetWindowPos==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==WindowSizeDlg==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GetMonitor==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GetDesktop==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ProgressBox==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==InitDialogItem==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SetControlMode==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SetGraphXScale==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GetOutputValue==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==XScaleLinear==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==XScaleBark==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Table2Output==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Wave2Output==&lt;br /&gt;
===&amp;lt;code&amp;gt;[SPU WAVE2OUTPUT &amp;lt;var&amp;gt;waveitem&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;length&amp;lt;/var&amp;gt;=10000 &amp;lt;var&amp;gt;factor&amp;lt;/var&amp;gt;=1 OUT x1 ... x8 sr n]&amp;lt;/code&amp;gt;===&lt;br /&gt;
Uses the sp-atom [[Programmer_Guide/SPU_Reference/ASIGIN|asigin]] to read signal-blocks of the specified &amp;lt;var&amp;gt;length&amp;lt;/var&amp;gt; (in samples) from the &amp;lt;var&amp;gt;waveitem&amp;lt;/var&amp;gt;.&lt;br /&gt;
;&amp;lt;var&amp;gt;waveitem&amp;lt;/var&amp;gt;: name of the source waveitem&lt;br /&gt;
;&amp;lt;var&amp;gt;length&amp;lt;/var&amp;gt;: block length in samples&lt;br /&gt;
;&amp;lt;var&amp;gt;factor&amp;lt;/var&amp;gt;: linear amplification factor&lt;br /&gt;
;&amp;lt;code&amp;gt;x1, x2, ..&amp;lt;/code&amp;gt;: signal vector containing signal of channel 1, 2, ...&lt;br /&gt;
;&amp;lt;code&amp;gt;sr&amp;lt;/code&amp;gt;: samping rate of &amp;lt;var&amp;gt;waveitem&amp;lt;/var&amp;gt; in Hz&lt;br /&gt;
;&amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;: number of blocks&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library/Kernal/StdLib&amp;diff=7114</id>
		<title>Programmer Guide/Macro Library/Kernal/StdLib</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Macro_Library/Kernal/StdLib&amp;diff=7114"/>
		<updated>2014-05-19T13:00:41Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}__NOTOC__&lt;br /&gt;
*&#039;&#039;&#039;File&#039;&#039;&#039;: STDLIB.STX, linked to library STX.LIB&lt;br /&gt;
*&#039;&#039;&#039;Title&#039;&#039;&#039;: {{STX}} main library&lt;br /&gt;
----&lt;br /&gt;
;Content:&lt;br /&gt;
:{|class=&amp;quot;keinrahmen&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;application management&#039;&#039;&#039; || &amp;amp;rarr;&lt;br /&gt;
|[[#AppLoad|AppLoad]] &amp;amp;middot; [[#AppMain|AppMain]] &amp;amp;middot; [[#AppCleanup|AppCleanup]] &amp;amp;middot; [[#AppHelp|AppHelp]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;message handling&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#PostMessage|PostMessage]] &amp;amp;middot; [[#SetMsgHandler|SetMsgHandler]] &amp;amp;middot; [[#DispatchMsg|DispatchMsg]] &amp;amp;middot; [[#MsgQueue|MsgQueue]] &amp;amp;middot; [[#MsgFilter|MsgFilter]] &amp;amp;middot; [[#GetMessage|GetMessage]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;utilities for standard&amp;lt;BR&amp;gt;{{STX}} applications&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#ExtSetup|ExtSetup]] &amp;amp;middot; [[#PlayCursor|PlayCursor]] &amp;amp;middot; [[#GenerateScaleParams|GenerateScaleParams]] &amp;amp;middot; [[#MetaSegment|MetaSegment]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;file functions&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#stxFileTypeList|stxFileTypeList]] &amp;amp;middot; [[#stxFileType|stxFileType]] &amp;amp;middot; [[#SectionFile|SectionFile]] &amp;amp;middot; [[#FileToolBox|FileToolBox]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;display functions&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#LogWindow|LogWindow]] &amp;amp;middot; [[#ConLog|ConLog]] &amp;amp;middot; [[#UM and EM|UM and EM]] &amp;amp;middot; [[#ShowItem|ShowItem]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;dialog and window functions&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#CreateMenu|CreateMenu]] &amp;amp;middot; [[#DoModalDialog|DoModalDialog]] &amp;amp;middot; [[#SetModalWindow|SetModalWindow]] &amp;amp;middot; [[#GetWindowPos|GetWindowPos]] &amp;amp;middot; [[#SetWindowPos|SetWindowPos]] &amp;amp;middot; [[#WindowSizeDlg|WindowSizeDlg]] &amp;amp;middot; [[#GetMonitor|GetMonitor]] &amp;amp;middot; [[#GetDesktop|GetDesktop]] &amp;amp;middot; [[#ProgressBox|ProgressBox]] &amp;amp;middot; [[#InitDialogItem|InitDialogItem]] &amp;amp;middot; [[#SetControlMode|SetControlMode]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPU]] and [[Programmer_Guide/Shell_Items/Graph|graph]] functions&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#SetGraphXScale|SetGraphXScale]] &amp;amp;middot; [[#GetOutputValue|GetOutputValue]]&lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;mdash;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;[[Programmer_Guide/Shell_Items/SPU|SPUs]]&#039;&#039;&#039; ||&amp;amp;rarr;&lt;br /&gt;
|[[#XScaleLinear|XScaleLinear]] &amp;amp;middot; [[#XScaleBark|XScaleBark]] &amp;amp;middot; [[#Table2Output|Table2Output]] &amp;amp;middot; [[#Wave2output|Wave2output]]&lt;br /&gt;
|}&lt;br /&gt;
;Variables and items used by this library:&lt;br /&gt;
:{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!name !!type !!description&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==AppLoad==&lt;br /&gt;
===&amp;lt;code&amp;gt;APPLOAD &amp;lt;var&amp;gt;appname&amp;lt;/var&amp;gt; [ ; &amp;lt;var&amp;gt;appargs&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Load and run a registered {{STX}} application.&lt;br /&gt;
{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!argument !!description !!default&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;appname&amp;lt;/var&amp;gt;&lt;br /&gt;
|Name of a registered {{STX}} application.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;appargs&amp;lt;/var&amp;gt;&lt;br /&gt;
|Arguments for the application.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!RESULT !!description&lt;br /&gt;
|-&lt;br /&gt;
|void ||This macro has no return value.&lt;br /&gt;
|}&lt;br /&gt;
;Examples:&lt;br /&gt;
*Start the realtime analyser: &amp;lt;code&amp;gt;appload rtanalyse&amp;lt;/code&amp;gt;&lt;br /&gt;
*Start a script: &amp;lt;code&amp;gt;appload bscript run ; $@root\scripts\myscript.sts ; mymacro ; arg1 arg2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==AppMain==&lt;br /&gt;
This is the {{STX}} application main macro. It is called by the application management system to initialize, run and finish {{STX}} applications. This macro can not be called from other macros.&lt;br /&gt;
&lt;br /&gt;
To end an application and return directly to &amp;lt;code&amp;gt;APPMAIN&amp;lt;/code&amp;gt; the command &amp;lt;code&amp;gt;EXIT -1&amp;lt;/code&amp;gt; can be used.&lt;br /&gt;
&lt;br /&gt;
;Note: At the end of an application, the sourcecode is unloaded. To avoid unloading the variable &amp;lt;code&amp;gt;AppNoUnload&amp;lt;/code&amp;gt; must be set to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; before returning to &amp;lt;code&amp;gt;APPMAIN&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==AppCleanup==&lt;br /&gt;
This macro is called by &amp;lt;code&amp;gt;APPMAIN&amp;lt;/code&amp;gt; to cleanup shell items. It deletes all shell items created by an application. It can also be called from the application to remove all shell items (&amp;lt;code&amp;gt;APPCLEANUP ALL&amp;lt;/code&amp;gt;) or spu-items only (&amp;lt;code&amp;gt;APPCLEANUP SPU&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==AppHelp==&lt;br /&gt;
This macro implements an interface to the online-help for {{STX}}. &lt;br /&gt;
It is currently &#039;&#039;&#039;under development&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==PostMessage==&lt;br /&gt;
===&amp;lt;code&amp;gt;POSTMESSAGE &amp;lt;var&amp;gt;shellid msgid&amp;lt;/var&amp;gt; [ &amp;lt;var&amp;gt;msgpar&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Post a message to a shell. The meaning of the message depends on the target shell. The target shell must implement message handling for shell messages.&lt;br /&gt;
{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!argument !!description !!default&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;shellid&amp;lt;/var&amp;gt;&lt;br /&gt;
|Unique id of the target shell.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;msgid&amp;lt;/var&amp;gt;&lt;br /&gt;
|The message id.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;msgpar&amp;lt;/var&amp;gt;&lt;br /&gt;
|The optional message parameter(s).&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!RESULT !!description&lt;br /&gt;
|-&lt;br /&gt;
|0 ||success&lt;br /&gt;
|-&lt;br /&gt;
|1 ||failed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following special values can be used for the argument &amp;lt;var&amp;gt;shellid&amp;lt;/var&amp;gt; to the specify the target shell(s):&lt;br /&gt;
*&amp;lt;code&amp;gt;CALLER&amp;lt;/code&amp;gt; &amp;amp;rarr; the caller of the application&lt;br /&gt;
*&amp;lt;code&amp;gt;MASTER&amp;lt;/code&amp;gt; &amp;amp;rarr; the {{STX}} master shell&lt;br /&gt;
*&amp;lt;code&amp;gt;SELF&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;THIS&amp;lt;/code&amp;gt; &amp;amp;rarr; the shell itself&lt;br /&gt;
*&amp;lt;code&amp;gt;ALL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; &amp;amp;rarr; all running shells except the sender&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The id of the &#039;&#039;current shell&#039;&#039; and the &#039;&#039;calling shell&#039;&#039; are stored in the variable &amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;SHELL = &amp;lt;var&amp;gt;current_shell_id calling_shell_id&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The shell id is 8 digit hex number.&lt;br /&gt;
&lt;br /&gt;
;See also: command [[Programmer_Guide/Command_Reference/MESSAGE|MESSAGE]]&lt;br /&gt;
&lt;br /&gt;
==SetMsgHandler==&lt;br /&gt;
===&amp;lt;code&amp;gt;SETMSGHANDLER &amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;handler&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Install the message handler &amp;lt;var&amp;gt;handler&amp;lt;/var&amp;gt; for messages from &amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt;.&lt;br /&gt;
===&amp;lt;code&amp;gt;SETMSGHANDLER &amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Remove the message handler for messages from &amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt;.&lt;br /&gt;
{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!argument !!description !!default&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt;&lt;br /&gt;
|A typen of a [[Programmer_Guide/Shell_Items|shell item]] or the keyword &amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt; (see [[#PostMessage|PostMessage]]).&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;&lt;br /&gt;
|The name of the shell item or the id of the shell. The character &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; can be used to catch the messages of all shell items of the specified type or of all shells.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;handler&amp;lt;/var&amp;gt;&lt;br /&gt;
|The message handler:&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; &amp;amp;rarr; messages are passed to the macro &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;var&amp;gt;function instance&amp;lt;/var&amp;gt; &amp;amp;rarr; messages are passed to the memberfunction &amp;lt;var&amp;gt;function&amp;lt;/var&amp;gt; of the instance-item &amp;lt;var&amp;gt;instance&amp;lt;/var&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;IGNORE&amp;lt;/code&amp;gt; &amp;amp;rarr; the messages are ignored (not processed)&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RETURN&amp;lt;/code&amp;gt; &amp;amp;rarr; the messages are returned to the message loop&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;KILLSPUONSTOP&amp;lt;/code&amp;gt; &amp;amp;rarr; the sending spu-item is finished and deleted when the &amp;lt;code&amp;gt;STOP&amp;lt;/code&amp;gt; message is received&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;KILLSPUONEXIT&amp;lt;/code&amp;gt; &amp;amp;rarr; the sending spu-item is deleted when the &amp;lt;code&amp;gt;EXIT&amp;lt;/code&amp;gt; message is received&amp;lt;BR&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!RESULT !!description&lt;br /&gt;
|-&lt;br /&gt;
|void ||no return value&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;Notes&lt;br /&gt;
*A message handler function receives the whole message &amp;lt;code&amp;gt;type name msgid msgpar&amp;lt;/code&amp;gt; as argument string.&lt;br /&gt;
*If type equals &amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;, the built-in message handler functions KILLSPUONSTOP and KILLSPUONEXIT can be used for argument handler. Both functions delete the spu-item when receiving the STOP/EXIT message from the spu.&lt;br /&gt;
*If a message handler is installed for &amp;lt;code&amp;gt;type name&amp;lt;/code&amp;gt; the macro [[#GetMessage|GETMESSAGE]] calls the handler function (via [[#DispatchMsg|DISPATCHMSG]] when receiving messages from the sender &amp;lt;code&amp;gt;type name&amp;lt;/code&amp;gt;. Messages passed to a handler are not returned to the message loop (except if the keyword &amp;lt;code&amp;gt;RETURN&amp;lt;/code&amp;gt; was used as handler argument).&lt;br /&gt;
*The message dispatching system is only active while the macro [[#GetMessage|GETMESSAGE]] is running!&lt;br /&gt;
*For message handlers in classes the member functions [[Programmer_Guide/Macro_Library/CObj#AttachItem|AttachItem]] and [[Programmer_Guide/Macro_Library/CObj#DetachItem|DetachItem]] should be used.&lt;br /&gt;
&lt;br /&gt;
==DispatchMsg==&lt;br /&gt;
===&amp;lt;code&amp;gt;DISPATCHMSG &amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;msgid&amp;lt;/var&amp;gt; [ &amp;lt;var&amp;gt;msgpar&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Forward the message to the message handler. The macro can be called from message loops or message handlers to forward or translate messages and it is also called by [[#GetMessage|GETMESSAGE]] to perform standard message handling.&lt;br /&gt;
{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!argument !!description !!default&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt;&lt;br /&gt;
|The type of the sender.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;&lt;br /&gt;
|The name of the sender.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;msgid&amp;lt;/var&amp;gt;&lt;br /&gt;
|The message id (depends on sender).&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;msgpar&amp;lt;/var&amp;gt;&lt;br /&gt;
|The message parameter(s). (depends on sender and &amp;lt;var&amp;gt;msgid&amp;lt;/var&amp;gt;)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!RESULT !!description&lt;br /&gt;
|-&lt;br /&gt;
|1 ||The message was processed by the message handler.&lt;br /&gt;
|0 ||The message was &#039;&#039;&#039;not&#039;&#039;&#039; processed by the message handler or, no message handler is installed for &amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==MsgQueue==&lt;br /&gt;
===&amp;lt;code&amp;gt;MSGQUEUE &amp;lt;var&amp;gt;type name msgid&amp;lt;/var&amp;gt; [ &amp;lt;var&amp;gt;msgpar&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:This macro stores the message &amp;lt;var&amp;gt;type name msgid msgpar&amp;lt;/var&amp;gt; in a secondary message queue. It can be used in &#039;&#039;sub-message-loops&#039;&#039; (e.g. as used for playback, spu-processing or modal dialogs) to queue messages which can not be processed at the time. &lt;br /&gt;
&lt;br /&gt;
;Note: While messages are queued in the secondary message queue, the argument &amp;lt;var&amp;gt;queued&amp;lt;/var&amp;gt; of the [[#GetMessage|GETMESSAGE]] call must be set to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, to avoid the processing of messages stored in the secondary queue.&lt;br /&gt;
&lt;br /&gt;
==MsgFilter==&lt;br /&gt;
===&amp;lt;code&amp;gt;MSGFILTER &amp;lt;var&amp;gt;type name msgid&amp;lt;/var&amp;gt; [ &amp;lt;var&amp;gt;acopy&amp;lt;/var&amp;gt; ] &amp;lt;/code&amp;gt;===&lt;br /&gt;
:Remove all messages defined by &amp;lt;var&amp;gt;type name msgid&amp;lt;/var&amp;gt; from the internal msg-queues.  If the argument &amp;lt;var&amp;gt;acopy&amp;lt;/var&amp;gt; is the name of a  simple tableitem, it is used to save a copy of the removed messages. The macro returns the number of removed messages.&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
:&amp;lt;code&amp;gt;msgfilter spu * *&amp;lt;/code&amp;gt; &amp;amp;rarr; remove all spu messages&lt;br /&gt;
:&amp;lt;code&amp;gt;msgfilter * &amp;lt;var&amp;gt;itemname&amp;lt;/var&amp;gt; * &amp;lt;var&amp;gt;msgtab&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; remove all messages from the item &amp;lt;var&amp;gt;itemname&amp;lt;/var&amp;gt; from the queue and store them in the simple table &amp;lt;var&amp;gt;msgtab&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==GetMessage==&lt;br /&gt;
===&amp;lt;code&amp;gt;GETMESSAGE &amp;lt;var&amp;gt;queued noreturn nodispatch&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:This macro retrieves and dispatches messages. If a message handler is installed, the message is forwarded to the handler to perform message processing, otherwise the message is returned to the caller.&lt;br /&gt;
{|class=&amp;quot;einrahmen&amp;quot;&lt;br /&gt;
!argument !!description !!default&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;queued&amp;lt;/var&amp;gt;&lt;br /&gt;
|process messages from secondary queue (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;=no, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;=yes)&lt;br /&gt;
|&amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;noreturn&amp;lt;/var&amp;gt;&lt;br /&gt;
|do not dispatch messages, return always - even if a message handler is installed (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;=no, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;=yes)&amp;lt;BR&amp;gt;if set to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, all messages are returned&lt;br /&gt;
|&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!RESULT !!description&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt; ||The first message not processed by the message handler.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;code&amp;gt;* * * * *&amp;lt;/code&amp;gt; ||If the application has been finished (variable &amp;lt;code&amp;gt;AppMode&amp;lt;/code&amp;gt; &amp;amp;lt; 1)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
*If the argument &amp;lt;var&amp;gt;noreturn&amp;lt;/var&amp;gt; equals 0, all messages which were not processed by a handler, are returned. If it equals 1, all not processed messages are ignored and &amp;lt;code&amp;gt;GETMESSAGE&amp;lt;/code&amp;gt; stays active until the application is finished (variable &amp;lt;code&amp;gt;APPMODE&amp;lt;/code&amp;gt; &amp;amp;lt; 1). Most applications uses the call &amp;lt;code&amp;gt;getmessage 1 1&amp;lt;/code&amp;gt; (process secondary queue, return &#039;&#039;never&#039;&#039;), to implement the main message loop.&lt;br /&gt;
*The argument &amp;lt;var&amp;gt;queued&amp;lt;/var&amp;gt; controls the procesing of messages stored in the secondary queue. This queue is filled with messages which can not be processed at the time. The processing of the secondary queue must be disabled in sub-message loops which queues (unknown) messages by calling the macro [[#MsgQueue|MSGQUEUE]].&lt;br /&gt;
*If the argument &amp;lt;var&amp;gt;nodispatch&amp;lt;/var&amp;gt; is set to 1, message dispatching is disabled and all messages are returned to the caller.&lt;br /&gt;
*Following special variables and items are used:&lt;br /&gt;
**&amp;lt;code&amp;gt;AppMode&amp;lt;/code&amp;gt;: application mode (&amp;amp;lt; 1 &amp;amp;rarr; application finished, &amp;amp;ge; 1 &amp;amp;rarr; application running)&lt;br /&gt;
**&amp;lt;code&amp;gt;@LOGMSG&amp;lt;/code&amp;gt;: controls the {{STX}} log-level; all received messages are logged if &amp;lt;code&amp;gt;@LOGMSG&amp;lt;/code&amp;gt; &amp;amp;ge; 1&lt;br /&gt;
**&amp;lt;code&amp;gt;tMsgQueue&amp;lt;/code&amp;gt;: secondary message queue (a simple table)&lt;br /&gt;
**&amp;lt;code&amp;gt;HWndTab, MWndTab&amp;lt;/code&amp;gt;: simple tables used to manage displays and modal dialogs of the shell&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The script [http://mediawiki.kfs.oeaw.ac.at/stx/script_examples/gui_basic_example.sts gui_basic_example.sts] shows a simple example how message handling can be used in a {{STX}} GUI.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;include src=&amp;quot;script_examples/gui_basic_example.sts&amp;quot; highlight=&amp;quot;cpp&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==ExtSetup==&lt;br /&gt;
:This macro implements some special settings functions used by the {{STX}} applications.&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP SEGNAME [ &amp;lt;var&amp;gt;aset&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Retrieve the next automatic segment name according to segname-settings and arguments. If an audioset reference &amp;lt;var&amp;gt;aset&amp;lt;/var&amp;gt; is specified, the segment information is used to compute the next possible index. Otherwise the last used index is incremented by 1. The macro returns the generated segment id.&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP SEGNAMEDLG&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Show the settings dialog for automatic segment names.&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP PRINTOUT &amp;lt;var&amp;gt;item&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Print the specified item (graph or display). Returns 0 for success or a numeric error code.&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP PRINTOUT &amp;lt;var&amp;gt;item&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Show the print settings dialog.&lt;br /&gt;
&lt;br /&gt;
==PlayCursor==&lt;br /&gt;
:Implements a set of functions to display a running cursor in one or more graphs during signal playback.&lt;br /&gt;
:Note: This implementation uses the variable &amp;lt;code&amp;gt;PlayCrsPar&amp;lt;/code&amp;gt; and the table &amp;lt;code&amp;gt;PlayCrsTab&amp;lt;/code&amp;gt; to store the settings and state values. Therefore a shell ({{STX}} application or script) can only use one &#039;&#039;instance&#039;&#039; of the &amp;lt;code&amp;gt;PlayCursor&amp;lt;/code&amp;gt;.&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR ADD &amp;lt;var&amp;gt;gitem xmin xmax&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Add the graphitem &amp;lt;var&amp;gt;gitem&amp;lt;/var&amp;gt; to the playcursor graph-list. The arguments &amp;lt;var&amp;gt;xmin&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;xmax&amp;lt;/var&amp;gt; specify the x-range where the playcursor should be visibile in graph &amp;lt;var&amp;gt;gitem&amp;lt;/var&amp;gt;.&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR SET &amp;lt;var&amp;gt;x1 x2 dt t2x&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Set the start- and end-time (&amp;lt;var&amp;gt;x1..x2&amp;lt;/var&amp;gt;, values must be specified in the x-unit of the graphs), the time-increment (&amp;lt;var&amp;gt;dt&amp;lt;/var&amp;gt;, timer step in ms) and the factor &amp;lt;var&amp;gt;t2x&amp;lt;/var&amp;gt; to convert timer-values (ms) to the x-unit of the graphs (e.g. if x-values are specified in seconds t2x must be set to 0.001)&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR ON [ &amp;lt;var&amp;gt;witem&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:If playcursor is &#039;&#039;&#039;inactive&#039;&#039;&#039; &amp;amp;rarr; Start the playcursor and, if &amp;lt;var&amp;gt;witem&amp;lt;/var&amp;gt; is a waveitem, the playback of &amp;lt;var&amp;gt;witem&amp;lt;/var&amp;gt;.&lt;br /&gt;
:If playcursor is &#039;&#039;&#039;active&#039;&#039;&#039; &amp;amp;rarr; If &amp;lt;var&amp;gt;witem&amp;lt;/var&amp;gt; is a waveitem, update the playback gain.&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR OFF&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Stop the playcursor, reset settings and empty the graph-list.&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR GETPOS&amp;lt;/code&amp;gt;===&lt;br /&gt;
:If playcursor is &#039;&#039;&#039;inactive&#039;&#039;&#039; &amp;amp;rarr; Return always 0.&lt;br /&gt;
:If playcursor is &#039;&#039;&#039;active&#039;&#039;&#039; &amp;amp;rarr; Return the current x-position of the playcursor.&lt;br /&gt;
===&amp;lt;code&amp;gt;PLAYCURSOR VALUE ...&amp;lt;/code&amp;gt;===&lt;br /&gt;
:This is the message handler entry for the timer (valueitem) which is used by the playcursor functions. This entry should not be called directly (only via the message handling system).&lt;br /&gt;
&lt;br /&gt;
==GenerateScaleParams==&lt;br /&gt;
===&amp;lt;code&amp;gt;GENERATESCALEPARAMS &amp;lt;var&amp;gt;&amp;lt;var&amp;gt;min max&amp;lt;/var&amp;gt; ; [&amp;lt;var&amp;gt;unit&amp;lt;/var&amp;gt;=s] ; [&amp;lt;var&amp;gt;format&amp;lt;/var&amp;gt;=clock] ; [&amp;lt;var&amp;gt;nlabels&amp;lt;/var&amp;gt;=6] ;  [&amp;lt;var&amp;gt;nminor&amp;lt;/var&amp;gt;=3] ;  [&amp;lt;var&amp;gt;srate&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Generate the paramaters for the &amp;lt;code&amp;gt;SET graph XSCALE ...&amp;lt;/code&amp;gt; command which is used to assign the time-scale settings of the viewer-graphs.&lt;br /&gt;
::{|class=&amp;quot;keinrahmen&amp;quot;&lt;br /&gt;
|&amp;lt;var&amp;gt;min max&amp;lt;/var&amp;gt; || ||The minimum and maximum x-value.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;unit&amp;lt;/var&amp;gt; || ||The unit of the minimum and maximum x-value; either seconds (&amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt;) or milliseconds (&amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;format&amp;lt;/var&amp;gt; || ||The scale label format (&amp;lt;code&amp;gt;clock|s|ms|samples&amp;lt;/code&amp;gt;). Note that the &amp;lt;var&amp;gt;unitStr&amp;lt;/var&amp;gt; parameter is returned for the formats &amp;lt;code&amp;gt;s&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ms&amp;lt;/code&amp;gt;, but not for &amp;lt;code&amp;gt;clock&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;samples&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;nlabels&amp;lt;/var&amp;gt; || ||Number of labels; must be &amp;amp;ge; 2&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;nminor&amp;lt;/var&amp;gt; || ||Number of minor ticks; must be &amp;amp;ge; 2&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;var&amp;gt;srate&amp;lt;/var&amp;gt; || || The signal sampling rate in &amp;lt;code&amp;gt;Hz&amp;lt;/code&amp;gt;. This argument is required only for the &amp;lt;var&amp;gt;format&amp;lt;/var&amp;gt; &amp;lt;code&amp;gt;samples&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
:The function returns the string &amp;lt;code&amp;gt;minval maxval unitstr formatStr&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;minval maxval unitstr labelTab&amp;lt;/code&amp;gt; for success and the error code &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; if the scale parameter generation fails. The result can be directly used to assign the x-scale settings: &amp;lt;SET&amp;gt;SET graph XSCALE $RESULT&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==MetaSegment==&lt;br /&gt;
This macro implements a set of functions to display, edit and manage the meta-segments (segment marker) in the applications &amp;lt;code&amp;gt;VIEWER1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;VIEWER2&amp;lt;/code&amp;gt;. It is very deep connected with the internals of the viewer applications and should not be used for other purposes.&lt;br /&gt;
&lt;br /&gt;
==stxFileTypeList==&lt;br /&gt;
===&amp;lt;code&amp;gt;STXFILETYPELIST Workspace|Project|SMDF|Segments|Wave|Script|Export&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Returns the semi-colon seperated list of filename-extensions for the selected type. The result can be used to pass filetype-arguments to the [[../BUTIL#FileDialog|BUTIL FileDialog functions]].&lt;br /&gt;
:Example: The macro call &amp;lt;code&amp;gt;stxfiletypelist smdf&amp;lt;/code&amp;gt; returns the string &amp;lt;code&amp;gt;stxsm=STX Segment Metadata; xml=STX Segment Metadata (old)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==stxFileType==&lt;br /&gt;
===&amp;lt;code&amp;gt;STXFILETYPE Workspace|Project|SMDF|Segments|Wave|Script|Export&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Returns the default filename-extensions for the selected type.&lt;br /&gt;
:Example: The macro call &amp;lt;code&amp;gt;stxfiletype smdf&amp;lt;/code&amp;gt; returns the string &amp;lt;code&amp;gt;stxsm&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==SectionFile==&lt;br /&gt;
===&amp;lt;code&amp;gt;SECTIONFILE &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt; ; &amp;lt;var&amp;gt;todo table type name&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
:[[Programmer_Guide/Shell_Items/File/NEW_FILE#Section_Files|Section file]] handling. In {{STX}} files in the INI-file format are called section-files. All source files (scripts, macros, ..) and some data files are stored in this format. &lt;br /&gt;
:Note: A file processed with this macro may contain pre-processor commands, continuation-lines and comments.&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;var&amp;gt;todo&amp;lt;/var&amp;gt;=&amp;lt;code&amp;gt;LOAD&amp;lt;/code&amp;gt;: Load the content of section &amp;lt;code&amp;gt;[&amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt; or section &amp;lt;code&amp;gt;[&amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt; from file &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt; into &amp;lt;var&amp;gt;table&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;table&amp;lt;/var&amp;gt; is set to &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; a new table is created.&lt;br /&gt;
::Result: The table containing the loaded data (success) or an empty string (error)&lt;br /&gt;
:;&amp;lt;var&amp;gt;todo&amp;lt;/var&amp;gt;=&amp;lt;code&amp;gt;LIST&amp;lt;/code&amp;gt;: List all sections (&amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt; not specified) or matching sections defined in file &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt;. If &amp;lt;var&amp;gt;table&amp;lt;/var&amp;gt; is set to &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; a new table is created.&lt;br /&gt;
::Result: The table containing the section-list (success) or an empty string (error)&lt;br /&gt;
:;&amp;lt;var&amp;gt;todo&amp;lt;/var&amp;gt;=&amp;lt;code&amp;gt;SAVE&amp;lt;/code&amp;gt;: Save the &amp;lt;var&amp;gt;table&amp;lt;/var&amp;gt; in the section &amp;lt;code&amp;gt;[&amp;lt;var&amp;gt;type&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt; or section &amp;lt;code&amp;gt;[&amp;lt;var&amp;gt;type name&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt; of file &amp;lt;var&amp;gt;path&amp;lt;/var&amp;gt;. If the section exists already its content is replaced by the new data. If &amp;lt;var&amp;gt;table&amp;lt;/var&amp;gt; is set to &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; the section is &#039;&#039;&#039;deleted&#039;&#039;&#039;.&lt;br /&gt;
::Result: Always an empty string.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==FileToolBox==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==LogWindow==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ConLog==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==UM and EM==&lt;br /&gt;
===&amp;lt;code&amp;gt;UM &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt; [; &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:User Message &amp;amp;rarr; Display &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt; in a message box with the caption &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt;. This macro is an alias for &amp;lt;code&amp;gt;BUTIL MSGBOX MSG ; &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt; ; &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The return value is always 0.&lt;br /&gt;
===&amp;lt;code&amp;gt;EM [ &amp;lt;var&amp;gt;rc&amp;lt;/var&amp;gt; [ &amp;lt;var&amp;gt;n&amp;lt;/var&amp;gt; ]] ; &amp;lt;var&amp;gt;emsg&amp;lt;/var&amp;gt; [; &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt; ]&amp;lt;/code&amp;gt;===&lt;br /&gt;
:Error Message &amp;amp;rarr; Display the text &amp;quot;&amp;lt;code&amp;gt;ERROR (&amp;lt;var&amp;gt;rc&amp;lt;/var&amp;gt;): &amp;lt;var&amp;gt;emsg&amp;lt;/var&amp;gt; &amp;lt;/code&amp;gt;&amp;quot; in a message box with the caption &amp;lt;var&amp;gt;title&amp;lt;/var&amp;gt;. The macro exits from &amp;lt;var&amp;gt;n&amp;lt;/var&amp;gt; (default: 2 = exit from caller) and returns the value &amp;lt;var&amp;gt;rc&amp;lt;/var&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==ShowItem==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CreateMenu==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DoModalDialog==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SetModalDialog==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GetWindowPos==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SetWindowPos==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==WindowSizeDlg==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GetMonitor==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GetDesktop==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==ProgressBox==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==InitDialogItem==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SetControlMode==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SetGraphXScale==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==GetOutputValue==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==XScaleLinear==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==XScaleBark==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Table2Output==&lt;br /&gt;
===&amp;lt;code&amp;gt;EXTSETUP &amp;lt;var&amp;gt;...&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Wave2Output==&lt;br /&gt;
===&amp;lt;code&amp;gt;[SPU WAVE2OUTPUT &amp;lt;var&amp;gt;waveitem&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;length&amp;lt;/var&amp;gt;=10000 &amp;lt;var&amp;gt;factor&amp;lt;/var&amp;gt;=1 OUT x1 ... x8 sr n]&amp;lt;/code&amp;gt;===&lt;br /&gt;
Uses the sp-atom [[Programmer_Guide/SPU_Reference/ASIGIN|asigin]] to read signal-blocks of the specified &amp;lt;var&amp;gt;length&amp;lt;/var&amp;gt; (in samples) from the &amp;lt;var&amp;gt;waveitem&amp;lt;/var&amp;gt;.&lt;br /&gt;
;&amp;lt;var&amp;gt;waveitem&amp;lt;/var&amp;gt;: name of the source waveitem&lt;br /&gt;
;&amp;lt;var&amp;gt;length&amp;lt;/var&amp;gt;: block length in samples&lt;br /&gt;
;&amp;lt;var&amp;gt;factor&amp;lt;/var&amp;gt;: linear amplification factor&lt;br /&gt;
;&amp;lt;code&amp;gt;x1, x2, ..&amp;lt;/code&amp;gt;: signal vector containing signal of channel 1, 2, ...&lt;br /&gt;
;&amp;lt;code&amp;gt;sr&amp;lt;/code&amp;gt;: samping rate of &amp;lt;var&amp;gt;waveitem&amp;lt;/var&amp;gt; in Hz&lt;br /&gt;
;&amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;: number of blocks&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7107</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7107"/>
		<updated>2014-05-14T14:55:01Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and which is interpreted and executed by an instance of the {{STx}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{Stx}} installation directory. {{STX|caps}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header starts a new section, defining the scope, type and the name of the source code contained in the body of the respective section. The section header must be enclosed within square brackets, and the opening bracket must be the first character in the line. There must not be any text behind the closing bracket except, optionally, a comment.&lt;br /&gt;
&lt;br /&gt;
 [{&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
:;&amp;lt;code&amp;gt;GLOBAL&amp;lt;/code&amp;gt;: The section code is visible everywhere. This is the default.&lt;br /&gt;
:;&amp;lt;code&amp;gt;LOCAL&amp;lt;/code&amp;gt;: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated, from macros defined in the same source file.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MAIN&amp;lt;/code&amp;gt;: Defines the respective section (which must be defining a macro) as the main macro of an {{STx}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is applicable to [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{Stx}} application but not for scripts.&lt;br /&gt;
:;&amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt;: Defines the section code as a shell startup code, meaning that the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is applicable to [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MSGHANDLER&amp;lt;/code&amp;gt;: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]], [[#Definition_of_classes|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] and [[#Definition_of_SPUs|&amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;]] have a defined meaning in the {{STX}} scripting language. Other, user-defined, types may also be used (e.g. to store data). Such user-defined sections will be ignored by {{Stx}}. They may be accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|SPU item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class,&amp;amp;hellip;). The name must be unique in the namespace where the source code is loaded, as defined by the section type, &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. Source sections of type [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]] and [[#Definition_of_slasses|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]], [[#Definition_of_classes|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] and [[#Definition_of_SPUs|&amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional, and depend on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
 [LOCAL:MACRO MacroExample1]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample1&amp;quot; will be visible only locally&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [MACRO MacroExample2 #args]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample2&amp;quot; will be globally visible&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [SPU DSPCircuit1 #in1 #in2 OUT #out1]&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (actually, there must be at least one statement per section), of empty lines (which are ignored) and of comments (which are also ignored). The section body ends with the next section header or with the end of the file.&lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code that is there for documentation purposes. It is ignored by the loader. A comment can be placed wherever a whitespace character is allowed. The standard C++ comment tags &amp;quot;&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;/* &amp;amp;hellip; */&amp;lt;/code&amp;gt;&amp;quot; can be used in {{STx}} source code.&lt;br /&gt;
:;line comment: starts with the tag &amp;quot;&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;&amp;quot; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &amp;quot;&amp;lt;code&amp;gt;/*&amp;lt;/code&amp;gt;&amp;quot; and closed with the tag &amp;quot;&amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt;&amp;quot;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like an end of a line.&lt;br /&gt;
:In a quoted string, the comment tags are interpreted as normal text and not as tag, which is probably the expected behaviour. It is also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is that part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one section headers liated below. The possible formats differ only in how arguments are processed or parsed before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
 [MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&lt;br /&gt;
:Arguments are stored in the variables &amp;lt;var&amp;gt;#ARGV&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;#QARGV&amp;lt;/var&amp;gt;, without further processing or parsing. The user program is free further to process these data, e.g. by using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &amp;lt;var&amp;gt;#ARGV&amp;lt;/var&amp;gt;, &amp;lt;var&amp;gt;#QARGV&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 [MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt;} {separator&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;} &amp;amp;hellip;]&lt;br /&gt;
:&#039;&#039;&amp;lt;code&amp;gt;READ&amp;lt;/code&amp;gt;-style&#039;&#039; argument parsing: The arguments are parsed as strings, internally using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command before the first macro statement is executed. The programmer can select arbitrary separators by supplying the &amp;lt;code&amp;gt;separator&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt;&amp;lt;/code&amp;gt; arguments. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, its value is the empty string. If no separator is spezified between two arguments, all whitespace characters are considered separators.&lt;br /&gt;
:important variables: &amp;lt;var&amp;gt;#ARGV&amp;lt;/var&amp;gt;, &amp;lt;var&amp;gt;#ARGC&amp;lt;/var&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{Stx}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;{{STx}} 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;{{STX}} 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;{{Stx}} 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STx}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in {{Stx}}, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STx}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7106</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7106"/>
		<updated>2014-05-14T14:27:12Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Section body */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and which is interpreted and executed by an instance of the {{STx}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{Stx}} installation directory. {{STX|caps}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header starts a new section, defining the scope, type and the name of the source code contained in the body of the respective section. The section header must be enclosed within square brackets, and the opening bracket must be the first character in the line. There must not be any text behind the closing bracket except, optionally, a comment.&lt;br /&gt;
&lt;br /&gt;
 [{&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
:;&amp;lt;code&amp;gt;GLOBAL&amp;lt;/code&amp;gt;: The section code is visible everywhere. This is the default.&lt;br /&gt;
:;&amp;lt;code&amp;gt;LOCAL&amp;lt;/code&amp;gt;: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated, from macros defined in the same source file.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MAIN&amp;lt;/code&amp;gt;: Defines the respective section (which must be defining a macro) as the main macro of an {{STx}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is applicable to [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{Stx}} application but not for scripts.&lt;br /&gt;
:;&amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt;: Defines the section code as a shell startup code, meaning that the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is applicable to [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MSGHANDLER&amp;lt;/code&amp;gt;: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]], [[#Definition_of_classes|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] and [[#Definition_of_SPUs|&amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;]] have a defined meaning in the {{STX}} scripting language. Other, user-defined, types may also be used (e.g. to store data). Such user-defined sections will be ignored by {{Stx}}. They may be accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|SPU item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class,&amp;amp;hellip;). The name must be unique in the namespace where the source code is loaded, as defined by the section type, &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. Source sections of type [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]] and [[#Definition_of_slasses|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]], [[#Definition_of_classes|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] and [[#Definition_of_SPUs|&amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional, and depend on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
 [LOCAL:MACRO MacroExample1]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample1&amp;quot; will be visible only locally&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [MACRO MacroExample2 #args]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample2&amp;quot; will be globally visible&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [SPU DSPCircuit1 #in1 #in2 OUT #out1]&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (actually, there must be at least one statement per section), of empty lines (which are ignored) and of comments (which are also ignored). The section body ends with the next section header or with the end of the file.&lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code that is there for documentation purposes. It is ignored by the loader. A comment can be placed wherever a whitespace character is allowed. The standard C++ comment tags &amp;quot;&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;/* &amp;amp;hellip; */&amp;lt;/code&amp;gt;&amp;quot; can be used in {{STx}} source code.&lt;br /&gt;
:;line comment: starts with the tag &amp;quot;&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;&amp;quot; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &amp;quot;&amp;lt;code&amp;gt;/*&amp;lt;/code&amp;gt;&amp;quot; and closed with the tag &amp;quot;&amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt;&amp;quot;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like an end of a line.&lt;br /&gt;
:In a quoted string, the comment tags are interpreted as normal text and not as tag, which is probably the expected behaviour. It is also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is that part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one of the following section headers. The possible formats differ only in the type of argument parsing supplied before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:No argument parsing. The argument parsing must be implemented in the macro body using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGV&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} {seperator1} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:READ-style argument parsing. The arguments are parsed as strings, using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command befor the first statement is executed. The programmer can select arbitrary argument seperators. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, the default value is the &#039;&#039;&#039;empty string&#039;&#039;&#039;. If no seperator is spezified between two arguments, all whitespace characters are used as seperator.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#ARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{Stx}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;{{STx}} 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;{{STX}} 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;{{Stx}} 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STx}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in {{Stx}}, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STx}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7105</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7105"/>
		<updated>2014-05-14T14:10:22Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Section header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and which is interpreted and executed by an instance of the {{STx}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{Stx}} installation directory. {{STX|caps}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header starts a new section, defining the scope, type and the name of the source code contained in the body of the respective section. The section header must be enclosed within square brackets, and the opening bracket must be the first character in the line. There must not be any text behind the closing bracket except, optionally, a comment.&lt;br /&gt;
&lt;br /&gt;
 [{&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
:;&amp;lt;code&amp;gt;GLOBAL&amp;lt;/code&amp;gt;: The section code is visible everywhere. This is the default.&lt;br /&gt;
:;&amp;lt;code&amp;gt;LOCAL&amp;lt;/code&amp;gt;: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated, from macros defined in the same source file.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MAIN&amp;lt;/code&amp;gt;: Defines the respective section (which must be defining a macro) as the main macro of an {{STx}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is applicable to [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{Stx}} application but not for scripts.&lt;br /&gt;
:;&amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt;: Defines the section code as a shell startup code, meaning that the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is applicable to [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MSGHANDLER&amp;lt;/code&amp;gt;: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]], [[#Definition_of_classes|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] and [[#Definition_of_SPUs|&amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;]] have a defined meaning in the {{STX}} scripting language. Other, user-defined, types may also be used (e.g. to store data). Such user-defined sections will be ignored by {{Stx}}. They may be accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|SPU item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class,&amp;amp;hellip;). The name must be unique in the namespace where the source code is loaded, as defined by the section type, &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. Source sections of type [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]] and [[#Definition_of_slasses|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]], [[#Definition_of_classes|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] and [[#Definition_of_SPUs|&amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional, and depend on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
 [LOCAL:MACRO MacroExample1]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample1&amp;quot; will be visible only locally&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [MACRO MacroExample2 #args]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample2&amp;quot; will be globally visible&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [SPU DSPCircuit1 #in1 #in2 OUT #out1]&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (there must be at least one statement per section), empty lines (which are ignored) and comments (which are also ignored). The section body ends with the next section header or with the end of the file.&lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code which is used for documentation purposes and is ignored by the loader. A comment can be placed wherever a whitespace character is allowed. The standard C++ comment tags &amp;quot;&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;/* &amp;amp;hellip; */&amp;lt;/code&amp;gt;&amp;quot; can be used in {{STx}} source code.&lt;br /&gt;
:;line comment: starts with the tag &amp;quot;&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;&amp;quot; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &amp;quot;&amp;lt;code&amp;gt;/*&amp;lt;/code&amp;gt;&amp;quot; and closed with the tag &amp;quot;&amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt;&amp;quot;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like an end of a line.&lt;br /&gt;
:In a quoted string, the comment tags are interpreted as normal text and not as tag, which is probably the expected behaviour. It is also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is the part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one of the following section headers. The possible formats differ only in the type of argument parsing supplied before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:No argument parsing. The argument parsing must be implemented in the macro body using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGV&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} {seperator1} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:READ-style argument parsing. The arguments are parsed as strings, using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command befor the first statement is executed. The programmer can select arbitrary argument seperators. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, the default value is the &#039;&#039;&#039;empty string&#039;&#039;&#039;. If no seperator is spezified between two arguments, all whitespace characters are used as seperator.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#ARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{Stx}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;{{STx}} 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;{{STX}} 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;{{Stx}} 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STx}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in {{Stx}}, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STx}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7102</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7102"/>
		<updated>2014-05-14T12:24:39Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and which is interpreted and executed by an instance of the {{STx}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{Stx}} installation directory. {{STX|caps}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header starts a new section, defining the scope, type and the name of the source code contained in the body of the respective section. The section header must be enclosed within square brackets, and the opening bracket must be the first character in the line. There must not be any text behind the closing bracket except, optionally, a comment.&lt;br /&gt;
&lt;br /&gt;
 [{&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
:;&amp;lt;code&amp;gt;GLOBAL&amp;lt;/code&amp;gt;: The section code is visible everywhere. This is the default.&lt;br /&gt;
:;&amp;lt;code&amp;gt;LOCAL&amp;lt;/code&amp;gt;: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated, from macros defined in the same source file.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MAIN&amp;lt;/code&amp;gt;: Defines the respective section (which must be defining a macro) as the main macro of an {{STx}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is applicable to [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{Stx}} application but not for scripts.&lt;br /&gt;
:;&amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt;: Defines the section code as a shell startup code, meaning that the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is applicable to [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MSGHANDLER&amp;lt;/code&amp;gt;: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]] have a defined meaning in the {{STX}} scripting language. Other, user-defined, types may also be used (e.g. to store data). Such user-defined sections will be ignored by {{Stx}}. They may be accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|spu item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class,&amp;amp;hellip;). The name must be unique in the namespace where the source code is loaded, as defined by the section type, &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. Source sections of type [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]] and [[#Definition_of_slasses|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]], [[#Definition_of_classes|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] and [[#Definition_of_SPUs|&amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional, and depend on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
 [LOCAL:MACRO MacroExample1]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample1&amp;quot; will be visible only locally&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [MACRO MacroExample2 #args]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample2&amp;quot; will be globally visible&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [SPU DSPCircuit1 #in1 #in2 OUT #out1]&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (there must be at least one statement per section), empty lines (which are ignored) and comments (which are also ignored). The section body ends with the next section header or with the end of the file.&lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code which is used for documentation purposes and is ignored by the loader. A comment can be placed wherever a whitespace character is allowed. The standard C++ comment tags &amp;quot;&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;/* &amp;amp;hellip; */&amp;lt;/code&amp;gt;&amp;quot; can be used in {{STx}} source code.&lt;br /&gt;
:;line comment: starts with the tag &amp;quot;&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;&amp;quot; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &amp;quot;&amp;lt;code&amp;gt;/*&amp;lt;/code&amp;gt;&amp;quot; and closed with the tag &amp;quot;&amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt;&amp;quot;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like an end of a line.&lt;br /&gt;
:In a quoted string, the comment tags are interpreted as normal text and not as tag, which is probably the expected behaviour. It is also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is the part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one of the following section headers. The possible formats differ only in the type of argument parsing supplied before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:No argument parsing. The argument parsing must be implemented in the macro body using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGV&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} {seperator1} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:READ-style argument parsing. The arguments are parsed as strings, using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command befor the first statement is executed. The programmer can select arbitrary argument seperators. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, the default value is the &#039;&#039;&#039;empty string&#039;&#039;&#039;. If no seperator is spezified between two arguments, all whitespace characters are used as seperator.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#ARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{Stx}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;{{STx}} 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;{{STX}} 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;{{Stx}} 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STx}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in {{Stx}}, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STx}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7101</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7101"/>
		<updated>2014-05-08T15:29:41Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Section body */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and interpreted and executed by an instance of the {{STx}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{Stx}} installation directory. {{STX|caps}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header starts a new section, defining the scope, type and the name of the source code contained in the body of the respective section. The section header must be enclosed within square brackets, and the opening bracket must be the first character in the line. There must not be any text behind the closing bracket except, optionally, a comment.&lt;br /&gt;
&lt;br /&gt;
 [{&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
:;&amp;lt;code&amp;gt;GLOBAL&amp;lt;/code&amp;gt;: The section code is visible everywhere. This is the default.&lt;br /&gt;
:;&amp;lt;code&amp;gt;LOCAL&amp;lt;/code&amp;gt;: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated, from macros defined in the same source file.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MAIN&amp;lt;/code&amp;gt;: Defines the respective section (which must be defining a macro) as the main macro of an {{STx}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is applicable to [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{Stx}} application but not for scripts.&lt;br /&gt;
:;&amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt;: Defines the section code as a shell startup code, meaning that the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is applicable to [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MSGHANDLER&amp;lt;/code&amp;gt;: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]] have a defined meaning in the {{STX}} scripting language. Other, user-defined, types may also be used (e.g. to store data). Such user-defined sections will be ignored by {{Stx}}. They may be accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|spu item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class,&amp;amp;hellip;). The name must be unique in the namespace where the source code is loaded, as defined by the section type, &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. Source sections of type [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]] and [[#Definition_of_slasses|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]], [[#Definition_of_classes|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] and [[#Definition_of_SPUs|&amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional, and depend on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
 [LOCAL:MACRO MacroExample1]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample1&amp;quot; will be visible only locally&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [MACRO MacroExample2 #args]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample2&amp;quot; will be globally visible&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [SPU DSPCircuit1 #in1 #in2 OUT #out1]&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (there must be at least one statement per section), empty lines (which are ignored) and comments (which are also ignored). The section body ends with the next section header or with the end of the file.&lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code which is used for documentation purposes and is ignored by the loader. A comment can be placed wherever a whitespace character is allowed. The standard C++ comment tags &amp;quot;&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;/* &amp;amp;hellip; */&amp;lt;/code&amp;gt;&amp;quot; can be used in {{STx}} source code.&lt;br /&gt;
:;line comment: starts with the tag &amp;quot;&amp;lt;code&amp;gt;//&amp;lt;/code&amp;gt;&amp;quot; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &amp;quot;&amp;lt;code&amp;gt;/*&amp;lt;/code&amp;gt;&amp;quot; and closed with the tag &amp;quot;&amp;lt;code&amp;gt;*/&amp;lt;/code&amp;gt;&amp;quot;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like an end of a line.&lt;br /&gt;
:In a quoted string, the comment tags are interpreted as normal text and not as tag, which is probably the expected behaviour. It is also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is the part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one of the following section headers. The possible formats differ only in the type of argument parsing supplied before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:No argument parsing. The argument parsing must be implemented in the macro body using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGV&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} {seperator1} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:READ-style argument parsing. The arguments are parsed as strings, using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command befor the first statement is executed. The programmer can select arbitrary argument seperators. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, the default value is the &#039;&#039;&#039;empty string&#039;&#039;&#039;. If no seperator is spezified between two arguments, all whitespace characters are used as seperator.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#ARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{Stx}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;{{STx}} 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;{{STX}} 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;{{Stx}} 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STx}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in {{Stx}}, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STx}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7100</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7100"/>
		<updated>2014-05-08T15:25:54Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Section header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and interpreted and executed by an instance of the {{STx}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{Stx}} installation directory. {{STX|caps}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header starts a new section, defining the scope, type and the name of the source code contained in the body of the respective section. The section header must be enclosed within square brackets, and the opening bracket must be the first character in the line. There must not be any text behind the closing bracket except, optionally, a comment.&lt;br /&gt;
&lt;br /&gt;
 [{&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
:;&amp;lt;code&amp;gt;GLOBAL&amp;lt;/code&amp;gt;: The section code is visible everywhere. This is the default.&lt;br /&gt;
:;&amp;lt;code&amp;gt;LOCAL&amp;lt;/code&amp;gt;: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated, from macros defined in the same source file.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MAIN&amp;lt;/code&amp;gt;: Defines the respective section (which must be defining a macro) as the main macro of an {{STx}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is applicable to [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{Stx}} application but not for scripts.&lt;br /&gt;
:;&amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt;: Defines the section code as a shell startup code, meaning that the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is applicable to [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MSGHANDLER&amp;lt;/code&amp;gt;: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]] have a defined meaning in the {{STX}} scripting language. Other, user-defined, types may also be used (e.g. to store data). Such user-defined sections will be ignored by {{Stx}}. They may be accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|spu item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class,&amp;amp;hellip;). The name must be unique in the namespace where the source code is loaded, as defined by the section type, &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. Source sections of type [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]] and [[#Definition_of_slasses|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|&amp;lt;code&amp;gt;macro&amp;lt;/code&amp;gt;]], [[#Definition_of_classes|&amp;lt;code&amp;gt;class&amp;lt;/code&amp;gt;]] and [[#Definition_of_SPUs|&amp;lt;code&amp;gt;SPU&amp;lt;/code&amp;gt;]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional, and depend on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
&lt;br /&gt;
 [LOCAL:MACRO MacroExample1]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample1&amp;quot; will be visible only locally&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [MACRO MacroExample2 #args]&lt;br /&gt;
    // This macro called &amp;quot;MacroExample2&amp;quot; will be globally visible&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
 &lt;br /&gt;
 [SPU DSPCircuit1 #in1 #in2 OUT #out1]&lt;br /&gt;
    &amp;amp;hellip;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (at least one is mandatory), empty lines (are ignored) and comments. The section body ends at the next section header or the end of the file. &lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code which is used for documentation purposes and is ignored by the loader. A comment can be placed anywhere, where a whitespace character is allowed. The standard C++ comment tags can be used in {{STx}} source code.&lt;br /&gt;
:;line comment: starts with the tag &#039;&#039;&#039;//&#039;&#039;&#039; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &#039;&#039;&#039;/*&#039;&#039;&#039; and closed with the tag &#039;&#039;&#039;*/&#039;&#039;&#039;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like a &#039;&#039;end of line&#039;&#039;. &lt;br /&gt;
:Note that a comment open tag (&#039;&#039;&#039;//&#039;&#039;&#039; or &#039;&#039;&#039;/*&#039;&#039;&#039;) in a quoted string is interpreted as normal text and not as tag. Its also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is the part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one of the following section headers. The possible formats differ only in the type of argument parsing supplied before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:No argument parsing. The argument parsing must be implemented in the macro body using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGV&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} {seperator1} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:READ-style argument parsing. The arguments are parsed as strings, using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command befor the first statement is executed. The programmer can select arbitrary argument seperators. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, the default value is the &#039;&#039;&#039;empty string&#039;&#039;&#039;. If no seperator is spezified between two arguments, all whitespace characters are used as seperator.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#ARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{Stx}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;{{STx}} 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;{{STX}} 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;{{Stx}} 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STx}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in {{Stx}}, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STx}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7099</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7099"/>
		<updated>2014-05-08T15:19:38Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Section header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and interpreted and executed by an instance of the {{STx}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{Stx}} installation directory. {{STX|caps}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header starts a new section, defining the scope, type and the name of the source code contained in the body of the respective section. The section header must be enclosed within square brackets, and the opening bracket must be the first character in the line. There must not be any text behind the closing bracket except, optionally, a comment.&lt;br /&gt;
&lt;br /&gt;
 [{&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
:;&amp;lt;code&amp;gt;GLOBAL&amp;lt;/code&amp;gt;: The section code is visible everywhere. This is the default.&lt;br /&gt;
:;&amp;lt;code&amp;gt;LOCAL&amp;lt;/code&amp;gt;: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated, from macros defined in the same source file.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MAIN&amp;lt;/code&amp;gt;: Defines the respective section (which must be defining a macro) as the main macro of an {{STx}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is applicable to [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{Stx}} application but not for scripts.&lt;br /&gt;
:;&amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt;: Defines the section code as a shell startup code, meaning that the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is applicable to [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
:;&amp;lt;code&amp;gt;MSGHANDLER&amp;lt;/code&amp;gt;: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]] are meaningful for the {{STX}} scripting language. Other types can also be used (e.g. to store data) and accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|spu item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class, ...). . The name must be unique in the namespace where the source code is loaded, which is selected by the section type. Source sections of type [[#Definition_of_macros|macro]] and [[#Definition_of_slasses|class]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional and depending on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[LOCAL:MACRO MacroExample1]&amp;lt;br&amp;gt;[MACRO MacroExample2 #args]&amp;lt;br&amp;gt;[SPU DSPCircuit1 #in1 #in2 OUT #out1]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (at least one is mandatory), empty lines (are ignored) and comments. The section body ends at the next section header or the end of the file. &lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code which is used for documentation purposes and is ignored by the loader. A comment can be placed anywhere, where a whitespace character is allowed. The standard C++ comment tags can be used in {{STx}} source code.&lt;br /&gt;
:;line comment: starts with the tag &#039;&#039;&#039;//&#039;&#039;&#039; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &#039;&#039;&#039;/*&#039;&#039;&#039; and closed with the tag &#039;&#039;&#039;*/&#039;&#039;&#039;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like a &#039;&#039;end of line&#039;&#039;. &lt;br /&gt;
:Note that a comment open tag (&#039;&#039;&#039;//&#039;&#039;&#039; or &#039;&#039;&#039;/*&#039;&#039;&#039;) in a quoted string is interpreted as normal text and not as tag. Its also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is the part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one of the following section headers. The possible formats differ only in the type of argument parsing supplied before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:No argument parsing. The argument parsing must be implemented in the macro body using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGV&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} {seperator1} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:READ-style argument parsing. The arguments are parsed as strings, using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command befor the first statement is executed. The programmer can select arbitrary argument seperators. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, the default value is the &#039;&#039;&#039;empty string&#039;&#039;&#039;. If no seperator is spezified between two arguments, all whitespace characters are used as seperator.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#ARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{Stx}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;{{STx}} 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;{{STX}} 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;{{Stx}} 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STx}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in {{Stx}}, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STx}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7098</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7098"/>
		<updated>2014-05-08T15:14:39Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and interpreted and executed by an instance of the {{STx}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{Stx}} installation directory. {{STX|caps}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header defines the scope, type and the name of the source code contained in the source section. The section header must be enclosed within square brackets, where the opening bracket must be the first character in the line and there must not be any text behind the closing bracket expect comments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The visibilty of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
::;GLOBAL: The section code is visible everywhere. This is the default.&lt;br /&gt;
::;LOCAL: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated from macros defined in the same source file.&lt;br /&gt;
::;MAIN: Defines the section code as the main macro of an {{STx}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is defined for [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{Stx}} application but not for scripts.&lt;br /&gt;
::;SHELL: Defines the section code as a shell startup code. This means, the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is defined for  [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
::;MSGHANDLER: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]] are meaningful for the {{STX}} scripting language. Other types can also be used (e.g. to store data) and accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|spu item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class, ...). . The name must be unique in the namespace where the source code is loaded, which is selected by the section type. Source sections of type [[#Definition_of_macros|macro]] and [[#Definition_of_slasses|class]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional and depending on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[LOCAL:MACRO MacroExample1]&amp;lt;br&amp;gt;[MACRO MacroExample2 #args]&amp;lt;br&amp;gt;[SPU DSPCircuit1 #in1 #in2 OUT #out1]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (at least one is mandatory), empty lines (are ignored) and comments. The section body ends at the next section header or the end of the file. &lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code which is used for documentation purposes and is ignored by the loader. A comment can be placed anywhere, where a whitespace character is allowed. The standard C++ comment tags can be used in {{STx}} source code.&lt;br /&gt;
:;line comment: starts with the tag &#039;&#039;&#039;//&#039;&#039;&#039; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &#039;&#039;&#039;/*&#039;&#039;&#039; and closed with the tag &#039;&#039;&#039;*/&#039;&#039;&#039;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like a &#039;&#039;end of line&#039;&#039;. &lt;br /&gt;
:Note that a comment open tag (&#039;&#039;&#039;//&#039;&#039;&#039; or &#039;&#039;&#039;/*&#039;&#039;&#039;) in a quoted string is interpreted as normal text and not as tag. Its also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is the part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one of the following section headers. The possible formats differ only in the type of argument parsing supplied before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:No argument parsing. The argument parsing must be implemented in the macro body using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGV&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} {seperator1} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:READ-style argument parsing. The arguments are parsed as strings, using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command befor the first statement is executed. The programmer can select arbitrary argument seperators. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, the default value is the &#039;&#039;&#039;empty string&#039;&#039;&#039;. If no seperator is spezified between two arguments, all whitespace characters are used as seperator.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#ARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{Stx}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;{{STx}} 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;{{STX}} 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;{{Stx}} 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STx}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in {{Stx}}, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STx}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7097</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7097"/>
		<updated>2014-05-08T15:14:01Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and interpreted and executed by an instance of the {{STx}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{Stx}} installation directory. {{STX}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header defines the scope, type and the name of the source code contained in the source section. The section header must be enclosed within square brackets, where the opening bracket must be the first character in the line and there must not be any text behind the closing bracket expect comments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The visibilty of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
::;GLOBAL: The section code is visible everywhere. This is the default.&lt;br /&gt;
::;LOCAL: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated from macros defined in the same source file.&lt;br /&gt;
::;MAIN: Defines the section code as the main macro of an {{STx}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is defined for [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{Stx}} application but not for scripts.&lt;br /&gt;
::;SHELL: Defines the section code as a shell startup code. This means, the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is defined for  [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
::;MSGHANDLER: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]] are meaningful for the {{STX}} scripting language. Other types can also be used (e.g. to store data) and accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|spu item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class, ...). . The name must be unique in the namespace where the source code is loaded, which is selected by the section type. Source sections of type [[#Definition_of_macros|macro]] and [[#Definition_of_slasses|class]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional and depending on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[LOCAL:MACRO MacroExample1]&amp;lt;br&amp;gt;[MACRO MacroExample2 #args]&amp;lt;br&amp;gt;[SPU DSPCircuit1 #in1 #in2 OUT #out1]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (at least one is mandatory), empty lines (are ignored) and comments. The section body ends at the next section header or the end of the file. &lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code which is used for documentation purposes and is ignored by the loader. A comment can be placed anywhere, where a whitespace character is allowed. The standard C++ comment tags can be used in {{STx}} source code.&lt;br /&gt;
:;line comment: starts with the tag &#039;&#039;&#039;//&#039;&#039;&#039; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &#039;&#039;&#039;/*&#039;&#039;&#039; and closed with the tag &#039;&#039;&#039;*/&#039;&#039;&#039;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like a &#039;&#039;end of line&#039;&#039;. &lt;br /&gt;
:Note that a comment open tag (&#039;&#039;&#039;//&#039;&#039;&#039; or &#039;&#039;&#039;/*&#039;&#039;&#039;) in a quoted string is interpreted as normal text and not as tag. Its also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is the part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one of the following section headers. The possible formats differ only in the type of argument parsing supplied before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:No argument parsing. The argument parsing must be implemented in the macro body using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGV&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} {seperator1} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:READ-style argument parsing. The arguments are parsed as strings, using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command befor the first statement is executed. The programmer can select arbitrary argument seperators. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, the default value is the &#039;&#039;&#039;empty string&#039;&#039;&#039;. If no seperator is spezified between two arguments, all whitespace characters are used as seperator.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#ARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{Stx}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;{{STx}} 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;{{STX}} 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;{{Stx}} 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STx}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in {{Stx}}, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STx}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7096</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7096"/>
		<updated>2014-05-08T15:12:25Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Section header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and interpreted and executed by an instance of the {{STX}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{STX}} installation directory. {{STX}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header defines the scope, type and the name of the source code contained in the source section. The section header must be enclosed within square brackets, where the opening bracket must be the first character in the line and there must not be any text behind the closing bracket expect comments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The visibilty of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
::;GLOBAL: The section code is visible everywhere. This is the default.&lt;br /&gt;
::;LOCAL: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated from macros defined in the same source file.&lt;br /&gt;
::;MAIN: Defines the section code as the main macro of an {{STX}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is defined for [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{STX}} application but not for scripts.&lt;br /&gt;
::;SHELL: Defines the section code as a shell startup code. This means, the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is defined for  [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
::;MSGHANDLER: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]] are meaningful for the {{STX}} scripting language. Other types can also be used (e.g. to store data) and accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|spu item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class, ...). . The name must be unique in the namespace where the source code is loaded, which is selected by the section type. Source sections of type [[#Definition_of_macros|macro]] and [[#Definition_of_slasses|class]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional and depending on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[LOCAL:MACRO MacroExample1]&amp;lt;br&amp;gt;[MACRO MacroExample2 #args]&amp;lt;br&amp;gt;[SPU DSPCircuit1 #in1 #in2 OUT #out1]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (at least one is mandatory), empty lines (are ignored) and comments. The section body ends at the next section header or the end of the file. &lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code which is used for documentation purposes and is ignored by the loader. A comment can be placed anywhere, where a whitespace character is allowed. The standard C++ comment tags can be used in {{STX}} source code.&lt;br /&gt;
:;line comment: starts with the tag &#039;&#039;&#039;//&#039;&#039;&#039; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &#039;&#039;&#039;/*&#039;&#039;&#039; and closed with the tag &#039;&#039;&#039;*/&#039;&#039;&#039;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like a &#039;&#039;end of line&#039;&#039;. &lt;br /&gt;
:Note that a comment open tag (&#039;&#039;&#039;//&#039;&#039;&#039; or &#039;&#039;&#039;/*&#039;&#039;&#039;) in a quoted string is interpreted as normal text and not as tag. Its also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is the part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one of the following section headers. The possible formats differ only in the type of argument parsing supplied before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:No argument parsing. The argument parsing must be implemented in the macro body using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGV&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} {seperator1} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:READ-style argument parsing. The arguments are parsed as strings, using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command befor the first statement is executed. The programmer can select arbitrary argument seperators. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, the default value is the &#039;&#039;&#039;empty string&#039;&#039;&#039;. If no seperator is spezified between two arguments, all whitespace characters are used as seperator.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#ARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{STX}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;STx 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;STx 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;STx 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STX}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in STx, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STX}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7095</id>
		<title>Programmer Guide/Source code</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Source_code&amp;diff=7095"/>
		<updated>2014-05-08T15:12:09Z</updated>

		<summary type="html">&lt;p&gt;Christian: /* Section header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The &#039;&#039;&#039;source code&#039;&#039;&#039; is the text which is loaded by the {{STX}} source code loader and interpreted and executed by an instance of the {{STX}} command interpreter (called [[Programmer_Guide/Concepts/Shell|shell]]). A &#039;&#039;&#039;source file&#039;&#039;&#039; is a text file containing source code. By convention, source files end with the extension &amp;lt;code&amp;gt;stx&amp;lt;/code&amp;gt; (for library packages and applications) or &amp;lt;code&amp;gt;sts&amp;lt;/code&amp;gt; (for scripts to be loaded and executed via [[Programmer_Guide/BScript|BScript]]). Examples of scripts can be found in the directory &#039;&#039;&#039;scripts\examples&#039;&#039;&#039; in the {{STX}} installation directory. {{STX}} source files use a &#039;&#039;&#039;section file format&#039;&#039;&#039;, where each section starts with a section header. Each source section delineates a section of source code. The code runs from the header to the next header, or to the end of the file. &lt;br /&gt;
&lt;br /&gt;
==Section header==&lt;br /&gt;
The section header defines the scope, type and the name of the source code contained in the source section. The section header must be enclosed within square brackets, where the opening bracket must be the first character in the line and there must not be any text behind the closing bracket expect comments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The visibilty of a section defines from where the source code object can be accessed, instantiated or called. The following scope keywords are currently supported.&lt;br /&gt;
::;GLOBAL: The section code is visible everywhere. This is the default.&lt;br /&gt;
::;LOCAL: The section code is visible only for code inside the same source file. A local [[#Definition_of_macros|macro]] can only be called, and a local [[#Definition_of_classes|CLASS]] or [[#Definition_of_SPUs|SPU]] can only be instantiated from macros defined in the same source file.&lt;br /&gt;
::;MAIN: Defines the section code as the main macro of an {{STX}} application. A main macro must be called by the system macro [[Programmer_Guide/Macro_Library/APPMAIN|AppMain]]. This keyword is defined for [[#Define_a_Macro|macro]] and [[#Define_a_Class|class]] sections only, and should only be used for the main function of an {{STX}} application but not for scripts.&lt;br /&gt;
::;SHELL: Defines the section code as a shell startup code. This means, the macro implements the startup code of a command interpreter instance (shell) and can only be used in the [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|shell]]. This keyword is defined for  [[#Definition_of_macros|macro]] and [[#Definition_of_Classes|class]] sections only.&lt;br /&gt;
::;MSGHANDLER: Defines a message handler macro, which can only be called from the system macros [[Programmer_Guide/Macro_Library/GETMESSAGE|GetMessage]] or [[Programmer_Guide/Macro_Library/DISPATCHMSG|DispatchMsg]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;: Defines the type of source code in the section. The types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]] are meaningful for the {{STX}} scripting language. Other types can also be used (e.g. to store data) and accessed via the [[Programmer_Guide/Macro_Library/SECTIONFILE|SectionFile]] macro or directly with the [[Programmer_Guide/Shell_Items/File|file item]] functions. The section script processing application uses the special types [[Programmer_Guide/Programming#BScript|libraries]] and [[Programmer_Guide/Programming#BScript|scripts]]. If an unknown section type is detected by the loader, the section is ignored.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt;: The name identifying this source code section. This is used to access the source code later on (e.g. to call a [[Programmer_Guide/Command_Reference/MACRO_and_SHELL|macro]], to create an [[Programmer_Guide/Shell_Items/SPU|spu item]], to create a [[Programmer_Guide/Shell_Items/Instance|instance item]] of a class, to derive a class, ...). . The name must be unique in the namespace where the source code is loaded, which is selected by the section type. Source sections of type [[#Definition_of_macros|macro]] and [[#Definition_of_slasses|class]] are loaded into the same namespace. A separate namespace is used for [[#Definition_of_SPUs|SPU]] items.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt;: The meaning of this part of the header depends on the type of the source section.&lt;br /&gt;
&lt;br /&gt;
The parameters &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssname&amp;lt;/var&amp;gt; are mandatory for the types [[#Definition_of_macros|macro]], [[#Definition_of_classes|class]] and [[#Definition_of_SPUs|SPU]], whilst &amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;ssargs&amp;lt;/var&amp;gt; are optional and depending on &amp;lt;var&amp;gt;sstype&amp;lt;/var&amp;gt;. All keywords, names and other parts of the header are not case-sensitive.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[LOCAL:MACRO MacroExample1]&amp;lt;br&amp;gt;[MACRO MacroExample2 #args]&amp;lt;br&amp;gt;[SPU DSPCircuit1 #in1 #in2 OUT #out1]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Section body==&lt;br /&gt;
The section body consists of statements (at least one is mandatory), empty lines (are ignored) and comments. The section body ends at the next section header or the end of the file. &lt;br /&gt;
&lt;br /&gt;
;comments: A comment is part of the source code which is used for documentation purposes and is ignored by the loader. A comment can be placed anywhere, where a whitespace character is allowed. The standard C++ comment tags can be used in {{STX}} source code.&lt;br /&gt;
:;line comment: starts with the tag &#039;&#039;&#039;//&#039;&#039;&#039; and ends at the end of the same line.&lt;br /&gt;
:;block comment: is opened with the tag &#039;&#039;&#039;/*&#039;&#039;&#039; and closed with the tag &#039;&#039;&#039;*/&#039;&#039;&#039;. A block comment can be spanned over more than one line. If the begin and end tag of a block comment is on the same line, the comment is treated like a whitespace character, otherwise like a &#039;&#039;end of line&#039;&#039;. &lt;br /&gt;
:Note that a comment open tag (&#039;&#039;&#039;//&#039;&#039;&#039; or &#039;&#039;&#039;/*&#039;&#039;&#039;) in a quoted string is interpreted as normal text and not as tag. Its also possible to escape one character of a comment tag (like: &amp;lt;code&amp;gt;`//&amp;lt;/code&amp;gt;) to avoid its interpretation.&lt;br /&gt;
&lt;br /&gt;
;statements: A statement is the part of a line which remains after removing comments, and leading and trailing white space. In macros and classes, statements are label definitions, definitions of local functions or member functions and/or commands. In SPUs, the statements are used to define and connect the circuit elements.&lt;br /&gt;
&lt;br /&gt;
==Definition of Macros==&lt;br /&gt;
====Header====&lt;br /&gt;
A macro is defined by one of the following section headers. The possible formats differ only in the type of argument parsing supplied before the first macro statement is executed. The optional visibility tag is omitted in this description, because it described in detail in the chapter [[#Section_header|section header]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt;]&amp;lt;/code&amp;gt;&lt;br /&gt;
:No argument parsing. The argument parsing must be implemented in the macro body using the [[Programmer_Guide/Command_Reference/READ|READVAR]] and/or the [[Programmer_Guide/Command_Reference/ARG|ARG]] command.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGV&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; {READ:} &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} {seperator1} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:READ-style argument parsing. The arguments are parsed as strings, using the [[Programmer_Guide/Command_Reference/READ|READVAR]] command befor the first statement is executed. The programmer can select arbitrary argument seperators. If an argument value is specified in the call, it is assigned to the argument, otherwise the default value defined in the header is assigned to the argument. A default value must not contain whitespace characters. If more arguments are passed in a macro call than defined in the header, the last argument contains all remaining arguments. If no default value is assigned to an argument, the default value is the &#039;&#039;&#039;empty string&#039;&#039;&#039;. If no seperator is spezified between two arguments, all whitespace characters are used as seperator.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#ARGV&#039;&#039;&#039;, &#039;&#039;&#039;#ARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARG: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;BR&amp;gt;[MACRO macroname ARGS: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARG-style argument parsing. This form uses the ARG command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands without options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[MACRO &amp;lt;var&amp;gt;macroname&amp;lt;/var&amp;gt; ARGOPT: &amp;lt;var&amp;gt;argname1&amp;lt;/var&amp;gt;{=&amp;lt;var&amp;gt;defaultvalue1&amp;lt;/var&amp;gt;} ...]&amp;lt;/code&amp;gt;&lt;br /&gt;
:ARGOPT-style argument parsing. This form uses the [[Programmer_Guide/Command_Reference/ARG|ARG]] command, and stores each argument in the i-th argument variable. The parsing rulses are the same as for build-in commands with options. The [[Programmer_Guide/Command_Reference/ARG|ARG]] command ca be used to access/check options and option values.&lt;br /&gt;
:important variables: &#039;&#039;&#039;#QARGV&#039;&#039;&#039;, &#039;&#039;&#039;#QARGC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For some examples of macros using different argument parsing styles, see the scirpt &amp;lt;code&amp;gt;script\examples\macro argument_parsing_example.sts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
Each macro statement contains one command and/or a &amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;. The command consists of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; and the optional &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The statements are processed line by line. Special [[#Control_statements|control statements]] can be used to change the processing order. The syntax of a statement is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;&#039;&#039;:&#039;&#039;}{{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;label&amp;lt;/var&amp;gt;: A label defines a target which can be used to change the program flow. A label is a string without whitespace and must start with a letter or the underline character (&#039;&#039;_&#039;&#039;). It must be unique within the enclosing macro. If a label is used to define a local subroutine/function that can be called using the ([[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOSUB]] command, its definition can also define whether parameters passed by the caller are processed or not. The argument parsing is defined in brackets with the same syntax and rules as for the macro header.&lt;br /&gt;
::Examples:&lt;br /&gt;
::&amp;lt;code&amp;gt;jumpToMe:&amp;lt;br&amp;gt;callMe(read: #arg1&#039;;&#039;#arg2):&amp;lt;br&amp;gt;callMeWithOptions(argopt: #arg1=1 #arg2 #arg3):&amp;lt;/code&amp;gt;&lt;br /&gt;
:Note: To get a more readable source code, labels and commands should be placed on separated lines.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;: A command string is the command to be executed. It can be a built-in command, a local subroutine call, a macro call, a member function call or a program flow control command. Normally commands are executed in the order of appearance. Program flow control commands can be used to change this order. Before a command string is parsed and the command is executed, three pre-processing steps are applied.&lt;br /&gt;
:;Variable replacement: A part with the format &#039;&#039;&#039;$name&#039;&#039;&#039; is replaced by the value of the variable &#039;&#039;&#039;name&#039;&#039;&#039; or removed if no value is assigned to this variable. The tag character &#039;&#039;&#039;$&#039;&#039;&#039; may occur anywhere in the string. The variable name must be delimited by a non-name character. Multiple or recursive variable replacement is currently not implemented (e.g. it is not possible to replace &#039;&#039;&#039;$$name&#039;&#039;&#039; by the value of the variable referenced by the variable &#039;&#039;&#039;name&#039;&#039;&#039;).&lt;br /&gt;
:;Inline command: If a part with the format &#039;&#039;&#039;$(text)&#039;&#039;&#039; is detected, the command line part &#039;&#039;&#039;text&#039;&#039;&#039; is separated and treated as a command. The format of the inline command &#039;&#039;&#039;text&#039;&#039;&#039; is: &amp;lt;code&amp;gt;{&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt; :=} &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. At the end of the execution of the inline command, the string &#039;&#039;&#039;$(text)&#039;&#039;&#039; is replaced by the result of the inline command. Inline commands can be nested. &lt;br /&gt;
:;[[Programmer_Guide/Shell_Items|Shell item]] replacement: &lt;br /&gt;
::*Any part of a command string with the format &#039;&#039;&#039;name[?]&#039;&#039;&#039; is replaced by the type of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. The name must be delimited by a non-name character. This format is often used to select functions according to the type of an item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[]&#039;&#039;&#039; is replaced by the number of attributes of the item &#039;&#039;&#039;name&#039;&#039;&#039;. This syntax element is mainly used to retrieve the number of entries stored in a table item. &lt;br /&gt;
::*Any part of the command string with the format &#039;&#039;&#039;name[!attrid{,subid,...}]&#039;&#039;&#039; is replaced by the value of the addressed attribute of the shell item &#039;&#039;&#039;name&#039;&#039;&#039;. Data and status values or the configuration settings of items can be retrieved using this syntax. Item attributes are replaced after the processing of variables and inline commands in order to provide the possibility of using variables for addressing and identifying an item or attribute.&lt;br /&gt;
:After applying all replacement rules, the resulting command line is a string with the format: &#039;&#039;&#039;cmd&#039;&#039;&#039; or &#039;&#039;&#039;cmd args&#039;&#039;&#039;, where &#039;&#039;&#039;cmd&#039;&#039;&#039; is a non-quoted string separated from &#039;&#039;&#039;args&#039;&#039;&#039; by whitespaces. The string &#039;&#039;&#039;cmd&#039;&#039;&#039; must be an executable command and &#039;&#039;&#039;args&#039;&#039;&#039; contains the arguments and options for the command.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;: If this optional part is specified, it is used as target for the result of the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt;. The same replacement rules as described above are applied, but the resulting string is used as name/id of a target and not as executable command. This means the result of the command defined by the &amp;lt;var&amp;gt;commandstring&amp;lt;/var&amp;gt; is assigned to the target defined by the &amp;lt;var&amp;gt;targetstring&amp;lt;/var&amp;gt;. The assignment format can not be used with the most control commands (like IF, FOR, GOTO), because they do not have a result value.&lt;br /&gt;
&lt;br /&gt;
==Definition of Classes==&lt;br /&gt;
{{STX}} classes are actually macros with built-in functionality for instantiation, destruction and message handling. The implementation of classes and object oriented programming is based on the class source code (described here) and the [[Programmer_Guide/Shell_Items/Instance|instance items]], which implements the runtime instance of a class.&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
A class is defined by the following section header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[{&amp;lt;var&amp;gt;visiblity&amp;lt;/var&amp;gt;:}CLASS classname {parentclass}]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;visibility&amp;lt;/var&amp;gt;: The [[#Section_header|visibilty]] defines from where the class can be instantiated or called.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;classname&amp;lt;/var&amp;gt;: The name of the class.&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;parentclass&amp;lt;/var&amp;gt;: The name of the parent class. If not specified, the class has no parent class. It is recommened that classes are directly or indirectly derived from [[Programmer_Guide/Class_Library/CObj|CObj]]. If [[Programmer_Guide/Class_Library/CObj|CObj]] is not used as base class, some standard functionalities (like message handling, serialisation, ..) are not available to the class.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
In {{STX}} a class is a [[#Definition_of_macros|macro]] with some special features. Therefore the statements are defined and processed in the same way as for [[#Definition_of_macros|macro]]. The only (but big) difference is, that the class source code contains the definitions of the member functions. The member functions define the behaviour of the instances of a class. Member functions are defined as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;_&amp;lt;var&amp;gt;functionname&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;scope&amp;lt;/var&amp;gt;: The scope defines from where a member function can be called. The following scopes are defined:&lt;br /&gt;
:*&#039;&#039;&#039;public&#039;&#039;&#039;: The function can be called from macros and from instances of all other classes.&lt;br /&gt;
:*&#039;&#039;&#039;proteced&#039;&#039;&#039;: The function can be called from instances of same class and from instances of classes derived from this class.&lt;br /&gt;
:*&#039;&#039;&#039;private&#039;&#039;&#039;: The function can only be called from instances of the same class.&lt;br /&gt;
&lt;br /&gt;
;functionname: This is the name of member function which must be specified in the call.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*All &#039;&#039;&#039;public&#039;&#039; and &#039;&#039;&#039;protected&#039;&#039;&#039; member functions are virtual. This means they can be overridden in derived classes.&lt;br /&gt;
*The definition of a member function looks like a label in a macro, but can not be used as label. It defines the entry of a member function but not a target for [[Programmer_Guide/Command_Reference/GOTO_and_GOSUB|GOTO or GOSUB]] commands.&lt;br /&gt;
*It is possible to include the defintion of the argument parsing in the definition of a member function as described for local subroutines of [[#Definition_of_macros|macros].&lt;br /&gt;
*Like local subroutines, a member function must be terminated with an [[Programmer_Guide/Command_Reference/EXIT|EXIT]].&lt;br /&gt;
*A class can be used like a macro. This means if the name of a class is specified as command it is called like a macro. This feature can be used to implement &#039;&#039;static&#039;&#039; functions.&lt;br /&gt;
&lt;br /&gt;
==Definition of SPUs==&lt;br /&gt;
A signal processing unit (SPU) defines a circuit consisting of elements and connections that can be used to perform a signal processing task. Like a class, the SPU source code defines the prototype of a circuit. The corresponding runtime instance is the [[Programmer_Guide/Shell_Items/SPU|SPU item]].&lt;br /&gt;
&lt;br /&gt;
====Header====&lt;br /&gt;
&amp;lt;code&amp;gt;[SPU &amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt; {&amp;lt;var&amp;gt;arg1&amp;lt;/var&amp;gt; ...} OUT {&amp;lt;var&amp;gt;out1&amp;lt;/var&amp;gt; ...}]&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;name&amp;lt;/var&amp;gt;: The name (&#039;&#039;class&#039;&#039;) of the SPU. This name is used to refer to this circuit in other SPU sources and for the [[Programmer_Guide/Shell_Items/SPU/SPU_Item_Creation|instantiation of SPU items]].&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;arg1, ...&amp;lt;/var&amp;gt;: The argument list. Each argument is separated from the previous one by a whitespace. The arguments provide the SPU with parameters. Parameters can be either numeric constants or strings (e.g. the name of a soundfile or a data file, the name of a wave-item, the id of a shell-item output, the output name of a value- or spu-item etc.). A list of arguments is optional (i.e. an SPUnit does not necessarily have to act on input data; e.g. signal/data sources like a noise generator)&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;var&amp;gt;out1, ...&amp;lt;/var&amp;gt;: The outputs list declares the names of all the outputs of the SPU. Each name is separated from the next by a whitespace. The type of data assigned to each output is defined in the output assignments where they are connected to element outputs.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
*The names of arguments, outputs and elements must be unique within the SPU source code (i.e. you cannot use an argument name for an output name).&lt;br /&gt;
*Either the argument list or the output list can be empty, but not both.&lt;br /&gt;
&lt;br /&gt;
====Statements====&lt;br /&gt;
The statements of the SPU source code can be grouped into four categories.&lt;br /&gt;
&lt;br /&gt;
;default argument assignments:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:This statement assigns the default value &amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt; to the argument &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;. This value is used if no value is given for this argument on instantiation. The default value must be a numeric constant or a string (e.g. 5 or &#039;a string&#039;). Assigning default values is optional. An argument without a default value, however, must be passed. Default values are used in reverse order. If two arguments are passed, where four have been defined, the third and fourth arguments are assigned their default values. The default values must be assigned before the argument is used (e.g. in a function statement).&lt;br /&gt;
:;STx 4.0: The default values can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;valueX&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for argument seperation.&lt;br /&gt;
&lt;br /&gt;
;definition statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;elementX = typeX&amp;lt;/code&amp;gt;&lt;br /&gt;
:A definition statement defines the name &amp;lt;var&amp;gt;elementX&amp;lt;/var&amp;gt; and the type (class) &amp;lt;var&amp;gt;typeX&amp;lt;/var&amp;gt; of a element of an SPU. This element is local to this SPU (i.e. is not visible outside of the SPU). Any signal processing atom or SPU can be used for &amp;lt;var&amp;gt;typeY&amp;lt;/var&amp;gt;. All SPU used in the source code must be loaded before instantiating an SPU item. Once an element is defined it can be used in the function statements and output assignments.&lt;br /&gt;
&lt;br /&gt;
;function statement:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX arguments&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The function statements interconnect and &#039;execute&#039; the elements. The arguments passed to the element are processed within the element and returned to the element&#039;s outputs. The element&#039;s arguments can be numerical constants, strings, the outputs from other elements, or the SPU&#039;s input arguments. They must be passed in the same sequence as defined in the element type&#039;s declaration. The function statements implement the interconnection between the SPU elements. Elements must be defined before they can be used. Parsing rules for element arguments:&lt;br /&gt;
::*&#039;&#039;&#039;$&#039;&#039;&#039;&amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is replaced by the value of &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; (where &amp;lt;var&amp;gt;argX&amp;lt;/var&amp;gt; is a name from the argument list)&lt;br /&gt;
::*arguments passed to an element are separated by blank spaces&lt;br /&gt;
::*arguments enclosed in quotes can themselves contain spaces&lt;br /&gt;
:;STx 4.0: It is now possible to use input assignments in the function statements, instead of the ordered list of input values.&lt;br /&gt;
::&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;elementX inY=argument&amp;lt;/var&amp;gt; ... &amp;lt;/code&amp;gt;&lt;br /&gt;
::Both function statement formats can be used inside a SPUnit source section, but the new should be prefered. If the assignment format is used, it is not necessary to specify the inputs in the right order.&lt;br /&gt;
&lt;br /&gt;
;output assignment:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt; = &amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:The output assignments determine which element outputs are made available at the SPU outputs (to be connected to shell items or used in other SPU&#039;s using this SPU as an element). Every SPU output must have one output statement. An element output, however, can be assigned to more than one SPUnit output. Elements must be defined before they can be connected to outputs.&lt;br /&gt;
:;STx 4.0: The outputs can be assigned in the header using the syntax &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;outX&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;elementY.outZ&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. The whole assignment must not contain a whitespace, because whitespaces are used for  seperation. This is the only case where an element can be used before it is defined!&lt;br /&gt;
&lt;br /&gt;
==Escape- and Continuatuion character==&lt;br /&gt;
In some cases tag- or parsing characters should be used as normal characters (e.g. arguments for commands or a part of a string). In this case the &#039;&#039;&#039;escape character&#039;&#039;&#039; &#039;&#039;`&#039;&#039; (back-quote) can be used to suppress the interpretation of the following character.&lt;br /&gt;
&lt;br /&gt;
The escape character has a special meaning if it is the last character on a line. In this case it is interpreted as &#039;&#039;&#039;continuation character&#039;&#039;&#039; and the next line is concatenated to the current. This feature can be used to concatenate two or more lines. Concatenation applies to statements but also to section headers.&lt;br /&gt;
&lt;br /&gt;
==Preprocessing==&lt;br /&gt;
The {{STX}} preprocessor may be used for conditionally skipping or including parts of an {{STX}} source file depending on which preprocessor constants have been defined (and which haven&#039;t). In the directory script\examples, you will find a script called &#039;&#039;&#039;preprocessor.sts&#039;&#039;&#039; showing several ways of using the preprocessor.&lt;br /&gt;
&lt;br /&gt;
Every preprocessor command must start either with the character &#039;&#039;&#039;!&#039;&#039;&#039; (exclamation mark), or with the character &#039;&#039;&#039;]&#039;&#039;&#039; (closed square bracket). Although not strictly enforced (the preprocessor only issues a warning otherwise), either character should be placed in the very first column of the respective line.&lt;br /&gt;
&lt;br /&gt;
For defining and undefining a preprocessor constant, there are the preprocessor commands &#039;&#039;&#039;define&#039;&#039;&#039; and &#039;&#039;&#039;undef&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;! define CONSTANT1&lt;br /&gt;
! define CONSTANT2&lt;br /&gt;
! undef CONSTANT1&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Like the most other keywords and names used in STx, preprocessor statements and constants are case-insensitive, meaning that &#039;&#039;&#039;CONSTANT1&#039;&#039;&#039;, &#039;&#039;&#039;constant1&#039;&#039;&#039;, and &#039;&#039;&#039;CoNsTaNt1&#039;&#039;&#039; are the same constant.&lt;br /&gt;
:*Note that (for the time being), the only property of preprocessor constants is their being defined or being undefined. It is currently not possible (since it would currently make no sense) to assign a value to a constant.&lt;br /&gt;
&lt;br /&gt;
The conditional &#039;&#039;&#039;ifdef&#039;&#039;&#039;, &#039;&#039;&#039;elif&#039;&#039;&#039;, &#039;&#039;&#039;else&#039;&#039;&#039;, and &#039;&#039;&#039;endif&#039;&#039;&#039; preprocessor statements cause the macro interpreter conditionally to skip part of the macro source code. See for yourself:&lt;br /&gt;
&amp;lt;pre&amp;gt;! ifdef CONSTANT&lt;br /&gt;
writelog &#039;This statement will be executed if CONSTANT is defined&#039;&lt;br /&gt;
! else&lt;br /&gt;
writelog &#039;This statement will be executed unless CONSTANT is defined&#039;&lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the &#039;&#039;&#039;if&#039;&#039;&#039; command, there is also support for complex conditions:&lt;br /&gt;
&amp;lt;pre&amp;gt;! if defined(CONS1) || defined(CONS2) &amp;amp;&amp;amp; defined(CONS3)	&lt;br /&gt;
writelog &#039;This statement will be executed if either CONS1 or both of CONS2 and CONS3 are defined&#039; &lt;br /&gt;
! elif defined CONS4 &amp;amp;&amp;amp; ! defined CONS5	&lt;br /&gt;
writelog &#039;This statement will be executed if the preceding statement is not, and if CONS4 is defined and CONS5 is not &lt;br /&gt;
! else	&lt;br /&gt;
writelog &#039;This statement will be executed if neither of the preceding statements were&#039; &lt;br /&gt;
! endif&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*You may, but need not enclose the argument of the &#039;&#039;&#039;defined&#039;&#039;&#039; function (i.e. the name of a constant) in brackets. &lt;br /&gt;
:*You may build up complex expressions with the &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; (and), &#039;&#039;&#039;||&#039;&#039;&#039; (or), and the &#039;&#039;&#039;!&#039;&#039;&#039; (not) operator. &lt;br /&gt;
&lt;br /&gt;
Unlike in other conditional expressions used in {{STX}} (e.g. the [[Programmer_Guide/Command_Reference/IF|IF command]]) which are evaluated strictly from left to right, you can group expressions with brackets. If you do not use brackets, &#039;&#039;&#039;&amp;amp;&amp;amp;&#039;&#039;&#039; will take precedence over &#039;&#039;&#039;||&#039;&#039;&#039;, as it normally does (and contrary to what {{STX}} normally does due to historical reasons).&lt;br /&gt;
&amp;lt;pre&amp;gt;! if (defined(CONS1) || defined CONS2) &amp;amp;&amp;amp; (defined(CONS3) ||defined(CONS4))&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a few additional preprocessor statements you may find useful:&lt;br /&gt;
&lt;br /&gt;
:;&amp;lt;code&amp;gt;!include &amp;lt;var&amp;gt;filepath&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: With the include statement, you may textually merge some other files into the current macro (just like with the &amp;quot;#include&amp;quot; preprocessor statement in C, or with COBOL copy books). Note that it is (for obvious reasons) not possible for a file to include itself, or to include a file that includes a file that, in turn, includes a file including the first file. If you try to, macro interpretation will abort with an error message. If the file name supplied to the include statement is not an absolute path, the preprocessor will first look for the respective relative path in the current directory and, on failure, will look for it in directory where the including file is situated. Note that, for the time being, file inclusion may not be nested for more than forty-two levels.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!showdef&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;!showdef &amp;lt;var&amp;gt;constant&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: Without arguments, this command will print a list of all preprocessor constants currently defined. With an argument supplied, the command will show if the argument is a preprocessor constant that is currently defined.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!warn &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the script loader to display a user-defined warning message. Execution of the script is not impaired by issuing a warning.&lt;br /&gt;
:;&amp;lt;code&amp;gt;!error &amp;lt;var&amp;gt;msg&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;: This statement causes the {{STX}} script loader to issue a user-defined error message and to cancel loading the source file.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/Project&amp;diff=7094</id>
		<title>User Guide/Project</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/Project&amp;diff=7094"/>
		<updated>2014-05-08T14:18:56Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=unordered&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/Spectrogram_and_Parameter_Viewer&amp;diff=7093</id>
		<title>User Guide/Spectrogram and Parameter Viewer</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/Spectrogram_and_Parameter_Viewer&amp;diff=7093"/>
		<updated>2014-05-08T14:18:30Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=unordered&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/SPExL/Transcription_Script&amp;diff=7091</id>
		<title>User Guide/SPExL/Transcription Script</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/SPExL/Transcription_Script&amp;diff=7091"/>
		<updated>2014-05-08T14:17:51Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=unordered&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=7090</id>
		<title>User Guide</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide&amp;diff=7090"/>
		<updated>2014-05-08T14:17:31Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=unordered&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C.G. 20110420: &#039;&#039;Information bitte an geeigneter Stelle unterbringen&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* Problem Deutsch-PC - Stereo-Mixer unter Windows 7 - ist leicht zu lösen, &#039;&#039;wennnn&#039;&#039; der Hardwarehersteller ordentliche Treiber ausliefert. Gedankensplitter:&lt;br /&gt;
:* Für die Medion-PCs lassen sich Treiber ganz einfach von http://www.medion.de/ herniederladen.&lt;br /&gt;
:* &#039;&#039;Danach&#039;&#039; lässt sich normalerweise schon der Stereo-Mixer aktivieren (rechte Maustaste auf Lautsprechersymbol im Windows-Tray, &amp;quot;Recording Devices&amp;quot; wählen, dort wieder mit der rechten Maustaste in der Geräteliste &amp;quot;Show disabled devices&amp;quot; und &amp;quot;Show disconnected devices&amp;quot; wählen und... schon ist der Mixer &amp;quot;Stereo Mix&amp;quot; da. Den dann einschalten bzw. als Default setzen.)&lt;br /&gt;
:* Anregungen geben auch (willkürlich herausgegriffen) z.B. http://www.ehow.com/how_6828062_connect-sound-card-output-input.html oder http://forum.audacityteam.org/viewtopic.php?f=12&amp;amp;t=4485#p17655&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/Waveform_and_Segmentation_Viewer&amp;diff=7083</id>
		<title>User Guide/Waveform and Segmentation Viewer</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/Waveform_and_Segmentation_Viewer&amp;diff=7083"/>
		<updated>2014-05-08T14:12:27Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=unordered&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/Workspace&amp;diff=7082</id>
		<title>User Guide/Workspace</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/Workspace&amp;diff=7082"/>
		<updated>2014-05-08T14:11:36Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=unordered&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/FindFile&amp;diff=7080</id>
		<title>User Guide/FindFile</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=User_Guide/FindFile&amp;diff=7080"/>
		<updated>2014-05-08T14:05:48Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=unordered&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/LOGMSG&amp;diff=7071</id>
		<title>Programmer Guide/Command Reference/LOGMSG</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/LOGMSG&amp;diff=7071"/>
		<updated>2014-05-08T13:34:10Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
There is no trace in the whole {{STx}} source code of a command called &amp;lt;code&amp;gt;LOGMSG&amp;lt;/code&amp;gt;, so you&#039;d better not try using such a command.&lt;br /&gt;
 LOGMSG &amp;lt;var&amp;gt;arg&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;&amp;lt;/var&amp;gt; &amp;amp;hellip;&lt;br /&gt;
This will do nothing but produce the error message &amp;quot;ineffective statement&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/LOGMSG&amp;diff=7070</id>
		<title>Programmer Guide/Command Reference/LOGMSG</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/LOGMSG&amp;diff=7070"/>
		<updated>2014-05-08T13:31:32Z</updated>

		<summary type="html">&lt;p&gt;Christian: Created page with &amp;quot;There is no trace in the whole {{STx}} source code of a command called &amp;lt;code&amp;gt;LOGMSG&amp;lt;/code&amp;gt;, so you&amp;#039;d better not try using such a command.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is no trace in the whole {{STx}} source code of a command called &amp;lt;code&amp;gt;LOGMSG&amp;lt;/code&amp;gt;, so you&#039;d better not try using such a command.&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/WRITELOG&amp;diff=7069</id>
		<title>Programmer Guide/Command Reference/WRITELOG</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/WRITELOG&amp;diff=7069"/>
		<updated>2014-05-08T13:30:26Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
 WRITELOG &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt; [/Newline &amp;amp;hellip; /Newline]&lt;br /&gt;
 WRITELOG &amp;lt;var&amp;gt;format&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;args&amp;lt;/var&amp;gt; /Format [/Newline &amp;amp;hellip; /Newline]&lt;br /&gt;
 &lt;br /&gt;
 WRITELOG [/Newline &amp;amp;hellip; /Newline] [[Programmer_Guide/Command_Reference_Options/-|/-]] &amp;lt;var&amp;gt;file&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt;&lt;br /&gt;
 WRITELOG /Format [/Newline &amp;amp;hellip; /Newline] [[Programmer_Guide/Command_Reference_Options/-|/-]] &amp;lt;var&amp;gt;file&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;format&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;args&amp;lt;/var&amp;gt;&lt;br /&gt;
This {{Stx}} command writes a line of text to the log window (the tiny baby window you normally wonder what it is good for). Use &amp;lt;code&amp;gt;/Clear&amp;lt;/code&amp;gt; to empty the log window before text is written.&lt;br /&gt;
&lt;br /&gt;
Format strings (the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; when using the &amp;lt;code&amp;gt;/Format&amp;lt;/code&amp;gt; option) are described in [[Programmer_Guide/General_Descriptions/Format_Strings_and_Rules|Format Strings and Rules]].&lt;br /&gt;
&lt;br /&gt;
Generally, the arguments to the &amp;lt;code&amp;gt;WRITELOG&amp;lt;/code&amp;gt; command are the same as for the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference/WRITE|WRITE]]&amp;lt;/code&amp;gt; command. Refer to the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference/WRITE|WRITE]]&amp;lt;/code&amp;gt; documentation for more details.&lt;br /&gt;
&lt;br /&gt;
Instead of the &amp;lt;code&amp;gt;WRITELOG&amp;lt;/code&amp;gt; command, you may use the macros &amp;lt;code&amp;gt;[[Programmer Guide/Command Reference/LOGMSG|LOGMSG]]&amp;lt;/code&amp;gt; (believe me - there is no such command in the whole {{Stx}} source&amp;amp;hellip;) or &amp;lt;code&amp;gt;[[Programmer_Guide/Macro_Library/BUTIL#LOGMSG|BUTIL LOGMSG]]&amp;lt;/code&amp;gt;, which append some useful information to the text (e.g. the application nameand the date and time of emitting the message).&lt;br /&gt;
&lt;br /&gt;
If you want to show your message more interactively (i.e., in a dialog box), you may consider the {{STx}} functions [[Programmer_Guide/Macro_Library/StdLib#UM_and_EM|&amp;lt;code&amp;gt;UM&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EM&amp;lt;/code&amp;gt;]].&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/WRITELOG&amp;diff=7068</id>
		<title>Programmer Guide/Command Reference/WRITELOG</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference/WRITELOG&amp;diff=7068"/>
		<updated>2014-05-08T13:25:14Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
 WRITELOG &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt; [/Newline &amp;amp;hellip; /Newline]&lt;br /&gt;
 WRITELOG &amp;lt;var&amp;gt;format&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;args&amp;lt;/var&amp;gt; /Format [/Newline &amp;amp;hellip; /Newline]&lt;br /&gt;
 &lt;br /&gt;
 WRITELOG [/Newline &amp;amp;hellip; /Newline] [[Programmer_Guide/Command_Reference_Options/-|/-]] &amp;lt;var&amp;gt;file&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;text&amp;lt;/var&amp;gt;&lt;br /&gt;
 WRITELOG /Format [/Newline &amp;amp;hellip; /Newline] [[Programmer_Guide/Command_Reference_Options/-|/-]] &amp;lt;var&amp;gt;file&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;format&amp;lt;/var&amp;gt; &amp;lt;var&amp;gt;args&amp;lt;/var&amp;gt;&lt;br /&gt;
This {{Stx}} command writes a line of text to the log window (the tiny baby window you normally wonder what it is good for). Use &amp;lt;code&amp;gt;/Clear&amp;lt;/code&amp;gt; to empty the log window before text is written.&lt;br /&gt;
&lt;br /&gt;
Format strings (the &amp;lt;code&amp;gt;format&amp;lt;/code&amp;gt; when using the &amp;lt;code&amp;gt;/Format&amp;lt;/code&amp;gt; option) are described in [[Programmer_Guide/General_Descriptions/Format_Strings_and_Rules|Format Strings and Rules]].&lt;br /&gt;
&lt;br /&gt;
Generally, the arguments to the &amp;lt;code&amp;gt;WRITELOG&amp;lt;/code&amp;gt; command are the same as for the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference/WRITE|WRITE]]&amp;lt;/code&amp;gt; command. Refer to the &amp;lt;code&amp;gt;[[Programmer_Guide/Command_Reference/WRITE|WRITE]]&amp;lt;/code&amp;gt; documentation for more details.&lt;br /&gt;
&lt;br /&gt;
Instead of the &amp;lt;code&amp;gt;WRITELOG&amp;lt;/code&amp;gt; command, you may use the macros &amp;lt;code&amp;gt;[[Programmer Guide/Command Reference/LOGMSG|LOGMSG]]&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;[[Programmer_Guide/Macro_Library/BUTIL#LOGMSG|BUTIL LOGMSG]]&amp;lt;/code&amp;gt;, which append some useful information to the text (e.g. the application nameand the date and time of emitting the message).&lt;br /&gt;
&lt;br /&gt;
If you want to show your message more interactively (i.e., in a dialog box), you may consider the {{STx}} functions [[Programmer_Guide/Macro_Library/StdLib#UM_and_EM|&amp;lt;code&amp;gt;UM&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EM&amp;lt;/code&amp;gt;]].&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference&amp;diff=7067</id>
		<title>Programmer Guide/Command Reference</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference&amp;diff=7067"/>
		<updated>2014-05-08T13:21:41Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{SUBPAGENAME}}}}&lt;br /&gt;
The {{STx}} command reference documents all the commands available in the {{STX}} macro language. This is with the notable exception of the {{Stx}} shell item commands, which are documented in the chapter [[Programmer_Guide/Shell_Items|Shell Items]].&lt;br /&gt;
&lt;br /&gt;
Each {{STx}} command generates both a &#039;&#039;result value&#039;&#039; (the return value of the command) and a &#039;&#039;completion code&#039;&#039;, the latter indicating success or failure of the command. The completion code is stored in the shell variables &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; (a numerical error or warning code, 0 indicating success) and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt; (textual error message according to value of &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
;Notes:&lt;br /&gt;
:* You should make it a habit to always end the list of options with the [[Programmer_Guide/Command_Reference_Options/-|&amp;quot;end of options&amp;quot; option, &amp;lt;code&amp;gt;/-&amp;lt;/code&amp;gt;]] (q.v.) because, otherwise, you will get into trouble when command arguments start with a slash.&lt;br /&gt;
:*Most commands overwrite the variables &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt;. There are a few commands, though, which touch &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt; only if an execution error occours. The most prominent commands in the latter group are [[/IF|IF]] and [[/GOTO|GOTO]] and, actually, most other control commands.&lt;br /&gt;
:* Some commands return the completion code also as their return value.&lt;br /&gt;
:* In contrast to commands, &#039;&#039;macros&#039;&#039; store their return value (generated with the [[/EXIT|EXIT]] command) in the variable &amp;lt;var&amp;gt;RESULT&amp;lt;/var&amp;gt;, meaning that macro calls do not affect the variables &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;See also: [[Programmer_Guide/Introduction|Introduction]], [[Programmer_Guide/Shell_Items|shell items]]&lt;br /&gt;
&lt;br /&gt;
== {{STx|caps}} commands (alphabetical list) ==&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=Programmer_Guide/Command_Reference&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=bar&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&amp;lt;/splist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common {{STX}} options ==&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=Programmer_Guide/Command_Reference_Options&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=unordered&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&amp;lt;/splist&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference&amp;diff=7066</id>
		<title>Programmer Guide/Command Reference</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference&amp;diff=7066"/>
		<updated>2014-05-08T13:20:36Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{STX|Caps}} {{SUBPAGENAME}}}}&lt;br /&gt;
The command reference documents all the commands available in the {{STX}} macro language. This is with the notable exception of the {{Stx}} shell item commands, which are documented in the chapter [[Programmer_Guide/Shell_Items|Shell Items]].&lt;br /&gt;
&lt;br /&gt;
Each {{STx}} command generates both a &#039;&#039;result value&#039;&#039; (the return value of the command) and a &#039;&#039;completion code&#039;&#039;, the latter indicating success or failure of the command. The completion code is stored in the shell variables &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; (a numerical error or warning code, 0 indicating success) and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt; (textual error message according to value of &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
;Notes:&lt;br /&gt;
:* You should make it a habit to always end the list of options with the [[Programmer_Guide/Command_Reference_Options/-|&amp;quot;end of options&amp;quot; option, &amp;lt;code&amp;gt;/-&amp;lt;/code&amp;gt;]] (q.v.) because, otherwise, you will get into trouble when command arguments start with a slash.&lt;br /&gt;
:*Most commands overwrite the variables &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt;. There are a few commands, though, which touch &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt; only if an execution error occours. The most prominent commands in the latter group are [[/IF|IF]] and [[/GOTO|GOTO]] and, actually, most other control commands.&lt;br /&gt;
:* Some commands return the completion code also as their return value.&lt;br /&gt;
:* In contrast to commands, &#039;&#039;macros&#039;&#039; store their return value (generated with the [[/EXIT|EXIT]] command) in the variable &amp;lt;var&amp;gt;RESULT&amp;lt;/var&amp;gt;, meaning that macro calls do not affect the variables &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;See also: [[Programmer_Guide/Introduction|Introduction]], [[Programmer_Guide/Shell_Items|shell items]]&lt;br /&gt;
&lt;br /&gt;
== {{STx|caps}} commands (alphabetical list) ==&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=Programmer_Guide/Command_Reference&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=bar&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&amp;lt;/splist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common {{STX}} options ==&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=Programmer_Guide/Command_Reference_Options&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=unordered&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&amp;lt;/splist&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference&amp;diff=7065</id>
		<title>Programmer Guide/Command Reference</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.kfs.oeaw.ac.at/stx/docs/wiki/index.php?title=Programmer_Guide/Command_Reference&amp;diff=7065"/>
		<updated>2014-05-08T13:20:09Z</updated>

		<summary type="html">&lt;p&gt;Christian: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:{{STX|caps}} {{SUBPAGENAME}}}}&lt;br /&gt;
The command reference documents all the commands available in the {{STX}} macro language. This is with the notable exception of the {{Stx}} shell item commands, which are documented in the chapter [[Programmer_Guide/Shell_Items|Shell Items]].&lt;br /&gt;
&lt;br /&gt;
Each {{STx}} command generates both a &#039;&#039;result value&#039;&#039; (the return value of the command) and a &#039;&#039;completion code&#039;&#039;, the latter indicating success or failure of the command. The completion code is stored in the shell variables &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; (a numerical error or warning code, 0 indicating success) and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt; (textual error message according to value of &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
;Notes:&lt;br /&gt;
:* You should make it a habit to always end the list of options with the [[Programmer_Guide/Command_Reference_Options/-|&amp;quot;end of options&amp;quot; option, &amp;lt;code&amp;gt;/-&amp;lt;/code&amp;gt;]] (q.v.) because, otherwise, you will get into trouble when command arguments start with a slash.&lt;br /&gt;
:*Most commands overwrite the variables &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt;. There are a few commands, though, which touch &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt; only if an execution error occours. The most prominent commands in the latter group are [[/IF|IF]] and [[/GOTO|GOTO]] and, actually, most other control commands.&lt;br /&gt;
:* Some commands return the completion code also as their return value.&lt;br /&gt;
:* In contrast to commands, &#039;&#039;macros&#039;&#039; store their return value (generated with the [[/EXIT|EXIT]] command) in the variable &amp;lt;var&amp;gt;RESULT&amp;lt;/var&amp;gt;, meaning that macro calls do not affect the variables &amp;lt;var&amp;gt;RC&amp;lt;/var&amp;gt; and &amp;lt;var&amp;gt;EMSG&amp;lt;/var&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;See also: [[Programmer_Guide/Introduction|Introduction]], [[Programmer_Guide/Shell_Items|shell items]]&lt;br /&gt;
&lt;br /&gt;
== {{STx|caps}} commands (alphabetical list) ==&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=Programmer_Guide/Command_Reference&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=bar&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&amp;lt;/splist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common {{STX}} options ==&lt;br /&gt;
&amp;lt;splist&lt;br /&gt;
parent=Programmer_Guide/Command_Reference_Options&lt;br /&gt;
sort=asc&lt;br /&gt;
sortby=title&lt;br /&gt;
showpath=no&lt;br /&gt;
liststyle=unordered&lt;br /&gt;
kidsonly=yes&lt;br /&gt;
&amp;gt;&amp;lt;/splist&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christian</name></author>
	</entry>
</feed>