Hi,
I'd like to have my nice little function return an array, I'd expect this to be possible, but when I do this...
I get this..
[Pascal Error] main.pas(259): E2029 Identifier expected but 'ARRAY' found
So, I tried googling this, and the results were slim, someone at a C forum to return a pointer, but I have no idea as to how I should approach this. Are there any other options? Or will I just have to learn pointers now?
I'd like to have my nice little function return an array, I'd expect this to be possible, but when I do this...
Code:
function GeneralCalculatePosition(WidthHeight: Integer; spacing: Integer; padding: Integer; multiplier: Integer):Array of Integer;
begin
if multiplier<>0 then
if multiplier=1 then
GeneralCalculatePosition := padding
else
GeneralCalculatePosition := padding+multiplier*widthHeight+multiplier*spacing
else
showmessage('Application error');
end;
I get this..
[Pascal Error] main.pas(259): E2029 Identifier expected but 'ARRAY' found
So, I tried googling this, and the results were slim, someone at a C forum to return a pointer, but I have no idea as to how I should approach this. Are there any other options? Or will I just have to learn pointers now?