renciso218 / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

No way to delete a variable #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Once a variable is created, there is currently no way to delete it.

- Need function in Blockly.Variables for programmatic interaction

- Need means of deleting a variable from the gui, possibly via an additional 
item in Blockly.Variables.dropdownCreate().

This requires some thought, though. Should deleting a variable that is used 
elsewhere cause it to disappear globally? Should the deletion be ignored until 
all uses are removed?

Original issue reported on code.google.com by derrell....@gmail.com on 10 May 2012 at 5:23

GoogleCodeExporter commented 8 years ago
Variables are created based on what blocks currently exist in the workspace.  
If you delete all instances of a variable, then the variable ceases to exist.

Steps to recreate:
Create get variable block.
Rename variable to 'foo'.
Observe that exported JavaScript contains 'var foo;' and the Variables toolbox 
contains 'item' and 'foo'.
Delete the variable block form the workspace.
Observe that the exported JavaScript and the Variables toolbox no longer 
contains 'foo'.

Original comment by neil.fra...@gmail.com on 10 May 2012 at 6:09

GoogleCodeExporter commented 8 years ago
Ah, that makes sense.

Original comment by derrell....@gmail.com on 10 May 2012 at 6:17