using a function with multiple parameters

Please discuss general Delphi programming topics here.

using a function with multiple parameters

Postby Christine123 » June 4th, 2007, 1:47 am

Hello,

I would like to state that I sincerely appreciate the quick and helpful responses I have been getting from this forum to make my journey learning this language easier.

Is it possible to create a function that looks for variable of int and returns them in a string.

For instance

Hello, x, y: integer;

I would like a function that could return the following string:
<<'Hello,x,y">>

Basically what I want to do is when I run the console project, I want to be able to display the variable names

Christine
Christine123
Junior Member
Junior Member
 
Posts: 25
Joined: May 28th, 2007, 10:28 pm

Postby Kambiz » June 4th, 2007, 4:26 am

If you compile the code with debug information, maybe you can get this information with some tricks, but normally it's not possible.

Remember, Delphi is a compiler. Only the interpreter languages provide such kind of information.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2424
Joined: March 7th, 2003, 7:10 pm

Postby HPW » June 4th, 2007, 5:24 am

Basically what I want to do is when I run the console project, I want to be able to display the variable names


Not sure what you do there, but when you want to aceess the commandline parameter in a console-app you get them with ParamStr(1),ParamStr(2) ....ParamStr(n).

When display mean you want to write them to the output-window with:

Writeln(MyStrVar + ' does exist!' + IntToStr(MyIntVar));
Hans-Peter
HPW
Moderator
Moderator
 
Posts: 236
Joined: February 25th, 2006, 10:19 am
Location: Germany

Postby Christine123 » June 9th, 2007, 12:19 am

thanks,

didn't think you could
Christine123
Junior Member
Junior Member
 
Posts: 25
Joined: May 28th, 2007, 10:28 pm

Postby Christine123 » June 9th, 2007, 6:12 pm

Kambiz,

what is an interpretive language?

Christine
Christine123
Junior Member
Junior Member
 
Posts: 25
Joined: May 28th, 2007, 10:28 pm

Postby Kambiz » June 10th, 2007, 11:38 am

Follow the link for the answer: http://en.wikipedia.org/wiki/Interpreted_language

Seems you've never used Google. Use it to get the answers immediately. :)
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2424
Joined: March 7th, 2003, 7:10 pm

Postby Christine123 » June 11th, 2007, 2:29 am

ha, you're right I should have done that before I posted. Sorry about that
Christine123
Junior Member
Junior Member
 
Posts: 25
Joined: May 28th, 2007, 10:28 pm


Return to Delphi Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron