我必须在 system32 文件夹中移动一个文件,我使用了以下代码:
//-----------FUNCTION----------------
function GetWindowsSystemDir(): String;
var
vlBuff: Array[0..MAX_PATH-1] of Char;
begin
getSystemDirectory(vlBuff, MAX_PATH);
Result := vlBuff;
end;
//-----------------------------------
const
SMyFile = GetWindowsSystemDir+'\intructions.txt'; //error here, line 87
var
S: TStringList;
begin
S := TStringList.Create;
try
S.Add('intructions');
S.SaveToFile(SMyFile);
finally
S.Free;
end;
end;
编译时给我错误:
[DCC Error] Unit1.pas(87): E2026 Constant expression expected
谢谢。