![]() |
Easiest way to get datatype string - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Easiest way to get datatype string (/showthread.php?tid=4146) |
Easiest way to get datatype string - Hadeel - 13.07.2022 Hi ! I want to get a datatype of each object as "dt.bool" or "dt.bit2". When I use the function grp.find('0/1/0').datatype, it gives me a number like 1, 2, not a datatype string. Is there a mapping table somewhere so that I can get a datatype string as "dt.bool" or "dt.bit2" ? For now I am trying to create a mapping table like this below but I am not sure if all of them are correct. Is there any other way? Code: local convertToString = { RE: Easiest way to get datatype string - admin - 13.07.2022 Use this example. It also handles sub-datatypes which don't have a dt table entry (e.g. 01.011 -> dt.bool). Code: mapping = {} RE: Easiest way to get datatype string - Hadeel - 13.07.2022 Thank you very very much admin !! It's working perfect (: |