Home » Developer & Programmer » Forms » problem with Function
problem with Function [message #81491] Sun, 23 February 2003 20:38 Go to next message
Robin ( Bangladesh)
Messages: 25
Registered: September 2002
Junior Member
Experts,
Can I return more than one value from a single function or any other like function as fllows-

create func.....return number is
a number:=1;
b number:=2;
r1 number:=0;
r2 number:=0;
begin
r1:=a+b;
r2:=b-a;
return (r1,r2); //how can I get both r1 and r2
end;

Pls help me. Thanks in advance

Robin
Re: problem with Function [message #81494 is a reply to message #81491] Sun, 23 February 2003 23:13 Go to previous messageGo to next message
Arvind Kumar Saini
Messages: 3
Registered: February 2003
Junior Member
Dear Robin,

As you know that from fuction you can't return more than one variable either you use the procedure or you can solve the same problem by returning the character from function which should be cancatenated on the basis of rules defined by you.

Suppose you want to return 10.00 & 11.00 numbers from fuctions. Do one thing you cancatenated the both number like below in character
'10:00:11.00' & return to main and substract the values according to : position.

Hope it will helps you.

Regards / Arvind Saini
Thank u Arvind Saini [message #81503 is a reply to message #81491] Mon, 24 February 2003 21:35 Go to previous message
Robin ( Bangladesh)
Messages: 25
Registered: September 2002
Junior Member
Hellow Expert Friend,
Thank for ur solution, Yes I can concat it or use procedure's out parameter, I myself should find out solution, Why I didn't think so , can't understand. But I never thought about concatanation,realy nice idea.

Thanks again, Expert Friend.

Robin
Previous Topic: How to change to color of rectangle dynamically?
Next Topic: Developer2000
Goto Forum:
  


Current Time: Thu Dec 02 04:27:03 CST 2021