Most voted "parameters" questions
Parameters are a type of variable used in the subroutine to refer to the data provided as input to the subroutine.
Learn more…208 questions
Sort by count of
-
4
votes2
answers94
viewsParameters of Android configuration
I wonder if you have any way to get the values straight from the settings of android example want to know if the "Unknown Sources" is enabled, "Developer Mode" is enabled,"Language" ,"Brightness…
-
4
votes2
answers185
viewsHow to pass an array as argument with the user defining the column number?
I’ll make a simple program just to illustrate my problem. #include<iostream> using namespace std; void recebeValor( int mat[][col]) // me da erro de comp; { mat[0][0] = 2; cout <<…
-
4
votes2
answers514
viewsC# how to do database search using parameters
I have the following code public DataTable PesquisarPorNome(string NomePesquisado) { try { DataTable tabela = new DataTable(); SqlDataAdapter adaptador = new SqlDataAdapter("SELECT * FROM…
-
4
votes1
answer2259
viewsHow to send an object by parameter?
I have the following code snippet: <p:selectOneMenu id="agencia" converter="agenciasConverter" value="#{agenciasMB.agencias.agencia}" style="width:150px"> <f:selectItem itemLabel="Selecione…
-
4
votes1
answer2328
viewsError Notice: Trying to get Property of non-object when picking the page title
I have a code that should take the title of the page example "Facebook - sign in or register" only that is giving error in this line $title =…
-
4
votes3
answers3650
viewsScanf function with variable amount of parameters, how to implement?
I have a text file (txt) that contains the following values: 12 90 These two values I keep and my variables a and b, that is to say a is equal 12 and b is equal 90, and I’m using the function…
-
4
votes1
answer7212
viewsPass Array as a function parameter
Make a program in C that reads a value x, dynamically create a vector of x elements and pass this vector to a function that will read the elements of this vector. Then, in the main program, the…
-
4
votes1
answer135
viewsWhy does a parameter have two "const" in its statement?
I’m reading the tutorials on the website of lib Opencv and during reading I saw the declaration of a function with a variable in a format I’ve never seen. I wanted to know what it means, declare the…
-
4
votes2
answers992
viewsIs it possible to pass a method as a parameter to run on a thread?
I have an application where each process is called by a single method and this process needs to run in a thread. The code of the threads is identical in all, changing only the content of the method…
-
4
votes2
answers624
viewsWhen using optional parameters above overloading and vice versa?
An optional parameter in C# is declared as follows (see parameter y): public void DoFoo(String x, String y = "") { ... } In many cases, this Feature can be replaced by Overload signature of the…
-
4
votes2
answers684
viewsProblems assigning values to variables in an object
I need to pass variable data to another class called Fila.java. There I have a vector of the type that receives objects, so in the main class I created an object that I initialized as follows :…
-
4
votes1
answer114
viewsDOUBT About the use of SELECT and Standard Tables
I have a question as to the advantages of having standardised tables and their forms of use within a SELECT. Suppose the following tables: -------------- | tb_endereco | -------------- | id | | rua…
-
4
votes2
answers580
viewsHow to create an optional parameter in ADVPL?
In several functions documented by Totvs there are optional parameters. I would like to create an optional parameter in my function, how to do? I’m wanting to make the function updEnvio receive a…
-
4
votes1
answer95
viewsHow to popular a parameter property with GET access
To understand what I want to do, note the Formclosing() parameter of Windowsforms: private void Form1_FormClosing(object sender, FormClosingEventArgs e) { var r = e.CloseReason; } By analyzing this…
-
4
votes2
answers88
viewsA Setter method can receive a getter + value as a parameter?
I created the advisory methods Setter and getter for the balance attribute. It is correct to use these advisors within each other? One being used as parameter for the other. More specifically the…
-
3
votes1
answer168
viewsHow to vary parameters of an equation?
For an equation of the type y = ax + b, we have two values for a and two to b, That is, we have four different equations. We already have a code that returns us the values of x and y for each…
-
3
votes2
answers1269
viewsParameter varchar in Store Procedure
I have a mysql store as follows: CREATE PROCEDURE nome_procedure(campo VARCHAR(15)) BEGIN SELECT id as id, campo as value FROM tabela etc etc etc...; END $$ However, since the parameter I am passing…
-
3
votes1
answer1494
viewsPass variable value between Classes
I would like to pass the values stored in the variables of the Parte1 to the Parte2 to validate the highest entered value. PART 1: public class SEP_06_parte1{ public static void main(String args[]){…
-
3
votes1
answer236
viewsHow to create a modular function whose parameter is an operator?
Suppose I want to create a function that changes the src of an image by another in the index of an array, thus: var arrayimgs = ["js/img1.jpg","js/img2.jpg","js/img3.jpg"]; var imagem =…
-
3
votes2
answers2804
viewsHow to pass commands to a . exe via C#?
I wanted to call through an application in C# a .exe any and pass them some commands as soon as it opened. For example, what I want to do at the moment is that the program opens, give three Tabs and…
-
3
votes1
answer190
viewsFunction with nameless parameter
Why to declare a function with that signature? void funcao1(Pessoa&); void funcao2(Pessoa&,void*); void XN_CALLBACK_TYPE UserCalibration_CalibrationComplete(xn::SkeletonCapability&…
-
3
votes1
answer123
viewsMethod Call with Matrix Parameters
I’ve always created vector methods using: void exemplo(int vetor[], int qtd){ // Código... // ... } And I never had problems, but I’m trying the same with matrices and I get an error void…
-
3
votes1
answer3315
viewsEnsure that generic object passed as parameter is subclass of an abstract class
First I would like to say that my doubt is not specifically about "verify that a generic object passed as parameter is subclass of an abstract class.", but I couldn’t pick a better title. If you…
-
3
votes1
answer125
viewsHow to pass arguments dynamically to a new call?
If I have a Javascript function and want to call it by passing a list of arguments, use apply: var x = f(1,2,3); var x = f.apply(null, [1,2,3]); For the first time, I came across a case where I need…
-
3
votes6
answers498
viewsWhat is the safe way to define a default value for a function parameter?
In PHP, I can make a function have by default a value in a parameter. Example: function func($a = 1, $b = 2) { return $a + $b; } What about Javascript? I can make the same statement on Firefox 39;…
-
3
votes2
answers76
viewsError passing variable as double parameter
I have a function pesquisaPagamentos($pesquisa) I have a variable $pesquisa which is receiving the following amount: '2015-10-05','2015-10-01', with single quotes. It happens that the way this, when…
-
3
votes3
answers321
viewsPass List as LINQ expression parameter
I have a LINQ expression where the result is saved in the variable query, which is transformed into a list, this query returns a series of "RA attributes". I would like to pass this list of…
-
3
votes1
answer1282
viewsHow to call builders with arguments?
How to define constructor values in the main class by Scanner in such a builder?. public Aluno(String nome,int idade) { this.nome = nome; this.idade = idade; } and in the main class call: Aluno…
-
3
votes2
answers238
viewsGeneralization of parameters in Java
I am implementing a B tree for a database job in Java, so that it stores any kind of objects, be generic, so I am treating as if it were Object, but in some parts of precise code methods such as…
-
3
votes2
answers222
viewsEntity Framework and parameterized constructor
When I create domains, I usually create a parameterized constructor for the same: namespace Models { public class Unity { public string Abreviation { get; set; } public string Description { get;…
-
3
votes1
answer345
viewsSQL Like without considering the order of the parameters
I need to make a comparison between two tables to find out if the address of table A is present in table B. Example: Table A has a record with the ENDERECO field with the value "RUA FULANO DE TAL 67…
-
3
votes1
answer85
viewsObtaining different results by passing by value and passing by reference
I’m testing these examples of C codes: Call by value #include <stdio.h> /* function definition to swap the values */ void swap(int x, int y) { int temp; temp = x; /* save the value of x */ x =…
-
3
votes2
answers80
viewsParameters for external call
I use Linux and by default (or at least in my case) it does not have screen brightness control, but has a program that gives to control. The point here is that I want to take the "user" value and…
-
3
votes1
answer409
viewsHow to pass an array as parameters or arguments?
I have two functions: function example($param1, $param2) { echo $param1 . $param2; } function frutas($fruta1, $fruta2, $fruta3) { echo $fruta1 . $fruta2 . $fruta3; } And I also have a variable that…
-
3
votes1
answer111
viewsDifference of parameters in Python
In Python, what’s the difference between Funcao(param='value') and Funcao(value)? Or else Funcao(u'value')? I’m starting with Python and I’ve seen codes with these three forms. I don’t know if they…
-
3
votes1
answer244
viewsWhy can’t I pass a parameter to the class?
I’m trying to pass the parameter "ink" to the class "Pen" but I can’t. I’ve tried using boolean expressions instead of index, but still no result. Could someone give me a help? class Caneta(): açao…
-
3
votes1
answer157
viewsCreate an object with strong Ruby on Rails parameters
I need to create an object from only one button. I pass nothing to the method, I call only through the button. All the data I need I have access to the controller action I’m using. But I can not…
-
3
votes2
answers107
viewsHow to make this type of signature in C#?
It is possible to apply this signature type in C#? public class Teste { public void ver(Class<? extends Teste> tipo) { } } Like?
-
3
votes1
answer81
viewsHow to use more than two types in function parameters?
Suppose the following function in PHP: function parse (string $text, array $callback) { # ... } In theory the parameter $callback must be a array, but it can also be accepted as string. How do I get…
-
3
votes2
answers1038
viewsHow to omit parameters in the actual parameter passage?
I have a C++ function called minhaFuncao() thus declared: minhaFuncao(int x, int y, float a); and thus implemented: minhaFuncao(int x, int y, float a=0){ ... } What I’m trying to say is, when you…
-
3
votes1
answer2858
viewsOptional parameter in function
I was trying to create a square root function: def root(n, ind): if ind == None: ind = 2 ind2 = 1 / ind print(n ** ind2) I want the ind not be mandatory. I thought if I didn’t, the value would turn…
-
3
votes2
answers120
viewsWhat is the difference between using variable and passing direct parameter?
I wanted to know the real difference and between $sql = 'select * from tbl_blablabla'; $result = $connect->prepare(sql); and $result = $connect->prepare('select * from tbl_blabla'); Not just…
-
3
votes2
answers655
viewsMysql parameter error with C#
string sql = @"UPDATE ivendas SET nritem=(@rank:=(@rank+1)) where id_venda = 20"; try { MySQLBase basemysql = new MySQLBase(); MySqlCommand cmd = basemysql.connection.CreateCommand();…
-
3
votes1
answer71
viewsCookie returning duplicate value
I am cookie saving an object in JSON format. In the properties of this object I have links with several parameters. With each link change, I update the cookie with the new value. Example of the…
-
3
votes1
answer63
viewsWhat is the parameter passed in Sort()
Doing an exercises I came across the following parameter passage in sort(): let notas = [7,6,10] notas.sort((a,b) => a < b ? 1 : -1) console.log(notas) I could not understand, since I have…
-
3
votes1
answer113
viewsHow to set a pointer as the default parameter in C++?
I am "programming in C", but compiling using the extension .cpp and the g++ to have some facilities. My goal is to make a program that receives a starting salary and calculates the final salary…
-
3
votes2
answers2190
viewsHow to pass a matrix as a reference to a function?
I’m trying to pass as a parameter a matrix for a function as a reference, and in this function do operations in this matrix but I’m not getting. I don’t want you to use define or const int for the…
-
3
votes1
answer549
viewsCS7036 error on C# calling a function
I just got into the matter of functions and methods and I’ve come across a problem that I can’t solve at all because I don’t understand why. The point is: "Create a method that takes an integer…
-
2
votes1
answer197
viewsDifference in onCreate(Bundle) parameter
I had a doubt here reading Ricardo Lecheta’s book, android, in which I saw no explanation neither in the book, nor found on the internet. Some examples use the onCreate function like this:…
-
2
votes1
answer1956
viewsHow to pass filename with accentuation and spaces as parameter for shell script file
I densenveloped a shell script that gets the location of a file and does several manipulations on it, e.g.: ./processes.sh path/file.txt However, when I send a file name as a parameter that contains…