Reported : colon in equation

Moderator: Adrian

Simulator_admin
Site Admin
Posts: 237
Joined: Thu Feb 02, 2012 6:07 pm

Reported : colon in equation

Postby Simulator_admin » Tue Sep 13, 2016 6:10 pm

(by IOK) 1.) The following equation
-------------------------------------------------------------------------------
int iLenClear = 13;
int paddedSize = ((iLenClear / 8) + (((iLenClear % 8) == 0) ? 0 : 1))*2;
...
-------------------------------------------------------------------------------
will not multiply by 2 at the end. The variable paddedSize will be 2, but has to be 4.

2.) You can not assign any value to the hand over array "dest" in the argument. All the time it dest[0] or other elements contain 0:

-------------------------------------------------------------------------------
void pack(unsigned long* dest, int iLenDest) {
dest[0] = 13;
...
-------------------------------------------------------------------------------

The hand over array "dest" has enough array elements and was well defined and initiated.

On the arduino itself it works fine. What is the problem with your software? Thanks.

With the first item, we can confirm this is an error. If the mouse is right clicked in the Sketch Area and the Errors Enabled (last item on menu) this line issues a false error. This was due to some recent changes in the Simulator to skip past labels where the label is written as label1:. The semicolon : in this line is tripping the Simulator up, and we have rectified this with a simple change. Now the brackets are checked, and any semicolon within brackets is skipped.

With item 2, this is related to pointers and we do not support pointers yet in the Simulator since this requires managing a full memory map of all the variables.

Return to “Version 1.02”

Who is online

Users browsing this forum: No registered users and 1 guest