macros:function_syntax
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
macros:function_syntax [2017/10/29 16:26] – ↷ Page moved from function_syntax to macros:function_syntax icke_siegen | macros:function_syntax [2018/08/27 17:14] (current) – ↷ Links adapted because of a move operation icke_siegen | ||
---|---|---|---|
Line 8: | Line 8: | ||
* the function has a name, and most likely this name already describes (very briefly) what this function does. It is reasonable to assume that a function named '' | * the function has a name, and most likely this name already describes (very briefly) what this function does. It is reasonable to assume that a function named '' | ||
- | * in our situation with hundreds of functions it's very helpful that functions are classified in [[: | + | * in our situation with hundreds of functions it's very helpful that functions are classified in [[macros: |
* by convention, each function is denoted by a pair of brackets, even if there is nothing in them. '' | * by convention, each function is denoted by a pair of brackets, even if there is nothing in them. '' | ||
* most functions accept parameters (a.k.a. arguments) which tell the function what exactly to do, or with what to do it. In the above example of course we need to tell the delete() functions which playback or fixture exactly to delete. Hence we would write something like '' | * most functions accept parameters (a.k.a. arguments) which tell the function what exactly to do, or with what to do it. In the above example of course we need to tell the delete() functions which playback or fixture exactly to delete. Hence we would write something like '' | ||
- | * more generally, when describing a function' | + | * more generally, when describing a function' |
* if the function expects more than one parameter, the type/ | * if the function expects more than one parameter, the type/ | ||
- | * finally, while many functions on Titan just do something (without letting you know), there are others which give back a value: the return value. Again in an attempt to do it as generally as possible, we always denote the type of return value before the function itself - and for those functions which do not return anything the type of the return value is [[: | + | * finally, while many functions on Titan just do something (without letting you know), there are others which give back a value: the return value. Again in an attempt to do it as generally as possible, we always denote the type of return value before the function itself - and for those functions which do not return anything the type of the return value is [[macros: |
Putting this to use we can now at least make something out of the above mentioned function: | Putting this to use we can now at least make something out of the above mentioned function: | ||
* '' | * '' | ||
- | * '' | + | * '' |
* '' | * '' | ||
* finally, inside the pair of brackets, we have three pairs of type/ | * finally, inside the pair of brackets, we have three pairs of type/ | ||
- | * a [[type: | + | * a [[macros:type: |
- | * an [[type:Int32]] which denotes the index (which exactly needs to be explained separately) | + | * an [[macros:type:int32]] which denotes the index (which exactly needs to be explained separately) |
- | * and finally the userNumber which needs to be given as [[type:AcwUserNumber]] which probably is an [[type: | + | * and finally the userNumber which needs to be given as [[macros:type:object: |
If you want to cross-check: | If you want to cross-check: | ||
Line 46: | Line 46: | ||
see http:// | see http:// | ||
- | All the Math.Cast functions do explicitely change a value' | + | All the Math.Cast functions do explicitely change a value' |
==== functions as parameter - nested functions ==== | ==== functions as parameter - nested functions ==== | ||
- | The [[example:changexfade|example changexfade]] takes this a step further: | + | The [[macros:example:changechaseroverlap|example changexfade]] takes this a step further: |
ActionScript.SetProperty(" | ActionScript.SetProperty(" | ||
* the **outer** function '' | * the **outer** function '' | ||
- | * in this case, this value needs to be a [[type: | + | * in this case, this value needs to be a [[macros:type: |
* hence, we use this casting function '' | * hence, we use this casting function '' | ||
* ... and use this function as **inner** function by putting it as parameter for the outer function | * ... and use this function as **inner** function by putting it as parameter for the outer function | ||
Line 64: | Line 64: | ||
CueLists.GoBack(" | CueLists.GoBack(" | ||
| | ||
- | See [[example: | + | See [[macros:example: |
- | At first glance this looks like more parameters in the brackets - but it isn't. The commas are inside the double quotes which make the entire part one string: ''" | + | At first glance this looks like more parameters in the brackets - but it isn't. The commas are inside the double quotes which make the entire part one string: ''" |
---- | ---- |
macros/function_syntax.1509294384.txt.gz · Last modified: 2017/10/29 16:26 by icke_siegen