microsoft / pxt

Microsoft MakeCode (PXT - Programming eXperience Toolkit)
https://makecode.com
MIT License
2.07k stars 577 forks source link

Dropdown menu vs. variable #10015

Open nevergone opened 3 months ago

nevergone commented 3 months ago

Where there is a dropdown menu, why can't you put a variable there? It would help children a lot in learning proper programming.

Related issue: https://github.com/microsoft/pxt-microbit/issues/5558

sae220 commented 3 months ago

I created pull requests for this (https://github.com/microsoft/pxt-microbit/pull/5700).

nevergone commented 3 months ago

Hey @sae220, this great work. But can you improve on this? Screenshot_20240529-185850

nevergone commented 3 months ago

Just checking for equality doesn't seem to work.

let test1 = DigitalPin.P0
let test2 = DigitalPin.P1
if (test1 == test2) {

}

Screenshot_20240529-210920

sae220 commented 3 months ago

Sorry, but I can't solve this problem soon. This doesn't seem a specific problem in pins but in all enums (e.g. blocks in Minecraft). But I think it doesn't need to be solved because it works well when it is not obviously inequal.

variablePinParam_2