Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension tells me not to use changed() on a wirelink #8

Open
NovaAstral opened this issue Dec 19, 2021 · 2 comments
Open

Extension tells me not to use changed() on a wirelink #8

NovaAstral opened this issue Dec 19, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@NovaAstral
Copy link

Several of my e2's have this problem where the Extension says 'Don't use changed(). Either use ~ or call this code from where you changed the variable'
However, on every single one of these E2's the changed() is on a wirelink, and trying to use ~ on a wirelink just gives the error
No such operator: get number[string, number]

@Vurv78
Copy link
Owner

Vurv78 commented Dec 19, 2021

~ can only be used on @inputs variables, so make sure that's true.
Also I assume as you are trying to check if a wirelink changed(), you should instead be using the -> operator, which returns 1 if the input was wired into the e2. So just replace changed(XWl) with ->Xwl

Otherwise as the rest of the warn says, just call this code from where you changed the variable

Note this is just a warning/lint and you can ignore/disable them in vscode settings

@Vurv78
Copy link
Owner

Vurv78 commented Dec 19, 2021

Maybe I'll add the -> operator to the warning for the future... Right now trying to focus on getting this to work on the web browser.

Thanks for the report

@Vurv78 Vurv78 added the documentation Improvements or additions to documentation label Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants