gpt4 book ai didi

delphi - E2016 需要数组类型。使用 PSingle 变量

转载 作者:行者123 更新时间:2023-12-03 19:41:02 25 4
gpt4 key购买 nike

首先,对不起我的英语,我是西类牙人。

我有很多时间试图将这部分代码从 delphi vcl 转换为 fmx。
这是代码:

procedure process(Process_samples: Longint);
var
offs: longint;
pBuffer: PSingle;
sum: double;
x: longint;
begin
pBuffer := buffer.ptrBegin; //-->>buffer.ptrbegin is a psingle
for offs := windowStart to windowLen do
begin
sum := 0;
for x := 0 to process_samples - 1 do
begin
sum := sum + pBuffer[x] * pBuffer[x + offs];
end;

end;
end;

我收到此错误:
[dcc error] unit1.pas: E2016 Array type required.
我需要从位置 x 上的 psingle 读取单个值,但我不知道该怎么做。

有人可以帮我吗?

我是 Firemonkey 的新手,我想将我的应用程序从 delphi vcl 翻译成 fmx。

最佳答案

此代码依赖于 Pointer Math ,因此请确保它在您的代码中实际打开:

{$POINTERMATH ON}

有关使用编译器条件和指令的更多详细信息,请参阅 Embarcadero 的文档:

Conditional compilation (Delphi)

Delphi Compiler Directives (List) Index

关于delphi - E2016 需要数组类型。使用 PSingle 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24072946/

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