NetTalk Central

Author Topic: Making a local queue a dropdown list  (Read 4342 times)

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
Making a local queue a dropdown list
« on: August 26, 2012, 06:48:19 AM »
Hello please can anyone help, i have a queue which i have populated with data and i want it to appear on a form as a dropdown. Please do anyone know how to do this?

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Making a local queue a dropdown list
« Reply #1 on: August 26, 2012, 08:30:57 PM »
Hi Olu
Bruce has warned against this. Quote from his book (page 42) abbreviated slightly.
You are of course free to use local queues in your code. However since they are local their lifespan is very short.
The browse and for procedures are called multiple times, on different threads. This highly threaded architecture does not lend itself to the use of local queues, since the queue would need to be rebuilt almost constantly.

There is a structure that combines the thread safety of files, with the speed on memory and that is an in-memory table.
At the end of the day it is the correct structure for this requirement.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11308
    • View Profile
Re: Making a local queue a dropdown list
« Reply #2 on: August 26, 2012, 09:46:48 PM »
global Queue or local Queue Olu?

If a global queue it _could_ be done in embed code, although I _strongly_ recommend against it. Global queues are not thread-safe, so you would need at least a critical section, and any errors in your implementation would lead to bad program behavior.

If you are just wanting to cache a bunch of stuff in memory (ie the typical use case for a global queue) then rather use the In-Memory file driver which is thread safe.

For local queues, you would need to rebuild the queue a lot, so there's no real value in the local queue, rather just populate the drop-down straight from the data.

If you do want to manipulate the drop-down contents in embed code, then take a look at the generated code (especially the value::fieldname routine) and you can add anything you like there.

cheers
Bruce


olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
Re: Making a local queue a dropdown list
« Reply #3 on: August 27, 2012, 03:36:06 AM »
Thanks bruce just what i needed got it to work using the value::fieldname routine as you adviced