Cicode Programming Reference > Cicode Function Categories > Task Functions Introduction > QueOpen

QueOpen

Open a queue for reading and writing data elements. Use this function to create a new queue or open an existing queue. Use queues for sending data from one task to another or for other buffering operations.

Syntax

QueOpen(Name, Mode)

Name:

The name of the queue.

Mode:

The mode of the queue open:

0 - Open existing queue.

1 - Create new queue.

2 - Attempts to open an existing queue. If the queue does not exist, it will create it.

Return Value

The queue handle, or -1 if the queue cannot be opened. The queue handle identifies the table where all data on the associated queue is stored.

Related Functions

QueClose, QueLength, QueRead, QueWrite, QuePeek

Example

! Create a queue.
hQue=QueOpen("MyQue",1);
! Write data into the queue.
QueWrite(hQue,1,"Quetext");
QueWrite(hQue,1,"Moretext");
! Read back data from the queue.
QueRead(hQue,Type,Str,0);

See Also

Task Functions