|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
hhhuut Grandmaster Cheater Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Sat Mar 05, 2016 4:30 am Post subject: Compilation Error |
|
|
Hey guys,
I'm getting an error when trying to compile part of CEs source (using latest Lazarus release build, v1.6.1 I think).
Function that causes the error:
procedure IProcessAddress(address : WideString ; vartype : TVariableType ; showashexadecimal: Boolean=false;
showAsSigned: boolean=false; bytesize: Integer = 1; out res_address : WideString = '');stdcall;
Error Log:
(3104) Compiling C:\Users\EH\Desktop\cheatengine-library-master\library\addresschangeunit.pas
..\library\addresschangeunit.pas(11,86) Error: (3337) Default values can only be specified for value, const and constref parameters
..\library\addresschangeunit.pas(13,1) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: ..\Lazarus\fpc\3.0.0\bin\x86_64-win64\ppcx64.exe returned an error exitcode
The problem goes with the default parameter for the "res_address" variable, but I don't really know why it is a problem for the compiler.
Hope you guys can help me with that.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Sat Mar 05, 2016 10:02 am Post subject: |
|
|
You can't use out after variables with a default value
And out can not have a default value
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
hhhuut Grandmaster Cheater Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Sat Mar 05, 2016 10:14 am Post subject: |
|
|
So how would I best fix this (best without turning the parameters)? With a "var" instead of "out"?
The whole unit (for better understanding):
Code: | unit AddressChangeUnit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, symbolhandler, byteinterpreter, CEFuncProc;
procedure IProcessAddress(address : WideString ; vartype : TVariableType ; showashexadecimal: Boolean=false;
showAsSigned: boolean=false; bytesize: Integer = 1; out res_address : WideString = '');stdcall;
implementation
procedure IProcessAddress(address : WideString ; vartype : TVariableType ; showashexadecimal: Boolean=false;
showAsSigned: boolean=false; bytesize: Integer = 1; out res_address : WideString = '');stdcall;
var a: PtrUInt;
e: boolean;
begin
//read the address and display the value it points to
a:=symhandler.getAddressFromName(utf8toansi(address),false,e);
if not e then
begin
//get the vartype and parse it
res_address:=readAndParseAddress(a, vartype,nil,showashexadecimal, showAsSigned, bytesize);
end
else
res_address:='???';
end;
end. |
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|