AR/Table
Jump to navigation
Jump to search
بسم الله الرحمن الرحيم
___________________________________________________________________
table.foreachi
تستخدم ل إظهار الجدول بصف واحد
table table.foreachi(table,function)
Click to collapse [-]
Example
t = {1,1,2,3,5,8,13}
test1 = table.foreachi(t,print)
1 1
2 1
3 2
4 3
5 5
6 8
7 13
___________________________________________________________________
table.foreach
تستخدم ل تكرار المفاتيح في الجدول
table table.foreach(table,function)
Click to collapse [-]
Example
k = { apple="green", orange="orange", banana="yellow" }
test1 = table.foreachi(k,print)
apple green
orange orange
banana yellow
؟ table.foreachi و table.foreach الفرق بين
الاولى تستخدم لفهرسة الجدول بينما الاخرى هي لتكرار مفاتيح الجداول ,, ملاحظة : الثانيه غير مضمونه بما يتعلق الترتيب التي يتم تخزين مفاتيح في جدول
.