procedure TForm1.MILoadClick(Sender: TObject);
var
Sfile : file of Char;
C : Char;
Mystring : string;
begin
if OpenDialog1.Execute then
begin
AssignFile(Sfile,OpenDialog1.FileName);
//联系文件名与文件句柄
while not Eof(Sfile) do
begin
Read(Sfile,C);
if C=','then
begin
ShowMessage(Mystring);
//AddrArray[0].Addr:= StrtoInt(Mystring);
Mystring :=";
end;
if C<>'' then
begin
Mystring:= Mystring+C;
end;
end; end;
end;
var
Sfile : file of Char;
C : Char;
Mystring : string;
begin
if OpenDialog1.Execute then
begin
AssignFile(Sfile,OpenDialog1.FileName);
//联系文件名与文件句柄
while not Eof(Sfile) do
begin
Read(Sfile,C);
if C=','then
begin
ShowMessage(Mystring);
//AddrArray[0].Addr:= StrtoInt(Mystring);
Mystring :=";
end;
if C<>'' then
begin
Mystring:= Mystring+C;
end;
end; end;
end;
解决方案 »
- delphi Unknow directive:‘Message’
- GlobalAlloc,CopyMemory引用哪些单元?急
- 高手们:请问ToolButton怎么改颜色吗
- 本公司活多做不完!寻找北京做工控软件的兼职高级程序员(至少要一年经验)
- IDHttp控件下载文件的问题
- 一个调用dos中netsend命令的问题
- string的长度是存在哪里的?(string[0]吗?)
- 怎样激活Delphi 6
- 求:idudpserver打开ThreadedEvent后出现"尚未调用CoInitialize"
- 请问如何写控制面版程序。
- 怎样写刷新的代码!请高手指点
- 请教高手dbexpress 中Tsqlconnect连接数据库的设置?在线等待
--------------------------------------------------------------------据查证 hammer_shi(@农业专家@(*暂时是菜鸟*))为激进分子,该账号已删除.
Project C.exe raised exeception class EInOutError with message
'I/O error 103'.Process stopped. Use Step or Run to continue.这是从一个含有诸如12536,21025,......,145325663的文件中一次读出一个数字
并且我该成下面的(关闭了文件)还有错
if OpenDialog1.Execute then
begin
AssignFile(Sfile,OpenDialog1.FileName);
//联系文件名与文件句柄
while not Eof(Sfile) do
begin
Read(Sfile,C);
if C=','then
begin
ShowMessage(Mystring);
//AddrArray[0].Addr:= StrtoInt(Mystring);
Mystring :='';
end;
if C<>'' then
begin
Mystring:= Mystring+C;
end;
end;
CloseFile(Sfile);
end;
reset(sfile)
但改成 if C<>'' and C<>',' then
begin
Mystring:= Mystring+C;
end;
却出错Operator not applicable to this operand type
Longint的范围-2147483648~2147483647
而Integer的范围是-32768~32767