According to the C5 doco I can use a GROUP,TYPE to define the structure of a QUEUE. I can’t seem to get it to work. I’m not sure if the doco is correct or it’s a bug or I’m not understanding correctly. Perhaps someone can shed some light?
In the APP/Global Data I declare a GROUP,TYPE first:
POSTCODEGT GROUP,TYPE
Suburb STRING(40)
State_Territory STRING(3)
Postcode STRING(4)
END
and then create a QUEUE,TYPE using the GROUP,TYPE to give it (inherited) structure:
POSTCODEQT QUEUE(POSTCODEGT),TYPE
END
however when I use the QUEUE,TYPE as a parameter/prototype in a procedure, when I call that procedure I get:
Syntax Error: No matching prototype available
Syntax Error: Parameter kind does not match
If I declare the QUEUE,TYPE identically to the GROUP,TYPE no error.
You’re using my preferred approach.
But I developed it after I moved on from C5
So I don’t know if it worked in C5, and I no longer have a 32 bit OS to test it …
The following program works in C10,
Can you please test it in C5.
PROGRAM
POSTCODEGT GROUP,TYPE
Suburb STRING(40)
State_Territory STRING(3)
Postcode STRING(4)
END
POSTCODEQT QUEUE(POSTCODEGT),TYPE
END
MAP
Dump(*PostCodeQt Q)
END
MyQ POSTCODEQT
CODE
MyQ.Suburb = 'A'; MyQ.State_Territory = 'FL'; ADD(MyQ)
MyQ.Suburb = 'B'; MyQ.State_Territory = 'WI'; ADD(MyQ)
Dump(MyQ)
Dump PROCEDURE(*POSTCODEQT Q)
Ptr LONG,AUTO
CODE
LOOP Ptr = 1 to RECORDS(Q)
GET(Q, Ptr)
MESSAGE('Rec['& Ptr &']|Suburb['& Q.Suburb &']|State_Teritory['& Q.State_Territory &']')
END