Delphi out 参数 string Integer
http://www.delphibasics.co.uk/RTL.asp?Name=Out
http://stackoverflow.com/questions/14507310/whats-the-difference-between-var-and-out-parameters
A var parameter will be passed by reference, and that's it.
var参数将以引用方式传递。
An out parameter is also passed by reference, but it's assumed that the input value is irrelevant.
out参数也是以引用传递,但是它(编译器)假定输入值是不相关的。
For managed types, (strings, Interfaces, etc,) the compiler will enforce this, by clearing the variable before the routine begins, equivalent to writing param := nil.
对(生存期自动)管理的类型(字符串,接口,等),编译器会强制在routine开始前清空out变量,等同于写参数值为空。
For unmanaged types, the compiler implements out identically to var.
对非管理类型,编译器实现out等同于var参数。
Note that the clearing of a managed parameter is performed at the call-site and so the code generated for the function does not vary with out or var parameters.
说明,对受管理类型参数的清理是在 调用位置 进行的,所以(编译器)为被调用函数产生的代码是不包括out或var参数的。
share|edit
edited Jan 24 '13 at 19:05
David Heffernan
316k22396683
answered Jan 24 '13 at 17:38
Mason Wheeler
procedure testout(const str: string; out a: string; out I: Integer);
begin
ShowMessage(a + IntToStr(I));//100 a是空的
a := str;
I := 200;
end; procedure TForm1.Button1Click(Sender: TObject);
var
s, ss, ds, qx, dz: string;
I: Integer;
jo: ISuperObject;
begin
s := '外面';
ss:= 'out';
I:= 100;
testout(s, ss, I);
ShowMessage(ss + IntToStr(I));//外面200 Exit; end;
Delphi out 参数 string Integer的更多相关文章
- delphi 属性 参数 新注释
delphi 属性 参数 新注释,在写代码的时候,可以自动看到属性.参数的的备注说明,太方便了. Tmyclass=class /// <summary> /// 姓名 /// </ ...
- Java中main方法参数String[ ] args的使用。
我们刚开始学习java时都会被要求记住主方法(main)的写法,就像这样: public static void main(String[] args){ } public static void m ...
- string integer == equals 转
java中的数据类型,可分为两类: 1.基本数据类型,也称原始数据类型.byte,short,char,int,long,float,double,boolean 他们之间的比较,应用双等号(== ...
- CharsRefIntHashMap并不比HashMap<String, Integer>快
我模仿lucene的BytesRef写了一个CharsRefIntHashMap,实測效果并不如HashMap<String, Integer>.代码例如以下: package com.d ...
- main方法中参数"String[ ] args"详解
1.在编写完一个有主方法的java文件时,需要在cmd窗口中先编译此java文件(javac xxx.java),然后再运行(java xxx) 其实在运行java xxx的时候如果后面跟着参数用空格 ...
- String,Integer,int类型之间的相互转换
String, Integer, int 三种类型之间可以两两进行转换 1. 基本数据类型到包装数据类型的转换 int -> Integer (两种方法) Integer it1 = new I ...
- java中的main方法参数String[] args的说明
参数String[] args 的作用是在运行main方法时,在控制台输入参数 class Test{ public static void main(String[] args){ for(Stri ...
- Junit + String/Integer/ArrayList/HashMap/TreeMap 基本使用Demo
package JavaTest.test; import java.util.ArrayList; import java.util.HashMap; import java.util.List; ...
- Delphi程序带参数运行
程序1 program E1; uses Forms,Dialogs,SysUtils, EndM1 in 'EndM1.pas' {Form2}; {$R *.res} begin Applicat ...
随机推荐
- linux rwxrwxrwt文件夹属性
/tmp 的permission是rwxrwxrwt chmod 0777 /abc rwxrwxrwx chmod 777 /abc rwxrwxrwx chmod 17 ...
- 杨辉三角 && 鸽兔同校
杨辉三角: 用个一维数组直接模拟就行,只是 C++ 的高精度调了好久,后来发现能用 python ,于是试着写了写: dp = [] def out(L, end): for i in range(e ...
- 青云的机房组网方案(简单+普通+困难)(虚树+树形DP+容斥)
题目链接 1.对于简单的版本n<=500, ai<=50 直接暴力枚举两个点x,y,dfs求x与y的距离. 2.对于普通难度n<=10000,ai<=500 普通难度解法挺多 ...
- 转:设计模式-----桥接模式(Bridge Pattern)
转自:http://www.cnblogs.com/houleixx/archive/2008/02/23/1078877.html 记得看原始链接的评论. 学习设计模式也有一段时间了,今天就把我整理 ...
- HTML5结合百度地图API创建地图应用
具体的百度地图API的使用方法查看百度地图API里的DEMO <style> #div1{ width:400px; height:400px; border:1px #000 solid ...
- OpenGL的gluPerspective和gluLookAt的关系[转]
函数原型void gluLookAt(GLdoble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, ...
- 为什么要使用Hibernate
因为! a paradigm mismatch between how data is represented in objects versus relational databases ! 对象数 ...
- LTIB常用命令3
http://blog.csdn.net/junht/article/details/7656540 LTIB 中的包 4.3.1 查看哪些包是使能的,并且可以安装 在配置ltib之前,您可以在一个 ...
- listview定位到上次显示的位置
整体思路:滑动lictview时,记录listview的位置,定位时定位到该位置. 1.添加全局变量 private int scrolledX = 0; private int scrolledY ...
- 如何用腾讯云打造一款微视频APP
版权声明:本文由腾讯云原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/196 来源:腾云阁 https://www.qclo ...