static void Main(string[] args) { try { if (args.Length < 1) { Console.WriteLine("list"); Console.WriteLine("A commandline tool to list CBM Basic prg files."); Console.WriteLine("By Six/Style 2016"); Console.WriteLine("usage: list filename.prg"); Console.WriteLine(); } else { BASIC basic = new BASIC(); basic.Load(args[1]); List <string> slist = basic.List(); foreach (string s in slist) { Console.WriteLine(s); } Console.WriteLine("Press Any Key To Continue"); Console.ReadLine(); } } catch (Exception e) { Console.WriteLine(e); } }
static void Main(string[] args) { try { if (args.Length < 2) { Console.WriteLine("prg2bas"); Console.WriteLine("A commandline CBM Basic decompiler."); Console.WriteLine("By Six/Style 2016"); Console.WriteLine("usage: prg2bas prgfile.prg basfile.bas"); Console.WriteLine(); } else { BASIC basic = new BASIC(); if (basic.Load(args[0])) { List <string> slist = basic.List(); File.WriteAllLines(args[1], slist); } else { Console.WriteLine("Load error: " + basic.LastError); } } } catch (Exception e) { Console.WriteLine(e); } }