Hi Goergio,
2 things:
<CODE>
{(gsQryName+"."+gsQryPCode),indQueryParameter} = sCode
Can be simplified as
{gsQryName+"."+gsQryPCode,indQueryParameter} = sCode
and
HExecuteQuery(({gsQryName}),hQueryDefault)
should be
HExecuteQuery(gsQryName,hQueryDefault)
</CODE>
In the first case, the parenthesis are not needed (first parameter of an indirection is a string, and you do not need parenthesis to concatenate strings
In the second, it's even more simple, as hExecuteQuery accepts the name of a query as a string, therefore a variable containing a string should be immediately usable
Best regards