读lua代码,帮我翻译成很容易理解的话,谢谢! function FileSaveLoad()

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了读lua代码,帮我翻译成很容易理解的话,谢谢! function FileSaveLoad()相关的知识,希望对你有一定的参考价值。

读lua代码,帮我翻译成很容易理解的话,谢谢!
function FileSaveLoad()
  local file = io.open("c:\\in.lua", "r");
  assert(file);
  local data = file:read("*a"); -- 读取所有内容
  file:close();
  file = io.open("c:\\out.lua", "w");
  assert(file);
  file:write(data);
  file:close();
  end
  FileSaveLoad();
我知道这些代码实现的功能但是不理解这些代码是什么意思?帮忙翻译下,说明每个代码的作用,代码的工作原理,谢谢!


function FileSaveLoad()                    -- 定义FileSaveLoad函数
  local file = io.open("c:\\\\in.lua", "r"); -- 以只读方式打开c:\\in.lua,句柄为file
  assert(file);                            -- 如果打开失败,则抛出异常
  local data = file:read("*a");            -- 读取file的所有内容,存放在data
  file:close();                            -- 关闭file
  file = io.open("c:\\\\out.lua", "w");      -- 以写的方式打开c:\\out.lua,句柄为file
  assert(file);                            -- 如果打开失败,则抛出异常
  file:write(data);                  -- 将data(其实就是c:\\in.lua)的内容写入file
  file:close();                            -- 关闭file
end

  FileSaveLoad();                          -- 执行FileSaveLoad函数追问

函数是每个有功能的代码都可以叫函数吧?
local是声明file为局部变量是吗,io是什么意思?open大概就是打开的意思吧,

assert(file)抛出异物什么意思?

file是什么类型呢,为什么可以file:read这样写呢?

这最后的FileSaveLoad不是就无限循环了吗?

可不可以这样理解,file就是一个打开记事本,可视为假,没注意看原来字符串不一样,意思就是把in.lua的内容转移到out.lua里面对吗?

追答

这些问题都不是可以用几句话就能解释明白的,至少我目前还没有这个能力,我给你的建议是找一本编程语言的书,从头到尾仔细阅读一遍。另外,你需要加深下对系统的理解...

参考技术A io可以理解为一个库,其它就是一个table, lua里面的一切数据结构都是table(userdata用C语言扩展的不算)
assert(file)表示如果打开失败,就抛出异常直接退出
file就是类型就是io
file:read, 是file.read(file)的语法糖,就是表自己做为函数的第一个参数

FileSaveLoad调用在end 之后,函数已经定义完了,

不是循环调用。
函数就是把一个in.lua复制到out.lua中去。追问

有点不明白,后面不是调用FileSaveLoad了吗,调用了不是就会再执行吗?

那位好心人帮我翻译中文摘要 非常急谢谢!!!!

