Questions tagged [parameters]

Parameters are a type of variable used in a subroutine to refer to the data provided as input to the subroutine.

A parameter is an intrinsic property of a procedure, included in its definition. For example, in many languages, a minimal procedure to add two supplied integers together and calculate the sum total would need two parameters, one for each integer. In general, a procedure may be defined with any number of parameters, or no parameters at all. If a procedure has parameters, the part of its definition that specifies the parameters is called its parameter list.

There are two ways of passing parameters to a procedure (both of them may not be available in every programming language):

  • by value: the value of a variable (or constant, etc.) is passed to the procedure and the original variable cannot be affected by the code in the procedure.
  • by reference: the reference to a variable is passed to a procedure and the variable's value can be changed in the procedure.
19575 questions
5
votes
4 answers

Parametrize the WHERE clause?

I'm need to write a stored procedure for SQL Server 2008 for performing a large select query and I need it to filter results with specifying filtering type via procedure's parameters. I found some solutions like this: create table Foo( id bigint,…
controlflow
  • 6,530
  • 29
  • 54
5
votes
4 answers

C# out parameter value passing

I am using contactsreader.dll to import my Gmail contacts. One of my method has the out parameter. I am doing this: Gmail gm = new Gmail(); DataTable dt = new DataTable(); string strerr; gm.GetContacts("chendur.pandiya@gmail.com", "******", true,…
ACP
  • 32,884
  • 96
  • 217
  • 360
5
votes
1 answer

How to redirect action with parameter as post in Struts?

Redirect action to another action struts.xml: SectorDisplay
Ninjin
  • 141
  • 1
  • 2
  • 12
5
votes
2 answers

Passing a list of parameters into a Python function

how would I pass an unknown number of parameters into a function? I have a function defined in the following way def func(x, *p): return ... I'm trying to pass in a list of values to use as parameters. I tried using a list and a tuple but the…
Wilky94
  • 392
  • 1
  • 7
  • 14
5
votes
1 answer

Passing Parameters with HttpURLConnection

With the old Apache stuff deprecated in API 22, I am finally getting around to updating my network stuff. Using openConnection() seems pretty straight forward. However, I have not seen any good example to send parameters with it. How would I update…
TheLettuceMaster
  • 14,856
  • 42
  • 142
  • 248
5
votes
3 answers

In Lua, how to set a nil parameter to some default value correctly?

For Lua code below: local function foo(x, y, z) local x = x or true local y = y or 1234 z = z or "default" end I always thought the meaning of these three lines inside the function is: If x/y/z is nil, x/y/z is set to…
Joe Huang
  • 5,817
  • 5
  • 40
  • 72
5
votes
2 answers

how to use expressions as function parameters in powershell

This is a very simple task in every language I have ever used, but I can't seem to figure it out in PowerShell. An example of what I'm talking about in C: abs(x + y) The expression x + y is evaluated, and the result passed to abs as the…
rmeador
  • 24,922
  • 16
  • 59
  • 99
5
votes
3 answers

Why do Clojure devs use "xs" for function args?

In most languages there are conventions around arguments. Such as in nested loops you might use i at the top level, then j, then k. But in Clojure I don't know what the convention is. I've seen, more often than not, the use of xs in function…
Integralist
  • 5,121
  • 3
  • 21
  • 34
5
votes
0 answers

dynamic parameters in security.yml

The isssue I am trying to address is to automatically redirect my application to the user entered url after login. Since I have a centralized authentication server I cant user 'HTTP_REFERER' as it always returns null when am being transferred to the…
Hasitha Shan
  • 2,541
  • 6
  • 37
  • 78
5
votes
1 answer

optional arguments in haskell

I have declared my own type: data Book = Bookinfo { bookId :: Int, title :: String } deriving(Show) and now: x = Bookinfo it is all ok, valid statement but making bookId x throws an error. If I would be able…
gruber
  • 24,755
  • 31
  • 114
  • 208
5
votes
4 answers

C# String.Format optional parameters

I want to use string.Format with optional parameters : public static void Main(string[] args) { // Your code goes here // Console.WriteLine(string.Format("{0} {1}", "a", "b")); Console.WriteLine(string.Format("{0} {1}", "a")); } for…
Kernel Med
  • 301
  • 1
  • 5
  • 11
5
votes
1 answer

Best practice to have the same view and store multiple times in ExtJS 4

I would like to have different instances of the same view with different stores at the same time in an ExtJS application. At the moment i ceate multiple instances of the same view (Ext.view.View) in the viewport. But what is the best practice to…
Werzi2001
  • 1,745
  • 1
  • 13
  • 32
5
votes
1 answer

WiX - Passing parameters to a CustomAction (DLL)

I've got a DLL from an old WiSE installer that i'm trying to get working in WiX, so i'm pretty sure the DLL works with MSI-based installers. Here is my definition:
glenneroo
  • 1,713
  • 4
  • 30
  • 45
5
votes
2 answers

Laravel 4 - URI Parameters in Implicit Controllers

How to get URI parameters in methods inside a implicit controller? First, I define a base route: Route::controller('users', 'UserController'); Then, class UserController extends BaseController { public function getIndex() { // …
Paulo Coghi
  • 10,054
  • 11
  • 63
  • 85
5
votes
1 answer

Ruby dot parenthesis call syntax

I was reading the jbuilder's README and saw these code: class Person # ... Class Definition ... # def to_builder Jbuilder.new do |person| person.(self, :name, :age) end end end I tried to replicate it myself, and it asks for a…
Dorian
  • 19,009
  • 8
  • 108
  • 111
1 2 3
99
100