• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

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

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
kretzschmar
Asked:
kretzschmar
  • 3
  • 2
1 Solution
 
craig_capelCommented:
You are either bored, or have nothing to do with your points :P

0
 
kretzschmarAuthor Commented:
>or have nothing to do with your points :-)

yep, but thats not an answer for my q :-P
0
 
zebadaCommented:
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
Industry Leaders: 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!

 
kretzschmarAuthor Commented:
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
 
zebadaCommented:
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
 
kretzschmarAuthor Commented:
well, zebada,
just complete and correct :-)

thanks for participating on this quest.

next week a new ?simple question

meikl ;-)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now