@kreisik, @olesio i @babubabu - błędów jest faktycznie pełno i zmiana dyrektywy sterującej nic tutaj nie da; Istnieją np. w funkcji __TranslateKey
:
function __TranslateKey(Input : INPUT_RECORD; K : PKBDCode) : word; register;
begin
if ((Input.Event.KeyEvent.dwControlKeyState and (RIGHT_ALT_PRESSED or LEFT_ALT_PRESSED)) <> 0) then
Result := K.Alt // tutaj
else
if ((Input.Event.KeyEvent.dwControlKeyState and (RIGHT_CTRL_PRESSED or LEFT_CTRL_PRESSED)) <> 0) then
Result := K.Ctrl // tutaj
else
if ((Input.Event.KeyEvent.dwControlKeyState and SHIFT_PRESSED) <> 0) then
Result := K.Shift // tutaj
else
begin
if (Chr(Input.Event.KeyEvent.wVirtualKeyCode) >= 'A') and (Chr(Input.Event.KeyEvent.wVirtualKeyCode) <= 'Z') then
Result := Ord(Input.Event.KeyEvent.AsciiChar)
else
Result := K.Normal; // tutaj
end;
end;
Wszędzie, gdzie podawany jest wskaźnik na rekord brakuje odwołania do jego wartości przez operator ^
, czego Lazarus nie przepuści; To się tyczy nie tylko powyższej funkcji, bo po jej poprawieniu błędów, hintów i warningów jest jeszcze więcej:
NewCrt.pas(765,53) Hint: Local variable "Info" does not seem to be initialized
NewCrt.pas(842,53) Hint: Local variable "Info" does not seem to be initialized
NewCrt.pas(852,53) Hint: Local variable "Info" does not seem to be initialized
NewCrt.pas(867,29) Error: Ordinal or string expression expected
NewCrt.pas(868,10) Error: Constant and CASE types do not match
NewCrt.pas(871,13) Error: Constant and CASE types do not match
NewCrt.pas(871,13) Error: duplicate case label
NewCrt.pas(872,11) Error: Constant and CASE types do not match
NewCrt.pas(873,12) Error: Constant and CASE types do not match
NewCrt.pas(873,17) Error: Constant and CASE types do not match
NewCrt.pas(874,18) Error: Constant and CASE types do not match
NewCrt.pas(874,18) Error: duplicate case label
NewCrt.pas(875,10) Error: Constant and CASE types do not match
NewCrt.pas(881,11) Error: Constant and CASE types do not match
NewCrt.pas(911,44) Warning: range check error while evaluating constants
NewCrt.pas(925,16) Error: Incompatible types: got "TextRec.^TextBuf" expected "PChar"
NewCrt.pas(926,14) Error: Incompatible types: got "TextRec.^TextBuf" expected "PChar"
NewCrt.pas(1015,44) Warning: range check error while evaluating constants
NewCrt.pas(1058,55) Hint: Local variable "_Info" does not seem to be initialized
NewCrt.pas(1104,68) Hint: Local variable "NumWritten" does not seem to be initialized
NewCrt.pas(1118,70) Hint: Local variable "NumWritten" does not seem to be initialized
NewCrt.pas(1185,56) Hint: Local variable "NumEvents" does not seem to be initialized
NewCrt.pas(1224,62) Hint: Local variable "NumRead" does not seem to be initialized
NewCrt.pas(1285,57) Hint: Local variable "NumRead" does not seem to be initialized
NewCrt.pas(1285,45) Hint: Local variable "Input" does not seem to be initialized
NewCrt.pas(1318,23) Warning: range check error while evaluating constants
NewCrt.pas(1514,10) Error: Illegal qualifier
NewCrt.pas(1514,10) Hint: may be pointer dereference is missing
NewCrt.pas(1514,10) Error: Illegal expression
NewCrt.pas(1514,10) Fatal: Syntax error, ";" expected but "identifier SCREENWIDTH" found
i to wszystko podczas kompilacji ze standardowymi ustawieniami; Pod Delphi7 oczywiście kompiluje się bez żadnych komunikatów, ale Lazarus wyłapuje sporo niedociągnięć (i ogólnych błędów), których Delphi7 nie rozpoznaje;
Tak więc raczej nie ma sensu w Twoim przypadku @kreisik bawić się w przerabianie biblioteki Crt
; Chyba, że porównasz sobie tę wersję podaną w załączniku z tą z Lazarusa i odpowiednio dopiszesz niejstniejące funkcje;
Zmieniłem nazwę modułu na NewCrt żeby kompilator nie pomylił z tym istniejącym.