?
Solved

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

Posted on 2002-03-11
6
Medium Priority
?
208 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
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!

 
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 100 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month12 days, 8 hours left to enroll

777 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