Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queue declaration 1

Status
Not open for further replies.

madreply

Technical User
Dec 6, 2011
9
0
0
I have 2 very newbish questions:
1. How do I Create/Declare a Queue?
2. How do I Create/Declare a Queue with exactly the same structure as some ohter queue?

Thanx
 
For example:

!1-st Queue
qTest1 QUEUE,PRE()
Data STRING(20)
END

!qTest2 based from qTest1
qTest2 QUEUE(qTest1),PRE()
END
 
Thank you very much!
I have 2 more questions about queues:
1. How do I put data from a declared queue in a Browse box?
2. How do I filter queue's?
 
For example you can use a Listbox and insert queuefields in Listbox formatter. Don't forget:

?List1{PROP:FROM} = qTest1

I don't know any way to filter without to use a second queue. This queue you can fill filterd and display.
 
Ok, and how do I copy data from one queue to another?
 
In Clarion-Help are many examples for ADD/PUT/DELETE in a Queue.
For example:

FREE(qTest2)
LOOP i# = 1 TO RECORDS(qTest1)
GET(qTest1, i#)
IF ... THEN !Filter -Condition
qTest2.Data = qTest1.Data
ADD(qTest2)
END
END


cagiv
 
Is it correct to use
qTest2 :=: qTest1
instead of
qTest2.Data = qTest1.Data
qTest2.Data2 = qTest1.Data2
qTest2.Data3 = qTest1.Data3
...
in the loop ?
 
Of course, but you wanted filtered data in qTest2...
Now you have same data in both queues.
 
I keep getting an error because of the GET().
First my code was:

FREE(qTest2)
LOOP i# = 1 TO RECORDS(Queue:Browse:1)
GET(Queue:Browse:1, i#)
IF ERRORCODE() THEN
MESSAGE(ERROR(),ERRORCODE())
BREAK
END
IF ... THEN !Filter -Condition
qTest2.Data = Queue:Browse:1.Data
ADD(qTest2)
END
END

But then it would just skip the loop so i wrote it like this:

FREE(qTest2)
i# = 1
LOOP
GET(Queue:Browse:1, i#)
IF ERRORCODE() THEN
MESSAGE(ERROR(),ERRORCODE())
BREAK
END
IF ... THEN !Filter -Condition
qTest2.Data = Queue:Browse:1.Data
ADD(qTest2)
END
i#=i#+1
END

And the message is:
Entry Not Found.
Errorcode is 30
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top