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

Control Basic TBL function needs to handle variable lookup #428

Open
lonerzzz opened this issue Jul 5, 2023 · 3 comments
Open

Control Basic TBL function needs to handle variable lookup #428

lonerzzz opened this issue Jul 5, 2023 · 3 comments

Comments

@lonerzzz
Copy link

lonerzzz commented Jul 5, 2023

The current Control Basic TBL functionality has been promised for some time but it is unclear how it would work. If it is only for static value lookup it is of limited use. The function should be able to take a variable memory location to represent the head of the table and an offset into that table in order to retrieve values. This would save considerable amounts of code where repeated 'if' structures are currently required to select the appropriate value in a table. The following is how it is now required to use variable based tables.

10 if value = 0 then lookupValue = var10
20 if value = 1 then lookupValue = var11
30 if value = 2 then lookupValue = var12
40 if value = 3 then lookupValue = var13
50 if value = 4 then lookupValue = var14

when it would really make sense to have the following instead:

10 lookupValue = tbl( value, var10 )

Between the the small program sizes and the lack of table functionality, far more code must be written to handle something relatively simple and common in programs

@Fance
Copy link
Collaborator

Fance commented Jul 7, 2023

I'll be working with our embedded engineers next week to figure out how to handle this list .Thanks!

@lonerzzz
Copy link
Author

Please retain this issue as a feature request as as the current implementation references fixed values which solves a different problem. Allowing table/array like access to variable values would be very useful functionality.

@MauriceDuteau
Copy link
Contributor

I will have our crew add some instructions on how to use the new TBL function, it is done but I cannot recall the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants