Solved

qow 10: What does var, const, ... declarations in proc/function-Parameters?

Posted on 2002-03-11
6
204 Views
Last Modified: 2010-04-05
hi experts,

i am starting a new quest: qow = question of the week :-)
each week i will introduce a new simple? question.

now qow 10

the first working solution will get the points (a graded).

sorry, top 15 experts, you are not allowed to solve this
q, only other can solve this question :-(

well the question is:
What does var, const, ... declarations in proc/function-Parameters, what is the effect?

an explaination is needed

let see

meikl ;-)
0
Comment
Question by:kretzschmar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:craig_capel
ID: 6855875
You are either bored, or have nothing to do with your points :P

0
 
LVL 27

Author Comment

by:kretzschmar
ID: 6855890
>or have nothing to do with your points :-)

yep, but thats not an answer for my q :-P
0
 
LVL 6

Expert Comment

by:zebada
ID: 6855932
Sheesh I'm bored too :)

var = pass by reference
procedure/function gets a reference to the caller's value rather than a copy. This means the procedure/function can modify the caller's value.

const = constant
procedure/function cannot modify the value that is passed to it. This also means that you cannot pass the const parameter as a var parameter to another procedure/function.


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Author Comment

by:kretzschmar
ID: 6855943
well, looks good, zebada

don't be bored, its just a quest.

any other declarations possible?
what the bahavaiourm if no one (var, const,..) is given?

meikl ;-)
0
 
LVL 6

Accepted Solution

by:
zebada earned 25 total points
ID: 6855972
parameter with no modifiers is passed by value.
The called function/procedure is free to modify the copy that is passed to it but it will have no effect on the value as seen by the caller.

Another option is "out".
Similar to "var" but is only used to return a value not to pass in a value.

0
 
LVL 27

Author Comment

by:kretzschmar
ID: 6855980
well, zebada,
just complete and correct :-)

thanks for participating on this quest.

next week a new ?simple question

meikl ;-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question