vrruiz / visualino

A desktop version of Roboblocks, a block-based programming environment for Arduino.
BSD 2-Clause "Simplified" License
42 stars 39 forks source link

Windows: Save and open same program duplicates the blocks #19

Open vrruiz opened 8 years ago

vrruiz commented 8 years ago

Test case.

Expected result.

Actual result.

Reported by rlmoreno: http://visualino.net/forum/index.php/topic,14.msg0/boardseen.html#new

vrruiz commented 8 years ago

For some reason, JST is escaping nested if/else blocks. Generating the code avoiding JST solves the problem:

    code += 'if (' + argument + ') {\n' + branch + '}';
    /*
    code += JST['controls_if']({
        'argument': argument,
        'branch' : branch
    });
    */
Lt-Henry commented 4 years ago

Hey! A teacher just mail me with a visualino project where there are two empty main blocks (setup-loop) and a third one where the teacher works on. Those empty blocks cannot be deleted, and code generation is messed up. Loop code is properly generated but setup part is not, but setup code is generated from one of those empty blocks.

I have tried to fix it with a text editor removing those extra blocks with no luck, visualino does not load anything. I even tried switch deletable flag to true with same result: nothing loads. duplicate.txt

Lt-Henry commented 4 years ago

Ok, I am not even close to figure it out but at least, I got the project working editing xml with a text editor. Perhaps... xml parser does not allow \n characters?

vrruiz commented 4 years ago

I think in old versions there was a way to add multiple main blocks (an error), but not to remove them. I think I removed that option. And the solution is to remove the duplication manually... I know, that sucks.

On Wed, Apr 8, 2020 at 9:09 PM Enrique M.G. notifications@github.com wrote:

Ok, I am not even close to figure it out but at least, I got the project working editing xml with a text editor. Perhaps... xml parser does not allow \n characters?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

-- Víctor R. Ruiz http://rvr.blogalia.com/