Page 1 of 1

Problem with Macro that return a string

Posted: Thu Feb 02, 2012 3:22 pm
by JCMB
Compiling Test01.fcf to HEX give the error:
Test01.c(128:11): error: ',' expected
In Test01.c J read:
void FCM_HM2Txt2(MX_CHAR* FCR_RETVAL, MX_UINT8 FC_HM2TXT2_SZ_RETURN)
{

MX_CHAR

//Calcul
//Calcul:
// .Return = "abcdef"
FCI_SCOPY("abcdef",6, FCR_RETVAL,FC_HM2TXT2_SZ_RETURN);

}

What the use of MX_CHAR ?

Re: Problem with Macro that return a string

Posted: Thu Feb 02, 2012 3:44 pm
by Steve
Thanks for this. We have seen this before and have solved it, but you will need for an official patch for an actual fix.

The problem affects all user macros that return a string.

There is a simple workaround for now. At the beginning of your macro, add a C code icon with the following text:

Code: Select all

string_return_bug_workaround;