JoJoThumb - Profilbeispiel_JoJoScript-Funktionen

Beispiele für die Ergebnisse der eingebauten JoJoScript-Funktionen

Aktuelle Zeit: (now ()): 26.02.2006 18:23:08
Aktuelle Zeit + 1 Tag: (now () + 1): 27.02.2006 18:23:08
Aktuelle Zeit + 12 Stunden: (now () + 0.5): 27.02.2006 06:23:08
Datumskonvertierung: (date ("1.2.98 10:12")): 01.02.1998 10:12:00
Tag: (datepart (zeit, "d")): 26
Jahr: (datepart (zeit, "yyyy")): 2006
Wochentag: (datepart (zeit, "dddd")): Sonntag
Woche: (datepart (zeit, "ww")): 8
Tag der Woche: (datepart (zeit, "w")): 7
Tag des Jahres: (datepart (zeit, "y")): 57
Länderdatum: (datepart (zeit, "ddddd")): 26.02.2006
Länderzeit: (datepart (zeit, "ttttt")): 18:23:08
KombiDatum: (datepart (zeit, "dddd, d. mmmm yyyy")): Sonntag, 26. Februar 2006
symbol ("abc") = @abc
type (now ()) = @date
sin (2.5) = 0.598472144103957
cos (2.5) = -0.801143615546934
tan (2.5) = -0.74702229723866
log (2.5) = 0.397940008672038
ln (2.5) = 0.916290731874155
asin (0.5) = 0.523598775598299
acos (0.5) = 1.0471975511966
atan (0.5) = 0.463647609000806
sqrt (2.5) = 1.58113883008419
pow (2, 5) = 32.0
exp (2.5) = 12.1824939607035
convert (123, @bin) = 1111011
convert (123, @oct) = 173
convert (123, @hex) = 7B
convert (123, 16) = 7B
abs (-2.5) = 2.5
min (10.0, 20, 1.0, 2, 100.0) = 1.0
min (10, 20, 1, 2, 100) = 1
min (10, @abc, 1, 2, 100) = @error
min (10, 20, "1", 2, 100) = @error
max (10.0, 20, 1.0, 2, 100.0) = 100.0
max (10, 20, 1, 2, 100) = 100
len ("abcde") = 5
index ("abcde", "cd") = 3
index ("abcde", "ef") = 0
index (@regexp, "abcde", "b[a-d]+e") = 2
index (@regexp, "abcde", "b[a-d]e") = 0
mid ("abcde", 3, 2) = "cd"
mid ("abcde", 3, 5) = "cde"
mid ("abcde", 10, 2) = ""
string (10) = "10"
string (@true) = "true"
format ("%0", 123) = "123"
format ("%10", 123) = "       123"
format ("%-10", 123) = "123       "
format ("%10.5", 123.456) = " 123.45600"
format ("%10.2", 123.456) = "    123.46"
format ("%0.5", 123.456) = "123.45600"
format ("%0", 123.456) = "123"
format ("%0.2", 0.123) = "0.12"
format ("%0", 0.123) = "0"
format ("%1", @true) = "@true"
replace ("12345678901234567890", "3", "X") = "12X456789012X4567890"
replace ("12345678901234567890", "3", "X", @first) = "12X45678901234567890"
replace (@regexp, "12345678901234567890", "3..", "X") = "12X6789012X67890"
replace(@regexp, "12345678901234567890", "3..", "X", @first) = "12X678901234567890"
replace(@regexp, "12345678901234567890", "(123)(.*)(456)(.*)", "$3$2$1$4") = "45645678901231237890"
upper ("AbcdE") = "ABCDE"
lower ("AbcdE") = "abcde"
trim (" abcde ", @leading) = "abcde "
split ("111;222;333;444", ";", 3) = "333"
urlencode ("äöüß ÄÖÜ") = "%E4%F6%FC%DF%20%C4%D6%DC
filenamepart ("a:\x1\x2\yyy.zzz", @dirname) = "x1\x2"
exifnice ("model") = "@error"
exist ("c:\windows\notepad.exe") = @true
rgb (255,255,0) = 65535
----------
arrayset ("a", 111, 100)
arrayset ("a", 222, arrayget ("a", 111) + 10)
arrayset ("a", 333, "Inhalt von 333")
arraycount ("a") = 3
arrayget ("a", 111) = 100
arrayget ("a", 222) = 110
arrayget ("a", 3, @index) = "Inhalt von 333"
arrayset ("a", 222)
arraycount ("a") = 2
arrayget ("a", 222) = @error
arrayclear ("a")
arraycount ("a") = 0
----------

Beispiele für Rechenoperationen in JoJoScript

10 * 20 = 200
20 % 6 = 2
10 + 20 * 30 + 40 = 650
(10 + 20) * (30 + 40) = 2100
10 + 20 * 30 + 40.5 = 650.5
10.123 + 20 * 30 + "hallo" = 610.123hallo
"hallo "+ @true = hallo true
5 > 3 = @true
5 > 3 ? "JA" : "NEIN" = JA
@true > 3 = @false
"abcde" > "ABCDE" = @true
"abcde" < "ABCDE" = @false
"abcde" == "ABCDE" = @false
1 && 2 = @true
0 && 2 = @false
0 || 2 = @true
0x12345 = (74565) 74565
0x12345 & 0xabcde = (8260) 8260
0x12345 ^ 0xabcde = (761755) 761755
0x12345 | 0xabcde = (770015) 770015
~0x12345 = (-74566) -74566
---2.5 = -2.5
a=1; b=2; c=3; a=b=c=4; a; b; c : 4 : 4 : 4

05090014 06050003 06130003 06150001
07160005 08230013 08230030 08290018

Erstellt am 26.2.2006
JoJoThumb © Johannes Tschebisch