另外,往函数传数组参数时,怎么传过去的值都依次改变了:
左边为传到函数里的值,右边为未传之前的值
E[5]=0
E[4]=E[3]
E[3]=E[2]
E[2]=E[1]
...
左边为传到函数里的值,右边为未传之前的值
E[5]=0
E[4]=E[3]
E[3]=E[2]
E[2]=E[1]
...
解决方案 »
- delphi2010 下载了 JVCL340CompleteJCL221.-Build3845 如何安装
- 郁闷,半天都没有搞定!如何解决用delphi读取DB2中数据时的乱码?
- 我在基类窗体里面有Toolbar工具条,但是往继承子类里面加ToolButton,运行后加的ToolButton总是显示在最后面,有什么办法可以解决啊,
- 線程相關問題?
- 关于数据加密的问题 出高分高手请进
- Delphi怎么动态连接数据库?
- 请高手帮助!(后续问题)
- 请问哪位高人可以告诉我怎样调用WIN32 API设置两个窗口分布在不同的显示器上//很急
- 请问各位,日期怎么查询?
- 一个关于压缩access数据库的问题
- 求教:关于精确打印问题。
- 怎样用ado 备份和恢复access数据库
form1.你的过程名(除了private的)可能你忽略了下标0
最好贴出代码来.
在
implementation 下写
uses unit1;就行了
就可以用它定义的函数(非Private)
用法为form1.------第二个问题没看明白
...
uses unit2;
...
form2.过程名称
...
unit2
...
form2
...
可是就是认不出来
过程是在FORM1的{$R *.DFM}后面定义的,这没错吧?
unit l1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Menus;type
Tform1 = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
//procedure traninput(x:string; var i:integer;var e:array of integer);
//procedure second(x:array of integer;j:integer;var sec:integer;i:integer); end;var
form1: Tform1;implementation{$R *.DFM}
procedure second(x:array of integer;j:integer;var sec:integer;i:integer);
begin
if j<i
then
begin
if x[j]=x[2*j+1]
then
begin
if (x[2*j]>sec) and (x[2*j]<>x[j])
then
sec:=x[2*j];
second(x,2*j+1,sec,i);
end;
if x[j]=x[2*j]
then
begin
if (x[2*j+1]>sec) and (x[2*j+1]<>x[j])
then
sec:=x[2*j+1];
second(x,2*j,sec,i);
end;
end;
end;//求第二大数的递归过程
...
第二个FORM的:
....
implementationuses l1, Unit3;
{$R *.DFM}
procedure TForm2.Button1Click(Sender: TObject);
var e:array[0..100] of integer;
i,j,sec:integer;
begin
form2.memo1.lines.clear;
i:=0;
sec:=-999999;
traninput(edit1.text,i,e);
...
....
implementationuses unit l1, Unit3;