This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
beyond:pangoscript [2020/05/26 16:18] Bob Varkevisser |
beyond:pangoscript [2020/05/27 16:17] Bob Varkevisser |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ~~DRAFT~~ | ||
+ | |||
====== PangoScript ====== | ====== PangoScript ====== | ||
Line 20: | Line 22: | ||
===== Special characters (separators) ===== | ===== Special characters (separators) ===== | ||
- | ' | + | . ; ' : ! � ^ + - * \ [ ] ( ) { } ? % | & = |
- | ' | + | |
===== Predefined constants ===== | ===== Predefined constants ===== | ||
Line 43: | Line 44: | ||
===== Math operations (expressions) ===== | ===== Math operations (expressions) ===== | ||
- | * Standard : + , - , / , * , % | + | * Standard : + - / * % |
* Inversion : ! | * Inversion : ! | ||
* bit OR : | | * bit OR : | | ||
Line 55: | Line 56: | ||
- | ==== IF operator | + | ==== IF ==== |
- | + | Syntax: if (expression) operator | |
- | Syntax: if ( expression ) operator | + | |
expression - covered with brackets. Must be an expression with | expression - covered with brackets. Must be an expression with | ||
numerical result that gives " | numerical result that gives " | ||
- | variable it's possible to write "if (variable) ...". | + | variable it's possible to write |
- | Compare operators are: ">" | + | if (variable) |
- | You can combine comparing operations with "&" | + | Compare |
- | operator will be executed if condition gets non-zero result. If you want to place other operator after "if (condition) operator" | + | You can combine comparing operations with "&" |
- | GOTO operator | + | if ((1>2) & ((3+2)> |
- | Syntax: | + | operator will be executed if condition gets non-zero result. If you want to place other operator after |
+ | if (condition) operator | ||
+ | it must be divided with ; but it's better to place next operator on the next line. | ||
- | " | + | ==== GOTO ==== |
- | mylabel: WaitForBeat 4 | + | Syntax: goto label |
- | ... do something... | + | |
- | goto mylabel | + | |
+ | " | ||
- | Operator GOTO can work with the labels inside the string variables. It means that you declare string variable, assign a label name to variable, and then you a variable in GOTO. | + | mylabel: WaitForBeat 4 |
- | Example: | + | ... do something... |
+ | goto mylabel | ||
- | var s | + | Operator GOTO can work with the labels inside the string variables. It means that you declare string variable, assign a label name to variable, and then you a variable in GOTO. Example: |
- | s=" | + | |
- | goto s | + | |
- | DisplayPopup "It does not work" | + | var s |
- | exit | + | s=" |
+ | goto s | ||
+ | | ||
+ | exit | ||
+ | |||
+ | mylabel: | ||
+ | DisplayPopup "It works" | ||
+ | |||
+ | ==== VAR ==== | ||
- | mylabel: | ||
- | DisplayPopup "It works" | ||
+ | PangoScript allow define local variables. The lifetime for the local variable defined by lifetime of the Scripter that execute PangoScript. As soon as the Scripter freed, all its local variables are removed as well. | ||
+ | All variables must be declared before the using. No need to specify the type of variable. The variable automatically adjust the type depending on value. Internally supported integer, float and string variables. | ||
+ | var MyVariable | ||
+ | var a,b,c | ||
- | VAR operator | + | Before using the variable must be initialized by some value. Otherwise BEYOND will generate error and stop script execution. Example: |
- | PangoScript allow define local variables. The lifetime for the local variable defined by lifetime of the Scripter that execute PangoScript. As soon as the Scripter freed, all its local variables are removed as well. | + | var MyInteger, MyString |
+ | MyInteger = 10 | ||
+ | MyString = " | ||
- | All variables | + | All variables declared |
- | The declaration start from VAR operation and the follow one or more variable names. As example: | + | |
- | var MyVariable | + | ==== GLOBALVAR ==== |
- | var a,b,c | + | |
- | Before using the variable | + | A variable |
- | var MyInteger, MyString | + | |
- | MyInteger = 10 | + | |
- | MyString = " | + | |
- | All variables declared | + | globalvar s |
+ | s=" | ||
+ | goto s | ||
+ | DisplayPopup "It does not work" | ||
+ | exit | ||
+ | |||
+ | mylabel: | ||
+ | DisplayPopup "It works" | ||
+ | |||
+ | ===== General functions ===== | ||
+ | |||
+ | ^ Function ^ description ^ value ^ | ||
+ | | **intstr**(value: | ||
+ | | **floatstr**(value: | ||
+ | | **abs**(value: | ||
+ | | **int**(value: | ||
+ | | **frac**(value: | ||
+ | | **round**(value: | ||
+ | | **sqr**(value: | ||
+ | | **sqrt**(value: | ||
+ | | **cos**(value: | ||
+ | | **sin**(value: | ||
+ | | **tan**(value: | ||
+ | | **arcsin**(value: | ||
+ | | **arccos**(value: | ||
+ | | **arctan**(value: | ||
+ | | **arctan2**(dx, | ||
+ | | **min**(a, | ||
+ | | **max**(a, | ||
+ | | **pi**: | ||
+ | | **invert**(value: | ||
+ | |||
+ | ===== Date and Time ===== | ||
+ | |||
+ | ^ Function ^ description ^ | ||
+ | | **now: | ||
+ | | **tickcount**: | ||
+ | | **hms**(hour, | ||
+ | | **GetYear**: | ||
+ | | **GetMonth**: | ||
+ | | **GetDay**: | ||
+ | | **timestr**(now: | ||
+ | | **timestrlong**(now: | ||
+ | |**datestr**(now: | ||
+ | |**datestrlong**(now: | ||
+ | | **dayofweek**(now: | ||
+ | | **dayofweeklong**(now: | ||
+ | |||
+ | ===== String functions ===== | ||
+ | |||
+ | ^ Function ^ description ^ | ||
+ | | **uppercase**(string): | ||
+ | | **lowercase**(string: | ||
+ | | **crlf**: | ||
+ | |||
+ | ===== Clock And Metronome ===== | ||
+ | |||
+ | ^ Function ^ description ^ | ||
+ | | **b2s**(beats) | transform beats to seconds | | ||
+ | | **b2ms**(beats) | transform beats to milliseconds | | ||
+ | | **s2b**(seconds) | transform seconds to beats | | ||
+ | | **b2s**(seconds) | transform beats to seconds | | ||
+ | ===== More to come ===== | ||
- | GLOBALVAR operator | ||
- | The variable can be declared as global. In this case, it visible in ALL scripts of BEYOND. |