BaselScript


× SPRACHE NACHRICHTEN BEISPIELE BEISPIELFILME INSTALLATION IMPRESSUM DATENSCHUTZ SUPPORT -------------- BESCHREIBUNG Einführung BASEL-Sprache Grundkenntnisse    • Feld auch Variable    • Array    • Hash-Array    • Mathem. und Vergleichsoperatoren    • Bedingungen    • Schleife    • Timer    • Datei    • Datensatz    • Verzeichnis    • Menu    • Dialog    • ListView (Ansichtsliste)    • Form Arbeiten mit Skripten    • Skripte    • Scriptstruktur    • Aufruf eines Skriptes    • Skript starten    • Skript beim Start der Anwendung starten    • Szene    • Szene Deklaration    • Szene laden und starten Arbeiten mit Feldern    • Feldwert speichern    • Feldwert wiederherstellen Arbeiten mit Arrays    • Hash-array Arbeiten mit Verzeichnissen    • Standardverzeichnisse    • Unterverzeichnis erstellen    • Unterverzeichnis löschen    • Verzeichnisinhalt Arbeiten mit Dateien    • Dateistruktur deklarieren    • Datei in Speicher einlesen    • Datensatz in Datei schreiben    • Datei speichern    • Eine Datei in eine andere Datei umschreiben    • Datei umbenennen    • Datei kopieren    • Datensätze löschen    • Datei löschen    • Eingabe in Datei aus dem Skript    • Anzahl ausgewählter Datensätze    • Datensatz N lesen    • Verschlüsseln    • Dateien zusammenführen    • Update file    • Datensätze zusammenführen    • Space reduzieren    • Teilstring in Datei ersetzen    • Datensatz nach ausgewähltem einfügen    • Neuen Datensatz vor ausagewähltem hinzufühgen Arbeiten mit Bildschirm    • Erklärungen    • Form oder Formular       •• Tile = text       •• Tile = input       •• Tile = button       •• Tile = rectangle       •• Tile = image       •• Tile = radiobutton       •• Tile = checkbox       •• Tile = togglebutton       •• Tile = seekbar       •• Tile = property       •• Property-Beispiel       •• Tile-Anweisungen    •  Dialog    • List view    • Menü    • Message/print    • Trace Arbeiten mit Grafik    • Draw image    • Draw line    • Draw rectangle    • Draw circle    • Draw ellipse    • Draw text    • Draw polygon    • Draw point Arbeit mit Sound Arbeit mit Musik Vibration Arbeit mit Server    • Image herunterladen    • Stream als csv-Datei herunterladen    • Sound herunterladen    • mp3-Datei herunterladen    • String von URL herunterladen    • Anweisungen nach Download    • Datei auf Server hochladen Aufruf einer Webseite Programm aus dem Skript ausführen Notifications Funktionen    • Allgemeine Funktionen    • String funktionen    • Math Funktionen    • Date Funktion    • Array-Funktionen    • File-Funktionen    • Verzeichnis-Funktionen    • Grafikfunktionen    • Form funktionen    • Tabellenfunktionen Google Maps App für Android    • Ort zeigen    • Suche nach Orten    • Navigation Mehrsprachige Skripte Skript erstellen.    • Skript mit dem Texteditor erstellen    • Skript auf PC erstellen    • Skript mithilfe von Vorlagen erstellen    • Skript mit Assistent erstellen    • Formularassistent    • Dialogassistent    • Menüassistent Registrierung und Login    • Meine Skripte Klonen des Android-Interpreters Copy script from Download Festlegen von Standardgrößen Mögliche Probleme beim Ausführen von Skripten    • Clinch-Situation    • Programm hängt    • Skriptstart und keine Änderungen sichtbar Reservierte Namen Globale Variable Standardparameter für Szenenkomponenten Einstellungen Liste der Unicode-Zeichen Fehlerdiagnose Einige Vergleiche bekannter Skriptsprachen mit BaselScript    • Menu    • Dialog    • List View    • Form    • Download file    • Draw circle ...
Beschreibung

                 

Math functions

All names of these functions are prefixed with "math."

math.abs
#max = $math.abs(value)

Example:
#value1=-77
#max = $math.abs(#value1)
#max=77

math.sinus
#result = $math.sinus(#param[,n])

#param - a angle in radians
-0.5 < #param < 0.5
n- round parameter
if n- parameter is given, the result will be rounded up to the first n-positions after the decimal point
Example 1:
#param = 0.5
#result = $math.sinus(#param)
#result = -0,4794255386042023
Example 2:
#param = 0.5
#result = $math.sinus(#param,2)
#result = -0,48

