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.
22681 questions
6
votes
3 answers

How to pass integer as unsigned parameter in VB.NET?

I'm using a library call, setInstance(ByVal instance As UInteger), in my VB.NET code. The parameter I need to pass is an Integer. Is there anything I need to do to convert the integer parameter to an unsigned integer? The number is guaranteed to be…
CodeFusionMobile
  • 14,812
  • 25
  • 102
  • 140
6
votes
3 answers

How to check if a table valued parameter is empty or not inside of a where clause?

I am writing a function where I am passing a table valued parameter. In some of the cases table valued parameter can be empty. So, my function looks like below- CREATE FUNCTION [dbo].[testTableValueParam] ( @created_date datetime = null …
Christina
  • 117
  • 1
  • 8
6
votes
2 answers

What is difference between `$*` an `$@` in Bash

I always use $@ when I want all arguments of bash function but recently I just found that $* also works in the same way, and it also can use as array index. My question is What is difference between $* an $@ in Bash? and which one should I prefer?
fronthem
  • 4,011
  • 8
  • 34
  • 55
6
votes
3 answers

How can I create a new thread AddressOf a function with parameters in VB?

When option strict is OFF, works fine. ON, I get overload resolution failure: Dim _thread1 As Thread Private Sub test2(boolTest As Boolean) ' Do something End Sub ' Private Sub test() _thread1 = New Thread(AddressOf test2) …
user4010901
6
votes
3 answers

Embed Youtube Video To Facebook And Play At Specific Timecode

I have a :30 YouTube video that I want to embed onto Facebook and start playback at :16. I thought this would be easy enough changing the parameters in the URL for share, or the URL in the embed code. But when I post this on Facebook, even though…
thebrownsquare
  • 61
  • 1
  • 1
  • 2
6
votes
3 answers

Laravel 5 route parameters not send

With Laravel 5 I'm not able to setup get route parameters. My route is setup like this: Route::get('test', 'TestController@test'); And my TestController looks like this: public function test(Request $request) { …
6
votes
1 answer

How to pass multiple parameters in Url.Action()

I want to pass multiple parameters from Url.Action, Here is code in view window.location.href = "@Url.Action("ABC", "XYZ", new { @A= ViewBag.A , @B = ViewBag.B })"; And this is my Method in Controller XYZ public ActionResult ABC(string A, string…
Affan Shahab
  • 838
  • 3
  • 17
  • 39
6
votes
1 answer

How to configure global uploadPath and uploadUrl in Yii2?

I want to configure Global Params in Yii2. For example this: This will store the server path for all your file uploads. Yii::$app->params['uploadPath'] = Yii::$app->basePath . '/uploads/'; This will store the Url pointing to server location for…
Mohit Bhansali
  • 1,725
  • 4
  • 20
  • 43
6
votes
1 answer

how to pass variables in hive using hue

I will pass variables, I try this SET x = 'user'; SELECT * FROM foo WHERE user == @user but I have one error Then I will try set x='user'; select * from foo where user == '${hiveconf:x}' but I have error: error while compiling statement:…
sonia
  • 167
  • 2
  • 2
  • 10
6
votes
4 answers

C# method generic params parameter bug?

I appears to me as though there is a bug/inconsistency in the C# compiler. This works fine (first method gets called): public void SomeMethod(string message, object data); public void SomeMethod(string message, params object[] data); //…
Mike M
  • 73
  • 1
  • 5
6
votes
3 answers

How can I get the parameterized-type class from a parameterized-type method argument?

Consider this contrived class: import java.util.List; public class Test { public String chooseRandom(List strings) { return null; } } When using reflection to inspect this method, how can I get the Class object representing…
Christopher Schultz
  • 20,221
  • 9
  • 60
  • 77
6
votes
3 answers

escaping dollar sign in velocity

I have such a string in the velocity template file: link1 That renders as
Haradzieniec
  • 9,086
  • 31
  • 117
  • 212
6
votes
2 answers

SqlCommand.Parameters.AddWithValue issue: Procedure or function X expects parameter @Y, which was not supplied

I have a problem with the folowwing piece of code. I am passing a parameter (List) to a method executing the following code. When it executes SQL Server throws an error saying that the proc expects a parameter that was not provided. I…
Petrus
  • 213
  • 1
  • 3
  • 6
6
votes
2 answers

ofstream in class - attempting to reference a deleted function

I have seen this question: Attempting to reference a deleted function (VS2013) but it didn't provide me an answer. I have a member variable in class which its type is ofstream and a constructor which contains string parameter: class…
OpenGL97
  • 289
  • 6
  • 12
6
votes
3 answers

How to get a name of a variable coming into a function as a parameter using F#?

Is there any way in F# how to get a name of a variable passed into a function? Example: let velocity = 5 let fn v = v.ParentName let name = fn velocity // this would return "velocity" as a string Thank you in advance EDIT: Why this code does not…
Oldrich Svec
  • 4,191
  • 2
  • 28
  • 54
1 2 3
99
100