摘 要
市场经济的深入发展,一方面为企业的生存和发展提供了越来越广阔的空间,另一方面也使企业之间的竞争更趋激烈。一些企业由于管理不善或遭受外界因素影响导致资金周转不灵、盈利能力下降、资不抵债,陷入债务困境,导致债务重组活动不断发生。债务重组在化解债务风险、调整产权结构、优化资本结构、重新整合经济资源、推动企业在法制化的轨道上持续不断发展,发挥着重要的作用。
经济发展对会计的直接影响,主要体现在会计规则的制定上。2006年修订的债务重组会计准则相对于01准则而言有着许多合理的方面,符合客观实际,比较科学,它的完善,对中国社会主义市场经济的发展、成熟有着重要作用。但同时,由于企业会计准则制订者的有限性,决定了其制订与实施是一个渐进的过程,不可能一蹴而就,必须逐步完善。因此,通过对企业债务重组理论的研究,不仅可为债务重组制定者提供参考依据,加速会计准则的完善和发展,同时,也将促进会计与资本市场等领域的研究。因此,本文的研究对我国的会计准则建设工作有着重要的意义,而且对证券市场监管者也有重要的参考价值。
由于我国的会计准则被赋予规范企业行为的功能,目前的会计准则建设相对来说,还滞后于资本市场的发展。如何合理、可行地运用06债务重组准则,如何规范债务重组会计核算和信息披露,成为06准则颁布后的重点问题。另外,研究一项具体会计准则的修订有助于分析我国资本市场的现状冰对其规范化提供更多的思路。基于这样的出发点本文认为,06准则在实际运用中仍存在一定的问题,需要继续研究和完善。因此,研究企业债务重组实践问题和06会计准则有效运行正是本文研究的宗旨。
本论文研究的主要目标有:一是研究债务重组财务理论、重组模式及其评价,国有企业债务重组中出现的相应问题;二是对06债务重组会计准则修订作出分析和评价;三是检验债务重组会计准则实务应用状况;四是在前面的研究基础上提出相应措施。
在导论部分主要阐述了本文的选题背景,国内外债务重组理论研究现状,研究目的及意义、主要内容及方法。除导论外,本文共分三章进行阐述,各章主要内容如下:
第一章是全文的基础理论部分,在阐述企业债务重组基本理论基础上,对当前我国企业债务重组基本模式进行了相应的剖析和评价,并对我国国有企业债务重组现状进行了客观的分析,从而提供了研究我国债务重组财务与会计问题的思路和方法
第二章主要就债务重组会计准则改进与完善进行详细的分析,首先从准则的修订背景展开论述,在此基础上,将06债务重组准则和01准则比较、分析、评价,在此基础上对新准则实施过程中的出现的问题进行了分析。
第三章研究了现阶段我国企业债务重组的有利条件,并针对国企债务重组和06准则实施中存在的问题,给出了相应的建议。即合理确定债务重组的范围和对象;改善公司治理.优化内部会计环境;努力构建活跃市场,为公允价值的广泛使用创造条件;建立相应的中介机构,加强评估机构的执法公正、公平性,创建公认的资信评估体系,使资产公允价值获取与债务评估问题迎刃而解;明确债务重组的监管机构及职权;提高会计人员综合素质,尽快适应06准则。
请告收翻译成英文,急急急!

In-depth development of a market economy, on the one hand for the survival and development of enterprises to provide more and broader space, on the other hand so that competition among enterprises become more intense. Some enterprises have suffered because of mismanagement or external factors lead to poor cash flow, profitability declined, insolvent, a debt trap, leading to debt restructuring activities continue to occur. Debt restructuring in resolving the debt risks, adjust the structure of property rights, and optimize the capital structure, re-integration of economic resources, promote enterprises in the legal system on the track of sustainable development, playing an important role.
Economic development of the direct impact of accounting, primarily reflected in the formulation of accounting rules. 2006 amendments to the debt restructuring of the accounting standards in terms of the 01 criteria have many reasonable, in line with the objective reality, more scientific, it's perfect, of China's socialist market economic development, mature play an important role. But at the same time, corporate accounting standards due to the limited development, determine its formulation and implementation is a gradual process, can not be accomplished overnight, to be gradually improving. Therefore, the corporate debt restructuring through the theoretical study, not only for debt restructuring to provide reference for the development, accelerate the improvement of accounting standards and development, but also will promote the accounting and capital markets, and other areas of research. Therefore, the research paper on China's accounting standards building work is of important significance, but also for the securities market regulators also have important reference value.
As China's accounting standards have been given the function of regulating corporate behavior, the current accounting standards building relatively speaking, still lags behind the development of capital markets. How reasonable and feasible to use 06 criteria for debt restructuring, debt restructuring how to regulate accounting and information disclosure, as 06 after the promulgation of guidelines for the priority issues. In addition, the study of a specific accounting standards contribute to the amendment of the current situation of China's capital market to provide more ice on standardized ideas. Based on this starting point of this paper that the 06 criteria in the practical application of certain problems still exist, the need to continue to study and perfect. Therefore, on practical issues of corporate debt restructuring and 06 accounting standards effective operation is the purpose of this paper.
This paper studies the main objectives are: First, on debt restructuring of financial theories, models and evaluation of the reorganization, debt restructuring state-owned enterprises in the corresponding problem of the 06 debt restructuring Accounting Standards Amendment analysis and evaluation; three testing debt restructuring Practical application of accounting standards; four in the previous study on the basis of corresponding measures.
In the introduction to some of the major topics of this paper described the background of domestic and foreign debt restructuring theoretical research the status quo, the purpose and significance, the main content and methods. In addition to Introduction, this paper is divided into three chapters elaborate, the main contents of the chapters are as follows:
Chapter 1 is the full text of some of the basic theory, described in the basic theory of corporate debt restructuring on the basis of the current corporate debt restructuring of China's basic mode of the corresponding analysis and evaluation, China's state-owned enterprises and restructuring the debt status of an objective analysis, Provides a study of China's debt restructuring financial and accounting issues ideas and methods
The second major chapter on debt restructuring to improve accounting standards and improve the conduct a detailed analysis, beginning with the revised guidelines launched on background, on this basis, 06 and 01 criteria for debt restructuring guidelines, analysis, evaluation, on the basis of New guidelines in the process of implementation of the problem was analyzed.
Chapter III of the study at this stage of China's enterprises favorable conditions for debt restructuring and debt restructuring for state-owned enterprises and 06 guidelines for the implementation of the existing problems, given the corresponding recommendations. Debt restructuring that is reasonably determine the scope and object; improve corporate governance. Optimization of internal accounting environment to build an active market for the widespread use of fair value and create the conditions for the establishment of appropriate intermediaries, to strengthen the law enforcement agencies to assess just, fair, a recognized credit rating system so that the fair value of assets and access to debt assessment Solve problems; clear debt restructuring of the regulatory bodies and the terms of reference; improve the overall quality of accounting staff, as soon as possible to 06 criteria.
累死我了/呵呵
参考技术A ★人生在勤,不索何获--张衡

