lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Dear all,

I am having an issue when indexing the table output of a function. 

I needed a physical unit conversion functionality and found the great function below on github:
https://github.com/wipfl/lua-physvalue

I needed to make some modifications to output a table instead of string. Now after my minor modifications the function outputs a table with 'value' and 'unit' indices (see the modified function in the attachment). However I cannot index the output table with 'unit' afterwards, it always returns to nil.

I am a beginner in lua and I use it at very basic level so I am not able to understand what the problem is. 

I would appreciate if you help me to fix this issue.

Many thanks in advance.

Best,

Hur

Attachment: middleclass.lua
Description: Binary data

Attachment: MIT-LICENSE.lua
Description: Binary data

Attachment: physvalue.lua
Description: Binary data

Attachment: unit_conv_MIT_test.lua
Description: Binary data