Página 1 de 1

GetHbArrayVar ()

Publicado: Sab May 24, 2014 12:16 am
por a.ilic
Hi,
I'm having problem with GetHbArrayVar function.
It works ok, if in Harbour we have a variable defined like this:

PRIVATE aFormat := { 'PDF', 'PNG', 'JPG' }
and in FR:

var
cFormat: String;
procedure DoSomething();
begin
cFormat := GetHbArrayVar('aFormat', 1);
ShowMessage(cFormat); // shows PDF
end
But not, if we have an array of arrays:

PRIVATE aFormat := {}
AAdd(aFormat, {"PDF", "PDF format"})
AAdd(aFormat, {"JPG", "JPG format"})
and in FR:

var
aFormat: array of Variant;
procedure DoSomething();
begin
aFormat := GetHbArrayVar('aFormat', 1);
ShowMessage(VarToStr(aFormat[1])); // shows empty string and FR crashes
end
Any help appreciated.
Regards,

GetHbArrayVar ()

Publicado: Lun May 26, 2014 10:29 am
por ignacio
Buenos dí­as,
A FastReport sólo se pueden pasar tipo básicos y entiende muy poco de matrices creadas por Harbour. Le recomiendo que utilice en dicho caso la función EvalMacro(). En su caso serí­a:
EvalMacro('aFormat[x,y]')
Es posible que tenga que definir aFormat como pública.
Un saludo

GetHbArrayVar ()

Publicado: Mié May 28, 2014 10:36 pm
por a.ilic
ignacio wrote on Mon, 26 May 2014 10:29Buenos dí­as,
A FastReport sólo se pueden pasar tipo básicos y entiende muy poco de matrices creadas por Harbour. Le recomiendo que utilice en dicho caso la función EvalMacro(). En su caso serí­a:
EvalMacro('aFormat[x,y]')
Es posible que tenga que definir aFormat como pública.
Un saludo
Thank you for the answer. I've used Google translate to understand it
Regards,

GetHbArrayVar ()

Publicado: Jue May 29, 2014 12:03 pm
por ignacio
a.ilic escribió el mié, 28 mayo 2014 22:36Thank you for the answer. I've used Google translate to understand it
Regards,
Sorry for that.
Regards,