瘟疫公司攻略细菌普通:delphi新手问题

来源:百度文库 编辑:神马品牌网 时间:2024/05/09 06:39:21
在delphi的一个例子中,有一句 str(area:5:1,sarea); 请哪位高手能指点一下,这是什么意思,具体语法是什么?越详细越好,先谢谢了

你应该学会看帮助,帮助上这不是有吗?将鼠标点在该函数上点f1会出现帮助。
In Delphi code, Str converts X to a string representation according to the Width and Decimals formatting parameters. The effect is like a call to Write except the resulting string is stored in S instead of being written to a text file.

X is an integer-type or real-type expression. Width and Decimals are integer-type expressions. S is a string-type variable or a zero-based character array variable if extended syntax is enabled.

简单的说就是把area转换为为字符串类型,然后存储到sarea中,area是一个宽度为5,小数位为1的整数型或实型。