Prototype Queue or Group

I am creating a dll with a procedure to make an impression. My question is how can I send a group or a queue as a parameter.

Thank you so much

Generic queues and groups:

myproc1 procedure(queue q)
myproc2 procedure(*queue q)
myproc3 procedure(group g)
myproc4 procedure(*group g)

Typed queues and groups:

GrpType group, type
f1 long

myproc5 procedure(GrpType g)

See Clarion help.


I will try soon

Note, groups and queues are always passed by address
You can use CONST if you want compiler warnings if you alter the group or queue buffer
Otherwise, I think it’s clearer to explicitly add the * (for by address) as in *group

Note, if you wish to only pass a queue buffer, vs. the entire queue
I find it cleanest to define the queue as follows.

gtYada    GROUP,TYPE
SomeField   LONG
Another     LONG

qtYada    QUEUE(gtYada),TYPE

then you can write

 ProccessBuffer PROCEDURE( *gtYada Buffer )
 ProcessQ       PROCEDURE( *qtYada Q )

Say you have

Q   &qtYada
    Q &= NEW qtYada
    DO FillQ
    ProcessBuffer( Q ) !<-- notice I'm passing Q as a gtYada (a group)
    ProcessQ( Q )      !<-- notice I'm passing Q as a qtYada (a queue)

Hi Mark - You can also create a &GROUP reference to a queue. I have done this. @Mike_Duglas also does that in his cJSON class. Look at json::CreateArray PROCEDURE(*QUEUE que, BOOL pNamesInLowerCase = TRUE, <STRING options>)

1 Like