-- Simple program to demonstrate the use of luabarcode write "\nPlease enter the number to be encoded: " code = read("*l") write "\nType of image to generate (jpeg or png): " type = read("*l") write "\nName of the file to be created: " filename = read("*l") p,e = barcode(code) if p == nil then error(e) end r,e = savebarcode(p, type, filename) if r == nil then error(e) end write("\n\nFile saved to "..filename.."\n")