Solved

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

Posted on 2002-03-11
6
192 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
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

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

0
 
LVL 27

Author Comment

by:kretzschmar
Comment Utility
>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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 27

Author Comment

by:kretzschmar
Comment Utility
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
Comment Utility
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
Comment Utility
well, zebada,
just complete and correct :-)

thanks for participating on this quest.

next week a new ?simple question

meikl ;-)
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now