# Problem with Queues

**URL:** https://www.finalbuilder.com/forums/t/problem-with-queues/2862
**Category:** Bugs
**Created:** [June 29, 2007, 2:15am UTC](https://www.finalbuilder.com/forums/t/problem-with-queues/2862 "2007-06-29T02:15:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 29, 2007, 2:15am UTC](https://www.finalbuilder.com/forums/t/problem-with-queues/2862/1 "2007-06-29T02:15:25Z")

</div>

Hello,

&nbsp;

I am working with Queues in FB5. The Queues work fine when I give a static name to the queue. However, when I need to define queue’s names which contain the value of a variable (namequeue\_%number%), it seems that all of the queues that are related with namequeue\_% number % share the same memory address. If I have for example namequeue\_1, namequeue\_2 (where 1 and 2 are values of &nbsp;%number%), when I log the content of these queues they both have the same content (the content of the last one).

&nbsp;

When a queue is defined in PB5, in the build log we can see “Queue [namequeue\_%number%] defined.” Maybe the definition should be with the value of the variable instead of using the name of the variable. It seems that the definition should be “Queue [namequeue\_1] defined”, so that each instance can have their one memory address.

&nbsp;

You can try to reproduce this issue using the following pseudo code:

&nbsp;

For [number] = 1 To&nbsp;2 Step 1

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Define queue [namequeue\_%number%]

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Clear Queue [namequeue\_%number%]

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If [%number%] =1

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Push items on Queue [namequeue\_%number%] (Push a, b, c)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Push items on Queue [namequeue\_%number%] (Push x, y, z)

&nbsp;

For [number] = 1 To 2 Step 1

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Log items on Queue [namequeue\_%number%]

&nbsp;

The log will show:

namequeue\_1 = x, y, z (it should be namequeue\_1 = a, b, c)

namequeue\_2 = x, y, z

&nbsp;

Please let me know your comments about this issue.

&nbsp;

Thanks.

Rosalva.

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [June 29, 2007, 3:04am UTC](https://www.finalbuilder.com/forums/t/problem-with-queues/2862/2 "2007-06-29T03:04:34Z")

</div>

Hi Rosalva,   
  
 Sorry to tell you this, but you can’t (or at least shouldn’t) use variable in the queue name. They work quite differently to variables - only one queue can be defined by a single “Define Queue” action. So, unfortunately the workaround is that you need to declare each of the queues you want to use with separate Define Queue actions.   
  
 cheers,   
 tate
