gpt4 book ai didi

delphi - 帕斯卡 : Delphi Length String Command Error

转载 作者:行者123 更新时间:2023-12-03 18:01:12 26 4
gpt4 key购买 nike

我正在编写一段代码来读取 CSV 文件并从中解析信息(目前我只有代码的开头部分,它将在文件开头的标题中读取。当我尝试编译这段代码,我在行中收到一个错误,它占用了文件中行的长度。

我收到的错误是:[Error] MCLRandomizer.pas(*): Missing operator or semicolon

while not EOF(csvFile) do begin
i :=0;
ReadLn(csvFile, line);
if lineOne = true then begin
length := Length(line); //error here
while length > 0 do begin
dx := Pos(',', line);
buffer := Copy(line, 0, dx-1);
headers[i] := buffer;
line := Copy(line, dx+1, length);
length := Length(line); //error here
end;
lineOne := false;
end;
end;

最佳答案

Pascal 对 length 和 Length 没有区别...它们都是 LENGTH

重命名变量,它会打乱函数。

关于delphi - 帕斯卡 : Delphi Length String Command Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5459948/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com