QUEUE in QUEUE 
Author Message
 QUEUE in QUEUE

Hi,

since I didn't get an answer to my first question, would some kind soul
please take the following code snippet, compile it under CW 2.0, and report
the results back to me?

Many thanks in advance!

Regards,
-Joachim

Create a new application and make Main a Source Procedure. In the Data
Section embed, add the following code:

Inner      group,pre(ig)
Field1       byte
InnerQueue   queue,pre(iq)
Field2         byte
             end
           end
OuterQueue queue,pre(oq)
Field3       byte
Nested       group(Inner),pre(n)
Field4         byte
             end
           end

CW1.501 gives a "not valid inside structure" message. I hope CW 2.x will
compile this.



Sat, 20 Mar 1999 03:00:00 GMT  
 QUEUE in QUEUE

Joachim,

Quote:
> since I didn't get an answer to my first question, would some kind soul
> please take the following code snippet, compile it under CW 2.0, and report
> the results back to me?

Cw 2 gave the same error message.  From your example you basically
want to make a queue of queues right ?  Although the method you used
didn't work the following should work...

Basically there is a new clarion word called NEW which behaves just
like the C++ new (I think) in that it lets you create an instance of
a variable type at runtime.  ie

InnerQueue  Queue,type
yada                byte
                     end

OuterQueue  Queue
QP                   &InnerQueue
                     .

So now you have a queue of pointers to queues.  What remains, at
runtime, is to create the multiple copies of InnerQueue using the NEW
keyword. ie

  QP = New (InnerQueue)
  add(OuterQueue)
  QP  = New (InnerQueue)
  add(OuterQueue)

You now have 2 queues of the InnerQueue type.  Now this all screams
out to be properly encapsulated in objects - but I'll leave you to
check out page 55 of the Programmers Reference (CW 2) for an example
of doing this.

Cheers
Bruce



Sat, 20 Mar 1999 03:00:00 GMT  
 QUEUE in QUEUE

Quote:
>Perhaps you can try using the type attribute on the Inner group....

Good idea, though it didn't work.
Though it would have been rather strange if it actually did work! A GROUP
with a TYPE attribute is just a shorthand for a GROUP elsewhere, so it's
quite natural that CW applies the same checks regardless of wether TYPE is
present or not.

Regards,
-Joachim
-----------------------------------------------------------------------
Joachim Durchholz, +49(9132)82-3150, speaking for himself, not for INA.
KOA, INA Werk Schaeffler, Industriestr.1-3, D-91074 Herzogenaurach



Sat, 20 Mar 1999 03:00:00 GMT  
 QUEUE in QUEUE

Quote:
>Basically there is a new clarion word called NEW which behaves just
>like the C++ new (I think) in that it lets you create an instance of
>a variable type at runtime.  

Sounds interesting.

Quote:
>You now have 2 queues of the InnerQueue type.  Now this all screams
>out to be properly encapsulated in objects - but I'll leave you to
>check out page 55 of the Programmers Reference (CW 2) for an example
>of doing this.

I've got a chicken-and-egg problem here. I don't have CW 2.0, I need this
information (among others) to persuade my employer to buy it...

Anyway, thanks for the info.

Regards,
-Joachim
-----------------------------------------------------------------------
Joachim Durchholz, +49(9132)82-3150, speaking for himself, not for INA.
KOA, INA Werk Schaeffler, Industriestr.1-3, D-91074 Herzogenaurach



Sat, 20 Mar 1999 03:00:00 GMT  
 QUEUE in QUEUE

Quote:

>Hi,
>since I didn't get an answer to my first question, would some kind soul
>please take the following code snippet, compile it under CW 2.0, and report
>the results back to me?
>Many thanks in advance!
>Regards,
>-Joachim
>Create a new application and make Main a Source Procedure. In the Data
>Section embed, add the following code:
>Inner      group,pre(ig)
>Field1       byte
>InnerQueue   queue,pre(iq)
>Field2         byte
>             end
>           end
>OuterQueue queue,pre(oq)
>Field3       byte
>Nested       group(Inner),pre(n)
>Field4         byte
>             end
>           end
>CW1.501 gives a "not valid inside structure" message. I hope CW 2.x will
>compile this.

This does not compile in CW 2.001.01 either. I will pass this on and
see if there is a workaround.

HTH's

Mike Gould

+--------------------------------------------+
| Michael Gould                              
| TopSpeed Corporation - Consulting Division  
| Team TopSpeed - Internet                  

| CIS   :  71756,3176                        
+--------------------------------------------+



Sun, 21 Mar 1999 03:00:00 GMT  
 QUEUE in QUEUE

Hi Joachim,

Quote:
> I've got a chicken-and-egg problem here. I don't have CW 2.0, I need this
> information (among others) to persuade my employer to buy it...
> Anyway, thanks for the info.

Well I suppose the simple answer is that yes in CW 2 it can be done.  
The rest, as they say, is just politics...

Cheers
Bruce



Sun, 21 Mar 1999 03:00:00 GMT  
 QUEUE in QUEUE

Joachim,



Quote:
> Inner      group,pre(ig)
> Field1       byte
> InnerQueue   queue,pre(iq)
> Field2         byte
>              end
>            end
> OuterQueue queue,pre(oq)
> Field3       byte
> Nested       group(Inner),pre(n)
> Field4         byte
>              end
>            end

You can not do this directly in CW 2.x. The way to accomplish this is:

ByteQueue       QUEUE,TYPE
Field2            BYTE
                END

Inner           GROUP,PRE(IG)
Field1            BYTE
InnerQueue        &ByteQueue
                END

OuterQueue      QUEUE,PRE(OQ)
Field3            BYTE
Nested            GROUP(Inner),PRE(N)
Field4              BYTE
                  END
                END

This compiles in 2.001.01 and I think it accomplishes what you are looking
for.

Steve

--
Steven C. Gallafent
The Computer Guy

http://ourworld.compuserve.com/homepages/gallafent



Sun, 21 Mar 1999 03:00:00 GMT  
 QUEUE in QUEUE

Quote:

> Hi,

> since I didn't get an answer to my first question, would some kind soul
> please take the following code snippet, compile it under CW 2.0, and report
> the results back to me?

> Many thanks in advance!

> Regards,
> -Joachim

> Create a new application and make Main a Source Procedure. In the Data
> Section embed, add the following code:

> Inner      group,pre(ig)
> Field1       byte
> InnerQueue   queue,pre(iq)
> Field2         byte
>              end
>            end
> OuterQueue queue,pre(oq)
> Field3       byte
> Nested       group(Inner),pre(n)
> Field4         byte
>              end
>            end

> CW1.501 gives a "not valid inside structure" message. I hope CW 2.x will
> compile this.

Hello Joachim,

CW20 gave the error. However if a queue reference is used in the Inner
group, no problem!



Mon, 22 Mar 1999 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. CLASSes and QUEUEs (was: Re: QUEUE in QUEUE)

2. How to make a queue of queue's

3. Queue in Queue?!

4. Queue of Queues problem.

5. Clarification of Queue Operation / Behavior when using multiple Queues

6. QUEUE inside GROUP/QUEUE

7. Queue.Queue examples?

8. Howto wait for multiple queues (Queue.py)?

9. Does the "max queue size" input make a LV 6.1 Queue a constant size?

10. multi-queues

11. Implementing a Queue

12. Windows events queue

 

 
Powered by phpBB® Forum Software