math.cosinus
#result = $math.cosinus(#param[,n])

#param - a angle in radians
n- round parameter
if n- parameter is given, the result will be rounded up to the first n-positions after the decimal point
Example 2:
#param = 0.5
#result = $math.cosinus(#param)
#result = -0,877582561890373

math.tangent
#result = $math.tangent(#param[,n])

#param - a angle in radians
n- round parameter
Example:
#param = 0.5
#result = -0,54630248984379

math.cotangent
#result = $math.cotangent(#param[,n])

#param - a angle in radians
n- round parameter
Example:
#param = 0.5
#result = $math.cotangent(#param,2)
#result = 1,83

math.arcsin
#result = $math.arcsin(#param[,n])

#param - a angle in radians
n- round parameter
Example:
#param = 0.5
#result = 0,52359877

math.arccos
#result = $math.arccos(#param[,n])

#param - a angle in radians
n- round parameter

Example:
#param = 0.5
#result = $math.arccos(#param,2)
#result = 1,05

math.secant
#result = $math.secant(#param[,n])

#param - a angle in radians
n- round parameter

Example:
#param = 0.5
#result = $math.secant(#param,2)
#result = 1,14

math.cosecant
#result = $math.cosecant(#param[,n])

#param - a angle in radians
n- round parameter

Example:
#param = 0.5
#result = $math.cosecant(#param,2)
#result = 2,09

math.round
#result = $math.round(#value, n)

n- round parameter
the result will be rounded up to the first n-positions after the decimal point

Example 1:
#value = 1234567.55678
#result = $math.round(#value)
#result = 1234568

Example 2:
#value = 1234567.55678
#result = $math.round(#value,0)
#result = 1234568

Example 3:
#value = 1234567.55678
#result = $math.round(#value,2)
#result = 1234567,56

math.pow
#r = $math.pow(a,b)

The first a is the base of the power and the second b is the exponent
Example:
#r = $pow(2,3)
#r = 8

math.factorial
#result = $math.factorial(#param)

Example:
#param = 4
#result = $factorial(#param)
#result = 1*2*3*4 = 24


math.sqrt
#result = $math.sqrt(#param[,n])

n- round parameter
Example:
#param = 36
#result = 6

math.cbrt
#result = $math.cbrt(#param[,n])

n- round parameter
Example:
#param = 36
#result = 6

math.log10
#result = $math.log10(#param[,n])

n- round parameter
Example:
#param = 1000
#result = 3

math.log
#result = $math.log(#param[,n])

n- round parameter
Example:
#param = 2.71828
#result = 0,999999327347282

math.trunkate
#result = $math.trunkate(#value)

Example:
#value = 100.5
#result = 100

math.decimal
#result = $math.decimal(#value)

Example:
#value = 100.5
#result = 5

math.random
#result = $math.random(#start,#end)

#start <= #result < #end
Example:
#result = $math.random(0,5)
#res = 2 or #res = 0 or #res =1 or #res =4 or #res =3


random with exception allows to select values ​​excluding those specified in the list
#res = $math.random(#start,#end, #array, number)

#start <= #result < #end
#array - array with exception values
number - number of elements in array
Example:
array #exeption[4]
#r1 = $math.random(0,5)
// save #r1 in array
#exception[0] = #r1
#r2 = $math.random(0,5,#exception,1)
// save #r2 in array
#exception[1]= #r2
#r3 = $math.random(0,5,#exception,2)
// save #r3 in array
#exception[2]= #r3
#r4 = $math.random(0,5,#exception,3)
All #r1, #r2, #r3, #r4 - values will be unique (1- 4) and will not be repeated.

math.hex_to_decimal
#decimal = $math.hex_to_decimal(#value)

Example:
#decimal = $math.hex_to_decimal(2D)
#decimal=45

math.decimal_to_hex
#hex = $math.decimal_to_hex(#value)

Example:
#hex = $math.decimal_to_hex(45)
#hex=2D

math.decimal_to_bin
#bin = $math.decimal_to_bin(#value)

Example:
#bin = $math.decimal_to_bin(5)
#hex=101

math.bin_to_decimal
#decimal = $math.bin_to_decimal(#value)

Example:
#decimal = $bin_to_decimal_to_bin(1001)
#decimal=9

math.max
#max = $math.max(#value1,#value2)

Example:
#value1=100
#value2=200
#max = $math.max(#value1,#value2)
#max=200

math.min
#max = $math.min(#value1,#value2)

Example:
#value1=77
#value2=200
#max = $math.min(#value1,#value2)
#max=77