INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Queue declaration

Queue declaration

(OP)
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

RE: Queue declaration

For example:

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

!qTest2 based from qTest1
qTest2               QUEUE(qTest1),PRE()
                     END
 

RE: Queue declaration

(OP)
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?

RE: Queue declaration

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.

RE: Queue declaration

(OP)
Ok, and how do I copy data from one queue to another?

RE: Queue declaration

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

RE: Queue declaration

Is it correct to use
qTest2 :=: qTest1
instead of
   qTest2.Data = qTest1.Data
   qTest2.Data2 = qTest1.Data2
   qTest2.Data3 = qTest1.Data3
   ...
in the loop ?

RE: Queue declaration

Of course, but you wanted filtered data in qTest2...
Now you have same data in both queues.

RE: Queue declaration

(OP)
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
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close