コード例 #1
0
        public DynValue ChangeDirectory(Interpreter interpreter, ClrFunctionArguments args)
        {
            args.ExpectExactly(1)
            .ExpectTypeAtIndex(0, DynValueType.String);

            var path = args[0].String;

            try
            {
                Directory.ChangeWorkingDirectory(path);
                return(DynValue.Zero);
            }
            catch
            {
                return(new DynValue(-1));
            }
        }