Questions tagged [parameter-passing]

parameter-passing is the process of assigning values to the parameters of a function

Association of actual and formal parameters upon function call. See Parameter Passing and its methods. The most widely used parameter passing methods are:

  • call-by-value
  • call-by-reference
  • call-by-value-result
  • call-by-name
  • call-by-need
  • macro expansion.
8028 questions
2
votes
3 answers

javascript eventlistener function argument

I am trying to add eventlistener to input elements on an html with an inputListener function with a parameter as shown below. But this way does not work. I do not understand why I cannot pass the parameter to eventlistener function. for (let index…
2
votes
1 answer

Use case class parameter in scalajs method from play framework template

Get an UndefinedBehaviorError when using a parameter of type case class in an scalajs method which I handover from a play framework Scala/Twirl template view/notify.scala.html: @(note: Notification, ...)(implicit ...) …
RobertJo
  • 121
  • 1
  • 10
2
votes
1 answer

Can you splat positional arguments in PowerShell?

Does PowerShell support splatting of positional arguments as opposed to named parameters?
codewario
  • 19,553
  • 20
  • 90
  • 159
2
votes
1 answer

Modify weights argument in wrapper function for lm

I have a wrapper function for lm in R. I want to modify the weights argument, if called, before passing it to lm. Is there a way to do this? For example, the wrapper function myfunc should reset the weights to 1, and thus give the same coefficients…
Gaurav Bansal
  • 5,221
  • 14
  • 45
  • 91
2
votes
2 answers

Passing data between fragments from toolbar menu item click using Navigation - Kotlin

I have set up my app using the Navigation architecture component. Navigating from one fragment to the next fragment works fine. However I am stuck trying to pass data in that navigation flow. Following the structure of the Navigation codelab app, I…
2
votes
3 answers

Passing JSON string to JavaScript

I'm working on a project, and we use a lot of coding languages for different parts. I've tried to simplify the problem as much as I can, and came up with the following JSfiddle. The problem is, I have a JSON string which I want to pass on to a…
Neli
  • 113
  • 9
2
votes
1 answer

How to structure a code/function with multi-level function layers

I am a beginner in coding and I can not figure out how to deal with a 'code/function structuring issue'. So when you write a function and the function is starting to have more subordinate functions... I mean it starts to be a multilevel function, I…
Deli Sandor
  • 151
  • 1
  • 10
2
votes
0 answers

Passing by const reference or utilize move semantics

In the past I was taught that when passing std::string to a function or even a constructor to pass by const reference instead of passing by value due to copy. example 1: - function parameter void someFunc( const std::string& str1, const std::string&…
Francis Cugler
  • 7,788
  • 2
  • 28
  • 59
2
votes
3 answers

Which would be the better way to pass values to viewmodel from viewcontroller

This question might seem basic, yet I am posting it to get suggestions. Following is a sample login module using MVVM pattern. The viewcontroller code is as follows. class ViewController: UIViewController { private var loginviewmodel =…
Sujal
  • 1,447
  • 19
  • 34
2
votes
2 answers

Java polymorphism when passing variables.

class X{ public void print(X x){System.out.println("xx");} public void print(Y y){System.out.println("xy");} } class Y extends X{ public void print(X x){System.out.println("yx");} public void print(Y y){System.out.println("yy");} …
2
votes
1 answer

How to pass parameters in hive query when executing using impyla?

I referred to How to use variables in SQL statement in Python? but couldn't get an answer. I am trying what you suggested, but I get this error - :( tbl_nm = 'EMPLOYEE_TABLE' con.execute('select max(emp_id) from schema.?', tbl_nm) Getting below…
rajb2r
  • 31
  • 2
2
votes
6 answers

Should I be reusing collections passed as parameters

yesterday I spent some time trying to find a bug. Long story short, finally I realized that it was because of this constructor: public Triangle(List vertices) { this._values = vertices; } I tried to initialize an object with a list of…
Dyppl
  • 12,161
  • 9
  • 47
  • 68
2
votes
2 answers

Passing argument forth and back between two methods c#

I have two methods. First I pass one string from first method while calling the second method. In second method I do the calculations. Now I want to pass the result back to the first method. How do I achieve that? My code is something like this: …
2
votes
1 answer

Fragment (anchor #) in .NET 4 WebBrowser Control getting lost with Adobe PDF Reader and file://

I create an URI with a fragment (aka anchor #). UriBuilder ub = new UriBuilder("file://path/doc.pdf"); ub.Fragment = "chapterX"; The url is shown correctly in the debugger (ub -> file://path/doc.pdf#chapterX). But when I assign it to a WebBrowser…
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
2
votes
0 answers

R: '...' used in an incorrect context

I have looked at about 40 instances of this error on stackoverflow, but the example below does not appear to me to suffer from any of the defects that these other instances displayed, and I do not know what is wrong with it. ob1 <-5; ob2 <- 6; ob4…
andrewH
  • 2,281
  • 2
  • 22
  • 32
1 2 3
99
100