Example #1
0
        //----------
        // main() serves as the program entry point.
        // gotta have one Main() function per program.
        // it is responsible for:
        // 1) handling the inputs to the program (command line arguments),
        // 2) overseeing the program functionality, and
        // 3) returning the output result of the program.
        //----------
        public static int Main(string [] args)
        {
            Useful.dumpStringArray(args, "command line arguments:");

            int result = driver();

            Console.WriteLine("\ndisplay result by typing ");
            Console.WriteLine("    \"echo %ERRORLEVEL%\" in Windows, or ");
            Console.WriteLine("    \"echo $?\" in Linux \n");
            return(result);
        } // end Main() function
Example #2
0
        //----------
        public static int Main(string [] args)
        {
            Useful.dumpStringArray(args, "command line arguments:");

            int result = driver();

            // return the terminal status of the program back to the user.
            // normally for command line interface programs,
            // a return code of 0 means "SUCCESS"
            // anything else means "FAIL"
            Console.WriteLine("\ndisplay result by typing ");
            Console.WriteLine("    \"echo %ERRORLEVEL%\" in Windows, or ");
            Console.WriteLine("    \"echo $?\" in Linux \n");
            return(result);
        } // end Main() function