- 0
function parameters and tables
-
Similar Content
-
- 4 answers
- 372 views
-
- 0 comments
- 4,032 views
-
- 1 answer
- 446 views
-
- 10 answers
- 1,404 views
-
- 0 replies
- 195 views
-
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Question
Platonic
Hi, i stumbled on a new issue while learning. Or i would say that i am not understanding the mechanic i just did because its not how i readed it from docs.
currently in the first function, instructionSet is of type number. and compared to the hex 0x40
but if i change the name of the parameter of the function "instructions"
instructionSet is then not recognized anymore as type number but changes to a type table. I am then forced to let it know that i want to compare int values specifying field value, (the fact that it changes from number to table i don't understand)
In some sources i understand that parameters can basically have any name. So if i use the table name as a function parameter i should only be able to use them in the function it self. Or at least, the functionality of the body in the functions should not be directly effected by some parameter change. Then there is the other part of the script which i have questions about.
In the function dataTypes
i use "instructions" as a parameter which i don't think would be an issue. And as values i use "instructionSet" which is where i would as my other question.
why is instructionSet here of type table?
during comparison with 0x40 its type was a number. Then in the other function it changed back to type table.
then when i want to compare it in function dataTypes i am forced to compare it as a table. which is for my current understanding odd.
Some insights would be great. Thank you.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now