A fixed-capacity FIFO circular buffer storing LONG values. Push writes at the tail; Pop/Peek read at the head.
A fixed-capacity FIFO circular buffer storing LONG values. Push writes at the tail; Pop/Peek read at the head.
Kind: Container | Category: H-Lib Native Containers
PBXB64 Status: AVAILABLE
PBXB64 Certification: [CERTIFIED TESTED]
This H-Lib container is implemented in native C support code and exposed through PBXB64 BASIC container syntax. The examples below are focused usage patterns; keep handles valid, release each container with its Final method, and check counts or return values when a method can fail.
| Method | Signature | Returns | Description |
|---|---|---|---|
| New | r.New capacity | LNRING | Allocate a ring with the given capacity. |
| Final | r.Final | none | Free the ring. |
| Validate | r.Validate | LONG | Non-zero if the handle is valid. |
| Clear | r.Clear | none | Empty the ring. |
| Count | r.Count | LONG | Number of values currently stored. |
| Capacity | r.Capacity | LONG | Maximum number of values allowed. |
| Trim | r.Trim | none | Normalisiert den internen Speicher bei unveränderter fester Kapazität. |
| Clone | r.Clone | LNRING | Gibt eine unabhängige Kopie mit derselben FIFO-Reihenfolge zurück. |
| Push | r.Push value | none | Fügt am Ende ein; bei vollem Puffer wird der älteste Wert überschrieben. |
| Pop | r.Pop | QUAD | Remove and return the oldest value. |
| Peek | r.Peek | QUAD | Return the oldest value without removing it. |
| Full | r.Full | LONG | Non-zero if the ring is full. |
| Empty | r.Empty | LONG | Non-zero if the ring is empty. |
Validation evidence: H-Lib container behavior is exercised by registered BASIC container validation programs and the embedded H-Lib object set used by the single-EXE validation gate.
Diese Referenzseite soll durch ein fokussiertes Compile- oder Laufzeitbeispiel belegt sein. Das Beispiel soll Eingaben, erwartete Ausgabe oder Exit-Code und erforderliche Windows-Ressourcen oder Include-Dateien nennen.
Allgemeine Übersichtsseiten sollten trotzdem sagen, welche Familie gemeint ist, welche konkreten Befehlsseiten die Implementierung tragen und welche Formen nur der Navigation dienen. So bleibt die Seite detailliert genug, ohne so zu tun, als wäre sie eine vollständige Befehlsreferenz.
LOCAL r AS LNRING r = r.New 2 r.Push 10 r.Push 20 r.Push 30 ' overwrites 10 PRINT r.Full ' non-zero PRINT r.Pop ' 20 r.Final