Page 1 of 1

Slicken up 'C' component macro editing

Posted: Fri Dec 26, 2014 9:59 pm
by Brendan
Hope you all had a good Xmas :)

My 2-bits...

When editing the 'C' component macro, I believe it would make perfect sense for Flowcode to facilitate selection of declared variables/C-styled functions/etc (just as with any other component macro or calculation), plus automating uppercase conversion and the required FCx_ prefix (or local variable prefixing) in front of the entry.

Furthermore, when hitting "OK" to confirm edits, perhaps the semicolon could be automatically appended to the end of each line if it doesn't exist - unless I've overlooked possible exceptions to regular line termination?

From personal experience this would save a lot of typing, typo's, and similar errors with large/multiple C code blocks, and reduced potential for resident faults only to be discovered at build/run time, though please don't ask what inspired these suggestions :wink:


All the best,
Brendan

Re: Slicken up 'C' component macro editing

Posted: Fri Dec 26, 2014 10:44 pm
by kersing
Hi,

To include Flowcode variables, select them in the right hand pane, just like in calculations. That will insert the variable name in C style.

Trying to add all kinds of semi colons and other syntactic 'sugar' would be dangerous as it would require Flowcode to guess the programmers intentions. When writing C code I regularly use continuation lines, Flowcode should not add semicolons to those lines.

What about

Code: Select all

vara =
 varb = 
varc = 1;


Perfectly valid C code, what would a semi intelligent IDE turn this into??

Re: Slicken up 'C' component macro editing

Posted: Sat Dec 27, 2014 12:37 am
by Brendan
Hi.

Thanks, and continuation lines noted.

I was attempting to use the same double-click method as per calculation and other flow icons, but have observed that drag-&-drop must be used for the C component.


All the best,
Brendan

Re: Slicken up 'C' component macro editing

Posted: Mon Jan 05, 2015 3:59 pm
by Benj
Hello,

I'll make a note of the double click problem in our bug tracker as that sounds like a bug to me. Direct access to graphical lists of registers in the C icon would be a very nice feature.

Re: Slicken up 'C' component macro editing

Posted: Wed Jan 07, 2015 1:58 am
by Brendan
That's fantastic - Thanks Ben :)

All the best,

Brendan