Platforms to show: All Mac Windows Linux Cross-Platform

Back to AtomicQueueMBS class.

AtomicQueueMBS.Add(value as Variant)   New in 26.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Appends value to the array.
Example
Var f As New AtomicQueueMBS

f.Add("Hello")
f.Add("World")

MessageBox f.FirstValue + " " + f.TopValue
// shows Hello World

See also:

AtomicQueueMBS.Add(values as AtomicQueueMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds the values of the other queue to this queue.
Example
Var a As New AtomicQueueMBS

a.Push 123
a.Push 234

Var b As New AtomicQueueMBS
b.Add a

// this uses Operator_Convert
Var values() As Variant = b

Break

See also:

AtomicQueueMBS.Add(values() as Variant)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds the given values to the queue.
Example
Var a As New AtomicQueueMBS

Var newValues() As Variant
newValues.Add 123
newValues.Add 234

a.Add newValues

Var values() As Variant = a
// check in debugger

Break

Like if you push each of the value in the array.

See also:

AtomicQueueMBS.AddIfAbsent(Value as Variant)   New in 26.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Appends the value if it doesn't exist already.
Example
Var f As New AtomicQueueMBS

f.Add("Hello")
f.Add("World")

Var c1 As Integer = f.Count

f.AddIfAbsent "Hello"
// not added since it was already there

Var c2 As Integer = f.Count

f.AddIfAbsent "Hallo"

Var c3 As Integer = f.Count

Break // check in debugger

AtomicQueueMBS.Clear

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Clears the list.
Example
Var f As New AtomicQueueMBS

// put a value on the queue
f.Push 123
Var c As Integer = f.Count

// clear it
f.Clear

MessageBox c.ToString + " -> " + f.Count.ToString

AtomicQueueMBS.Clone as AtomicQueueMBS   New in 26.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Clones the queue into a new one.
Example
Var f As New AtomicQueueMBS

f.Add("Hello")
f.Add("World")

var c as AtomicQueueMBS = f.Clone

MessageBox c.FirstValue + " " + c.TopValue
// shows Hello World

Copies the variant references.

AtomicQueueMBS.Constructor   New in 26.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.

See also:

AtomicQueueMBS.Constructor(value as AtomicQueueMBS)   New in 26.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor to create a copy of the queue.

See also:

AtomicQueueMBS.Constructor(values() as Variant)   New in 26.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor to create a new queue with the given values.
Example
var f() as Variant

f.Add("Hello")
f.Add("World")

Var q As New AtomicQueueMBS(f)

Break // check in debugger

See also:

AtomicQueueMBS.Contains(value as Variant) as Boolean   New in 26.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks whether an item is already inside the object.
Example
Var f As New AtomicQueueMBS

f.Add("Hello")
f.Add("World")

var r1 as Boolean = f.Contains("Hello")
Var r2 As Boolean = f.Contains("Test")
var r3 as Boolean = f.Contains(123)

If r1 And Not r2 and not r3 Then
MessageBox "Okay"
Else
MessageBox "Failed"
end if

Returns true to returns if value is found.

Compares integers and strings. Everything else is compared by pointer.

AtomicQueueMBS.Insert(value as Variant)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inserts a new value on bottom of the queue.
Example
Var f As New AtomicQueueMBS

f.Add("Hello")
f.Add("World")
f.Insert 123 // new first value

Break // check in debugger

Inserts value at position 0 in the array.

See also:

AtomicQueueMBS.Insert(values as AtomicQueueMBS)   New in 26.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inserts the value in the queue into the queue at the beginning.
Example
Var f As New AtomicQueueMBS

f.Add("Hello")
f.Add("World")

Var q As New AtomicQueueMBS

q.Add "123"
q.Insert f

Break // check in debugger

Inserts value at position 0 in the array.

See also:

AtomicQueueMBS.Insert(values() as Variant)   New in 26.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 26.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Inserts the value in the array into the queue at the beginning.
Example
var f() as Variant

f.Add("Hello")
f.Add("World")

Var q As New AtomicQueueMBS

q.Add "123"
q.Insert f

Break // check in debugger

Inserts value at position 0 in the array.

See also:

AtomicQueueMBS.Operator_Add(value as Variant) as AtomicQueueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds a value to the queue.
Example
Var a As New AtomicQueueMBS

a = a + 123
a = a + 234

Var values() As Variant = a

Break

AtomicQueueMBS.Operator_Compare(other as AtomicQueueMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Compares two queues.

Two queues are equal i

  • you compare same object against itself
  • both have same sizes and each of the variant pointers are the same.
This allows you to compare a copy of the queue or one with the same objects.

AtomicQueueMBS.Operator_Convert as Variant()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Converts the queue to an array.
Example
Var q As New AtomicQueueMBS

q.Push New MyJob
q.Push New MyJob
q.Push New MyJob
q.Push New MyJob
q.Push New MyJob

Var other As New AtomicQueueMBS
other.add(q)

If other = q Then
Break // equal
Else
Var qv() As Variant = q.Values
Var ov() As Variant = other.values
// not equal, so check arrays in debugger

Break
End If

Same as calling values function.

AtomicQueueMBS.PopFirst as Variant

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the first item and removes it from the queue.
Example
Var q As New AtomicQueueMBS

q.Push 1
q.Push 2
q.Push 3
q.Push 4
q.Push 5

Var f As Variant = q.PopFirst // 1
Var l As Variant = q.PopLast // 5
Var c As Integer = q.Count // 3 remaining

Break

This is for a first-in-first-out queue.

AtomicQueueMBS.PopLast as Variant

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Returns the last item and removes it from the queue.

This is for a first-in-last-out queue, also known as a stack.

AtomicQueueMBS.Push(value as Variant)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Pushes a new value on top of the queue.

Appends value to the array.

AtomicQueueMBS.Values as Variant()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Queries array of all values.

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...