UserFunction variants and C++

I am close to being able to call an external function from fast report. My FR function needs to be able to pass an integer back to the calling program and receive a string back - but I am having a problem in my calling program accessing the variant passed by UserFunction

Variant __fastcall TForm1::frxReport1UserFunction(const UnicodeString MethodName,
Variant &Params)
{
int i;
i = Params;
}

on execute i=Params gives an exception "could not convert variant of type (Array Variant) into type (integer)

I also tried Params[0] but get a compile error "variant::[](const int) is not accesible"

Any ideas?

Comments

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.