Skip to content

Modern LinkedList Front

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › LinkedList › LinkedList › Front

Front

Returns a reference to the front value without removing it.

Syntax

Front( ) byref as T

Examples

#import "std/containers"
using containers

dim q as LinkedList( of ustring )
q.PushBack( "a" ) : q.PushBack( "b" )

print q.Front( )         '' a -- peek without removing
print q.Count            '' 2, unchanged

'' Returns BYREF, so it assigns in place
q.Front( ) = "z"
print q.Front( )         '' z

'' On an EMPTY list it returns a reference to a shared blank -- a
'' reference has to refer to something. Check IsEmpty first.

Library: LinkedList
Category: LinkedList
Documented under: Members

Clone this wiki locally