Create and select local variables

166 views
Skip to first unread message

ngy...@gmail.com

unread,
Aug 24, 2020, 5:13:48 AM8/24/20
to Blockly
Is there any way to create local variables in a function block and if selecting a variable inside this function block to only show those variables which are available and not all variables like this:   
delete.png

Beka Westberg

unread,
Aug 24, 2020, 9:48:17 AM8/24/20
to blo...@googlegroups.com
Hello,

There is no built-in way to do this :/ Scoping of variables is very language dependent, which makes it hard to support generally (ie at the Blockly level). However, it would be possible to extend Blockly to do this for whatever language you are modeling. For example App Inventor has support for local variables [blocks, logic] (the fact that they are modeling a Scheme variant makes this really easy). So if you want to add this it is definitely achievable!

Sorry I can't be more help :/
--Beka 

On Mon, Aug 24, 2020 at 2:13 AM ngy...@gmail.com <ngy...@gmail.com> wrote:
Is there any way to create local variables in a function block and if selecting a variable inside this function block to only show those variables which are available and not all variables like this:   
delete.png

--
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/81c13591-c926-4e14-a607-07704314713bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages