ehem. OMSI - Forum

Dieses Forum wurde geschlossen. Das neue Forum befindet sich auf www.omnibussimulator.de/forum !
 
StartseiteStartseite  FAQFAQ  SuchenSuchen  MitgliederMitglieder  NutzergruppenNutzergruppen  AnmeldenAnmelden  LoginLogin  

Teilen | 
 

 Scripting Operators

Nach unten 
AutorNachricht
krtz07



Anzahl der Beiträge : 413
Anmeldedatum : 10.09.09
Alter : 33
Ort : Philadelphia PA

BeitragThema: Scripting Operators    Di 16 Aug - 22:11

&& - And
|| - Or
! - I think is not equal but not 100% sure.
= Equal




Can someone be so kind to explain to me what these following operators do?

/-/
/ /
+ -
- +
* +

abs? absolute?

If there are any other known operators which the script uses, post them as well.

Nach oben Nach unten
Benutzerprofil anzeigen http://www.philadelphiatransitvehicles.info
EirikhO

avatar

Anzahl der Beiträge : 61
Anmeldedatum : 07.04.11
Alter : 24
Ort : Norway

BeitragThema: Re: Scripting Operators    Mi 17 Aug - 11:03

+ - means "add then subtract", for instance 1 2 3 + - means "1+2-3".

You also have < and > which are quite obvious, and => which is "more than or equal to", and <= which is "less than and equal to"

/ is divide, - is subtract, + is add and * is multily. No idea about abs.
Nach oben Nach unten
Benutzerprofil anzeigen
krtz07



Anzahl der Beiträge : 413
Anmeldedatum : 10.09.09
Alter : 33
Ort : Philadelphia PA

BeitragThema: Re: Scripting Operators    Mi 17 Aug - 13:08

I have been using the greater/less/ equal to operators for quite sometime. The one which I am truly carious about is the /-/, I guess that means divade, subtract, then divide again.
Nach oben Nach unten
Benutzerprofil anzeigen http://www.philadelphiatransitvehicles.info
Rüdiger Hülsmann
Admin
avatar

Anzahl der Beiträge : 1204
Anmeldedatum : 25.04.09
Alter : 34
Ort : Potsdam-West, Berlin-Mariendorf

BeitragThema: Re: Scripting Operators    Do 18 Aug - 22:09

"1 2 3 + -" is actually 1 - (2+3). Any operator refers to the two values left of it and combined equations are solved from inside out. In this example: "Add 2 and 3 and subtract the result from 1".

When you find combined operators in the script, you'd use brackets in the regular mathematic notation. Another example:

(1+2)*3/(5-4) = 1 2 + 3 * 5 4 - /

"abs" turns the value into an absolute value

/-/ negates the value and turns for example 3 into -3.
Nach oben Nach unten
Benutzerprofil anzeigen
krtz07



Anzahl der Beiträge : 413
Anmeldedatum : 10.09.09
Alter : 33
Ort : Philadelphia PA

BeitragThema: Re: Scripting Operators    Do 18 Aug - 22:58

Rüdiger Hülsmann schrieb:
"1 2 3 + -" is actually 1 - (2+3). Any operator refers to the two values left of it and combined equations are solved from inside out. In this example: "Add 2 and 3 and subtract the result from 1".

When you find combined operators in the script, you'd use brackets in the regular mathematic notation. Another example:

(1+2)*3/(5-4) = 1 2 + 3 * 5 4 - /

"abs" turns the value into an absolute value

/-/ negates the value and turns for example 3 into -3.
You're the best! Very Happy

I was using some of those scripting practices in the past; however, I did not know the complete logic behind it until now.

Nach oben Nach unten
Benutzerprofil anzeigen http://www.philadelphiatransitvehicles.info
Gesponserte Inhalte




BeitragThema: Re: Scripting Operators    

Nach oben Nach unten
 
Scripting Operators
Nach oben 
Seite 1 von 1

Befugnisse in diesem ForumSie können in diesem Forum nicht antworten
ehem. OMSI - Forum :: OMSI-Design (english) :: Script programming-
Gehe zu: