Page 1 of 1

using a function with multiple parameters

PostPosted: June 4th, 2007, 1:47 am
by Christine123
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

PostPosted: June 4th, 2007, 4:26 am
by Kambiz
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.

PostPosted: June 4th, 2007, 5:24 am
by HPW
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));

PostPosted: June 9th, 2007, 12:19 am
by Christine123
thanks,

didn't think you could

PostPosted: June 9th, 2007, 6:12 pm
by Christine123
Kambiz,

what is an interpretive language?

Christine

PostPosted: June 10th, 2007, 11:38 am
by Kambiz
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. :)

PostPosted: June 11th, 2007, 2:29 am
by Christine123
ha, you're right I should have done that before I posted. Sorry about that