Block type: 'global-declaration-statement' - An block which declares a global variable. The variable name is scoped to the entire program.
and while hovering over the variable name:
Block type: 'lexical_variable_get' - Exactly analogous to the setter block.
for loop--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CAOk7GcS4LYqSnVSXH15ainYy9w-Z4FLrxNvbHPjdACh2SZt-GA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CAEBzR94TFq5x63Z7wPVbHtLPtA09-hVUaXrhju3ib1T0%3D8bnHQ%40mail.gmail.com.
While hovering over the variable name:
Block type: 'global-declaration-statement' - An block which declares a global variable. The variable name is scoped to the entire program.
and while hovering over the variable name:
Block type: 'lexical_variable_set' - Note that despite the block type name, the same block is used for global variables, local variables, loop variables and function/procedure parameters. The names that appear in the dropdown will change according to the placement of the block. I.e., it will show the variables that are in scope for that getter according to which blocks it is within.
Block type: 'lexical_variable_get' - Exactly analogous to the setter block.
Block type: 'controls_for' - A block which enables a for loop
Block type: 'controls_forEach' - A block which enables a loop over the items in a list
Block type: 'procedures_defnoreturn'
Block type: 'procedures_defreturn'
Block type: 'procedures_callnoreturn' - Note that, though I don't show it here, the procedure name field is a dropdown which allows the user to select any procedure and the block will change to match that procedures name and parameters.
Block type: 'procedures_callreturn' - This has the same dropdown behavior as the previous procedure call block.
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CAOk7GcQmSCPAjE%2Bgo_H5oj4%2Bemc7DcfnF0-HeuFOd8vXf96VMQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CACptYiLPBo34T-1JieXr_yf7whVvvr9__D4OTGe-AmU4UG3cpQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/CAEBzR96fAeHs35%2BrZnyvkDmarjSECmou2Q%2Bk9PX-1zeocCXYWw%40mail.gmail.com.
Thank you very much for turning your work into a plugin.
The way we do local variables involves Blockly core changes, it's good to see it can be done without touching core. Are you tracking a variable's scope by prefixing its name? I'd like to understand that better.
I don't think we can integrate the plugin though, because we'd have to redo a lot of educational material and migrate existing projects.
The flyout field seems very useful on its own, maybe it could also be a plugin.
Thank you Mark. So all variable-creating block types have to be handled in the field's variable gathering code. I would surely forget to update that code when adding such a block type. Maybe blocks could implement a method like getMyDeclaredVariables instead, to make this easier to extend. Though I may forget using that one as well.
I don't know if or when I get to work on integrating the flydown field, so no rush. But thank you for the offer!UweOn Tuesday, October 12, 2021 at 9:46:43 PM UTC+2 mark.f...@gmail.com wrote:On Tue, Oct 12, 2021 at 7:44 AM Uwe K <seldom...@gmail.com> wrote:Thank you very much for turning your work into a plugin.You're welcome!The way we do local variables involves Blockly core changes, it's good to see it can be done without touching core. Are you tracking a variable's scope by prefixing its name? I'd like to understand that better.The scope is determined by block containment. You can see the code which computes the variables that are in scope here.I don't think we can integrate the plugin though, because we'd have to redo a lot of educational material and migrate existing projects.I understand. It's tough for teachers to switch to new material!The flyout field seems very useful on its own, maybe it could also be a plugin.
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/e0a3c493-e160-4ca3-852f-9f641b78ae3en%40googlegroups.com.
Hi,After looking at this addition, I have a small question:The function block returning a value doesn't have a body (in opposed to the one that doesn't return a value). Is it a bug?
Also, is it possible to define variable in the function scope, or just under their "own" scope?
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/05d16f77-0eae-4714-bd98-ec79ef13040dn%40googlegroups.com.