# SortedPairs

- **Ortam:** İstemci, Sunucu, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/Global.SortedPairs
- **Çeviri tarihi:** 2026-08-05

```lua
function, table SortedPairs( table table, boolean desc = false )
```

## Açıklama

Bu fonksiyon, bir for döngüsü içinde [pairs](https://gmod.tr/wiki/Global.pairs) yerine kullanılabilir. Tüm **anahtarları** alfabetik olarak sıralar.

Belirli bir **değer üyesine** göre sıralama yapmak için [SortedPairsByMemberValue](https://gmod.tr/wiki/Global.SortedPairsByMemberValue) kullanın.

**Değere** göre sıralama yapmak için [SortedPairsByValue](https://gmod.tr/wiki/Global.SortedPairsByValue) kullanın.

## Argümanlar

1. [table](https://gmod.tr/wiki/table)
2. [boolean](https://gmod.tr/wiki/boolean) = false

## Döndürülenler

1. [function](https://gmod.tr/wiki/function)
2. [table](https://gmod.tr/wiki/table)

### Örnek

Kullanım örneği.

```lua
for id, text in SortedPairs({"e", "b", "d", "c", "a"}) do
print(id, text)
end
print("---")

for id, text in SortedPairs({
    e = 1,
    b = 2,
    d = 3,
    c = 4,
    a = 5
}) do
print(id, text)
end
```

**Çıktı:**

```lua
1 e
2 b
3 d
4 c
5 a
---
a 5
b 2
c 4
d 3
e 1
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/Global.SortedPairs