★业精于勤而荒于嬉,行成于思而毁于随 --韩愈

★天才就是无止境刻苦勤奋的能力 --卡莱尔

★聪明出于勤奋,天才在于积累 --华罗庚

★好学而不勤问非真好学者。

★书山有路勤为径,学海无涯苦作舟。

★勤劳一日,可得一夜安眠;勤劳一生,可得幸福长

眠 --达·芬奇(意大利)

★形成天才的决定因素应该是勤奋 -郭沫若

★人的大脑和肢体一样,多用则灵,不用则废 -茅以升

★你想成为幸福的人吗?但愿你首先学会吃得起苦 --屠格涅夫

★灵感不过是“顽强的劳动而获得的奖赏” --列宾

★贵有恒何必三更眠五更起,最无益只怕一日曝十日寒。

★成功=艰苦劳动+正确方法+少说空话 --爱因斯坦

★不经历风雨,怎能见彩虹 -《真心英雄》

★宝剑锋从磨砺出,梅花香自苦寒来。

★自古以来学有建树的人,都离不开一个“苦”字。

★天才就是百分之九十九的汗水加百分之一的灵感 --爱迪生

★艺术的大道上荆棘丛生,这也是好事,常人望而却步,只有意志坚强的人例外 --雨果
--------------------------------------------------
(转贴)
天才不是别的,而是辛劳和勤奋 —— 比丰

谨慎的勤奋带来好运 —— 英国

科学是为了那些勤奋好学的人,诗歌是为了那些知识渊博的人 —— 约瑟夫·鲁

没有人会因学问而成为智者。学问或许能由勤奋得来,而机智与智慧却有懒于天赋 —— 约翰·塞尔登

没有任何动物比蚂蚁更勤奋,然而它却最沉默寡言 —— 富兰克林

勤奋的人是时间的主人,懒惰的人是时间的奴隶 —— 朝鲜

勤奋和智慧是双胞胎,懒惰和愚蠢是亲兄弟 —— 民谚

天才绝不应鄙视勤奋 —— 小普林尼

勤奋者废寝忘食,懒惰人总没有时间 —— 日本

智慧源于勤奋,伟大出自平凡 —— 民谚

我在科学方面所作出的任何成绩,都只是由于长期思索、忍耐和勤奋而获得的 —— 达尔文
合抱之木,生于毫末;九层之台,起于垒土;千里之行,始于足下。

--------------老聃 引自《老子·道德经》

骐骥一跃,不能十步;驽马十驾,功在不舍;锲而舍之,朽木不折;锲而不舍,金石可镂。

--------------荀况 引自《荀子,劝学》

天行健,君子以自强不息。

--------------《周易·乾》(秦汉前儒家经典)

