Page 2 of 2

Re: Macro Creator (feedback wanted)

Posted: Tue Apr 13, 2021 11:06 am
by stefan.erni
Hi Martin

It's working very nice!
Can you program the blue text "www.flowcodexchange.com"
as a link?
I am interested in what happens next.
regards and thanks a lot

Stefan

Re: Macro Creator (feedback wanted)

Posted: Tue Apr 13, 2021 6:52 pm
by p.erasmus
Martin

Very nice :D :D :D

Re: Macro Creator (feedback wanted)

Posted: Wed Apr 14, 2021 2:44 pm
by mnfisher
Thanks Stefan and Peter,

So this is the final version (for now!)

There are a few changes...
clicking on flowcodexchange now opens edge on the page. (for Stefan!)
Clicking on the coffeecup links to the buymeacoffee page (for Me :D )

It will now either add to a file (click add to) or to a template (imaginatively named template.fcfx) which needs to be in the same directory. I expect users to save their own 'template' here (favourite MCU etc). Just clicking 'Save As' adds to template.fcfx thus creating a new project.

I've added a 'parameters' field. Add any required parameters for the macros using the format 'type name, type2 name2 ... typen namen' Arrays are supported using '[' and ']' (size is also needed for strings but not in return values). Parameters are comma separated and type can be bool or boolean, float or real, int, uint, byte, long, ulong, string or handle as before)

So a possible entry in Parameters would be 'byte number, ulong values[10], string str[20]' (without the quotes) which would add 3 parameters (number, values and str) to a macro.

There is (absolutely) no error checking - so adding something like byte x[2v] probably won't cause a crash - but won't give the 'expected' result either.

In retrospect - I probably should have had one column per parameter. However - as it is currently would allow 'locals' to be added very simply.
FC__00052.jpg
FC__00052.jpg (43.95 KiB) Viewed 3273 times
Would create four macros (Test and Scroll marked as downloadable and TestSim and ScrollSim as their simulation counterparts) Note that the simulation names do not have to end with 'Sim' but do by convention.
TopDown.zip
(2.99 MiB) Downloaded 459 times
Martin

Re: Macro Creator (feedback wanted)

Posted: Wed Apr 14, 2021 3:09 pm
by mnfisher
Having said it was a final version...

I added a clear, load and save macro list function.. This 'works' but loading the macro list slightly messes with the layout of the grid (highlighting of column names and line numbers goes and column widths are reset) - however it save the macro list as a user editable list so it 'might' be useful?

I could reset these visual glitches - but it would be a lot more code than needed to actually load and save the file - so I won't bother unless anyone thinks it would be useful?
TopDown.zip
(2.99 MiB) Downloaded 479 times
Martin