Conversion to string or number

Added by iNTERFACEWARE

How to convert numbers and node trees to a to string representation, and how to convert a numeric strings to numbers

Source Code
   -- convert a number to a string
   local number = 1234
   local string = tostring(number)
   trace(number, string)
   
   -- convert a numeric string to a number
   local string = '4321'
   local number = tonumber(string)
   trace(string, number)
   
   -- convert an HL7 node tree to a string (very common usage)
   -- works with all node trees types (HL7, XML etc)
   
   -- need a parsed HL7 message to use
   local Msg = hl7.parse{vmd = 'example/demo.vmd', data = Data} --    
   -- using tostring()
   local hl7String = tostring(Msg)
   -- the :S() function is a builtin shorthand to tostring()
   local hl7String = Msg:S()
   trace(Msg, hl7String)
Description
How to convert numbers and node trees to a to string representation, and how to convert a numeric strings to numbers