ushort with error function type definition

Moderator: Benj

Post Reply
jeflores
Posts: 12
Joined: Fri Apr 06, 2012 7:37 am
Contact:

ushort with error function type definition

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ushort with error function type definition

Post 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.

jeflores
Posts: 12
Joined: Fri Apr 06, 2012 7:37 am
Contact:

Re: ushort with error function type definition

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ushort with error function type definition

Post 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 2922 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.

Post Reply