Page 1 of 1

ushort with error function type definition

Posted: Wed Jun 06, 2012 8:13 am
by jeflores
when you create a function in Flowcode v5, void Address_set (ushort x1, y1 ushort, ushort x2, y2 ushort) The unsigned integer variable is not set, I had to add the following code (ushort typedef unsigned int;), to compile correctly

Re: ushort with error function type definition

Posted: Thu Jun 07, 2012 10:15 am
by Benj
Hello,

I don't think ushort is standard C syntax which is why it is not supported by default. Some compilers may specifically type define this for you to use but most won't have it by default as they use the more generic unsigned int instead.

Re: ushort with error function type definition

Posted: Fri Jun 08, 2012 8:20 am
by jeflores
the variable type (ushort) was defined by Flowcode, to create a new macro of type integer. when you try copilar gave error, undefined variable. agrege the definition of new type and compile correct. I just want you in Flowcode check where is the error for not being manually adding the definition of the variable type, which incidentally is new flowcode5.
regards

Re: ushort with error function type definition

Posted: Fri Jun 08, 2012 11:49 am
by Benj
Hello,

I have just given this a go in v5.2 and the code seems to be being generated correctly.
ss1.JPG
ss1.JPG (26.85 KiB) Viewed 3193 times
Here is the C code from the macro I made.

void FCM_ben1(MX_UINT16 FCL_BEN1_TEST)

The MX_UINT16 is the Flowcode unsigned int data type.