/// <summary> /// The method that represents the 'load' function in the language. /// Loads a script file with the specified file name (given by a TString) and runs it. /// </summary> /// <param name="interpreter">The interpreter that the method is being called from.</param> /// <param name="args">The arguments being passed to the function as a TArgumentList.</param> /// <returns>TNil</returns> public static TType Load(Interpreter interpreter, TArgumentList args) { TString fileName = args[0] as TString; if (fileName == null) return new TException(interpreter, "Name of file to load must be given as a string"); interpreter.LoadFile(fileName.Value); return TNil.Instance; }