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

[expr~] allow signals to set array's index #719

Open
gabochi opened this issue Aug 9, 2019 · 8 comments

Comments

@gabochi
Copy link

commented Aug 9, 2019

It is possible to change the array index on [expr] depending on the input. For example:

expr array1[$f1%10]

But, when working with signals, it doesn't work (just fixed index will be recognized):

expr~ array[10] ..........is OK
expr~ array1[$v1] ......doesn't work

It is truth that you could replace this expression with a [tabread~] but I would like to implement it in more complex expressions, combining several operations, as expected with expr~.

@porres

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2019

it takes floats, do you want to request that it'd take signals as well? I don't know what's preventing it

@Spacechild1

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2019

unless you want to request that it'd take signals instead,

I think that's what he's saying ;-)

@porres

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2019

yeah, I didn't read it carefully, I see now he's mentioning how one can use '$f1', sorry...

Can I propose the title change to:

request: allow signals to set array's index in 'expr~'

?

@gabochi

This comment has been minimized.

Copy link
Author

commented Aug 9, 2019

Yes, totally, that's what I meant (and the reason I put $v1 in the example). Do you think is it possible and keep it recursive still like in expr~ array[$v1/1000%3+5] or so?

Thank you all.

@gabochi gabochi changed the title [expr~] Changing the array index won't work [expr~] allow signals to set array's index Aug 9, 2019
@porres

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2019

I don't understand what you mean by "recursive still", but it surely seems possible to add this feature

@gabochi

This comment has been minimized.

Copy link
Author

commented Aug 10, 2019

Yes, doesn't matter, just allow signals ($v?) to set array index in expr~ like you said.

@porres

This comment has been minimized.

Copy link
Contributor

commented Aug 10, 2019

are you planning to do some weird rampcode stuff? :)

@gabochi

This comment has been minimized.

Copy link
Author

commented Aug 10, 2019

I cannot hide it anymore...

@umlaeute umlaeute added the feature label Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.