Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling conventions - order of parameter processing

Status
Not open for further replies.

georgeWB

Programmer
Feb 14, 2003
1
US
Hi, folks --

We're using D5. The Delphi help file says that the default calling convention is REGISTER and parameters are passed from left to right.

We're converting a large program which requires this left-to-right processing. However, D5 seems to process right-to-left contrary to the documentation.

An example is given below. If we append ";pascal" to the function definition, all goes well. However, we have miles of code and it would be very easy to miss a function declaration.

Is there a global way to force the left-to-right calling sequence that apparently should be the default but isn't?

Many thanks for your help,

GeorgeWB

Example---------------

Here outputSt is '123' but trackSt is '321'

Appending ";pascal" to "function big_get(a,b,c:string):string;" solves the problem here but is not very practical for our conversion project.

program Test;
var outputSt,trackSt:string;

function little_get(code:string):string;
begin

little_get:=code;
trackSt:=trackSt + code;
end;

function big_get(a,b,c:string):string;
begin
big_get:=concat(a,b,c);
end;

begin
trackSt:='';

outputSt := big_get(little_get('1'),little_get('2'),little_get('3'));
end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top