流水不腐,户枢不蠹,民生在勤。

--------------张少成

勤能补拙是良训,一分辛劳一分才。

--------------华罗庚

在艺术上我决不是一个天才。为了探求精深的艺术技巧,我曾在苦海中沉浮,渐渐从混沌中看到光明。苍天没有给我什么独得之厚,我的每一步前进,都付出了通宵达旦的艰苦劳动和霜晨雨夜的冥思苦想。

--------------范曾(当代书画家)

聪明在于勤奋,天才在于积累。

--------------华罗庚

古往今来,凡成就事业,对人类有所作为的,无不是脚踏实地,艰苦登攀的结果。

--------------钱三强(当代物理学家)

我们每个人手里都有一把自学成才的钥匙,这就是:理想、勤奋、毅力、虚心和科学方法。

--------------华罗庚

攀登科学高峰,就像登山运动员攀登珠穆朗玛峰一样,要克服无数艰难险阻,懦夫和懒汉是不可能享受到胜利的喜悦和幸福的。

--------------陈景润(当代数学家)

对搞科学的人来说,勤奋就是成功之母!

--------------茅以升(现代桥梁工程专家)

科学的灵感,决不是坐等可以等来的。如果说,科学上的发现有什么偶然的机遇的话,那么这种“偶然的机遇”只能给那些有素养的人,给那些善于独立思考的人,给那些具有锲而不舍的精神的人,而不会给懒汉。

--------------华罗庚转引自1980年5月20日《文汇报》

即使天才,在生下来的时候第一声啼哭,也和平常的儿童一样,决不会就是一首好诗。

--------------鲁迅引自《未有天才之前》

才华是刀刃,辛苦是磨刀石,很锋利的刀刃,若日久不用磨,也会生锈,成为废物。

--------------老舍(现代作家、艺术家)
回答者:幸福飞过海 - 经理 五级 10-17 22:26

业精于勤荒于嬉,行成于思毁于随(韩愈)

“天才就是这样,终身劳动,便成天才。”(门捷列夫)

“天才是百分之一的灵感,百分之九十九的血汗”(爱迪生)

“科学的灵感,决不是坐等可以等来的。如果说,科学上的发现有什么偶然的机遇的话,那么这种‘偶然的机遇’只能给那些学有素养的人,给那些善于独立思考的人,给那些具有锲而不舍的精神的人,而不会给懒汉。”(华罗庚)

“古今中外,凡成就事业,对人类有作为的无一不是脚踏实地、艰苦攀登的结果。”(钱三强)

“攀登科学高峰,就象登山运动员攀登珠穆朗玛峰一样,要克服无数艰难险阻,懦夫和懒汉是不可能享受到胜利的喜悦和幸福的。”(陈景润)
回答者:李泽尘 - 初入江湖 三级 11-20 00:41
评价已经被关闭 目前有 8 个人评价

62% (5) 不好
37% (3)
相关内容
• 勤学,勤奋的名言俗语
• 求有关“天才”和勤奋的名言警句
• 有关勤奋的名言警句
• 关于爱国的,诚实的,勤奋的名言
• 有关勤奋的名言
更多相关问题>>
查看同主题问题:名言
对最佳答案的评论 共 80 条
麻麻喇~~!
评论者: Linda姐姐 - 魔法学徒 一级

评论者: 寒仕殇 - 初学弟子 一级
还可以
评论者: a6622868123 - 江湖新秀 四级

我来评论 查看所有评论>>其他回答 共 1 条
我总结的一句话: 分数是聪明和高智商的象征,这虽不是真理,但却是现实。
回答者:匿名 11-20 20:32 对最佳答案的评论:
评论字数200字以内

©2008 Baidu

以上是关于读lua代码,帮我翻译成很容易理解的话,谢谢! function FileSaveLoad()的主要内容,如果未能解决你的问题,请参考以下文章

帮我翻译下这个!!!速度啊!!!!!!!!!!!!! 好的话 加分的活~~~谢谢啊

数分解问题:把一个数分解成很多数

这段话麻烦高人翻译一下,谢谢!

谁来帮我翻译一下!谢谢!

Lua优化—写得一手好代码

帮我翻译下,谢谢 In newspaper group the financial work