aboutsummaryrefslogtreecommitdiff
path: root/doc/yue-de.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/yue-de.md')
-rw-r--r--doc/yue-de.md58
1 files changed, 58 insertions, 0 deletions
diff --git a/doc/yue-de.md b/doc/yue-de.md
index 9149231..1a13a47 100644
--- a/doc/yue-de.md
+++ b/doc/yue-de.md
@@ -2779,6 +2779,64 @@ if a in list
2779 2779
2780</YueDisplay> 2780</YueDisplay>
2781 2781
2782Der `in`-Operator kann auch mit Tabellen verwendet werden und unterstützt die Variante `not in` für Verneinungen:
2783
2784```yuescript
2785has = "foo" in {"bar", "foo"}
2786
2787if a in {1, 2, 3}
2788 print "a ist in der Tabelle"
2789
2790not_exist = item not in list
2791
2792check = -> value not in table
2793```
2794
2795<YueDisplay>
2796
2797```yue
2798has = "foo" in {"bar", "foo"}
2799
2800if a in {1, 2, 3}
2801 print "a ist in der Tabelle"
2802
2803not_exist = item not in list
2804
2805check = -> value not in table
2806```
2807
2808</YueDisplay>
2809
2810Eine Ein-Element-Liste oder Tabelle prüft auf Gleichheit mit diesem Element:
2811
2812```yuescript
2813-- [1,] prüft, ob wert == 1
2814c = a in [1,]
2815
2816-- {1} prüft auch, ob wert == 1
2817c = a in {1}
2818
2819-- Ohne Komma ist [1] ein Indexzugriff (tb[1])
2820with tb
2821 c = a in [1]
2822```
2823
2824<YueDisplay>
2825
2826```yue
2827-- [1,] prüft, ob wert == 1
2828c = a in [1,]
2829
2830-- {1} prüft auch, ob wert == 1
2831c = a in {1}
2832
2833-- Ohne Komma ist [1] ein Indexzugriff (tb[1])
2834with tb
2835 c = a in [1]
2836```
2837
2838</YueDisplay>
2839
2782# For-Schleife 2840# For-Schleife
2783 2841
2784Es gibt zwei Formen der `for`-Schleife, genau wie in Lua: eine numerische und eine generische. 2842Es gibt zwei Formen der `for`-Schleife, genau wie in Lua: eine numerische und eine generische.