我有3个数组,例如:
const
A: Array[0..9] of Byte = ($00, $01, $AA, $A1, $BB, $B1, $B2, $B3, $B4, $FF);
B: Array[0..2] of Byte = ($A1, $BB, $B1);
C: Array[0..2] of Byte = ($00, $BB, $FF);
Run Code Online (Sandbox Code Playgroud)
有没有办法比较并获得正确的索引,而不是逐个检查每个字节?例如:
function GetArrayIndex(Source, Value: Array of Byte): Integer;
begin
..
end;
GetArrayIndex(A, B); // results 3
GetArrayIndex(A, C); // results -1
Run Code Online (Sandbox Code Playgroud)
先感谢您.
我有一点问题.我试图在Delphi7中创建一个运行时的组件列表,并使用表单的.OnResize事件调整它们的大小但没有用...我无法弄清楚如何做到这一点.
这是我的代码:
procedure TForm1.Button1Click(Sender: TObject);
var
//ExtCtrls
panel: TPanel;
memo: TMemo;
splitter: TSplitter;
list: TListBox;
begin
panel := TPanel.Create(Self);
list := TListBox.Create(Self);
splitter := TSplitter.Create(Self);
memo := TMemo.Create(Self);
with panel do
begin
Parent := Form1;
BevelOuter := bvNone;
Top := 12;
Left := 12;
Height := Form1.Clientheight - 24;
Width := Form1.Clientwidth - 24;
end;
with list do
begin
Parent := panel;
Align := alClient;
Top := 0;
Height := panel.Height;
end;
with splitter do
begin
Parent := panel;
Top …Run Code Online (Sandbox Code Playgroud)