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
1 answer

Why is this program telling me invalid parameter was passed?

Honestly I don't even know what I am trying to do as of now. But I can't go further until I get this function to work, and it throws that exception each time, what is going wrong? The exception is "Unhandled exception at 0x0F61CAB6 (ucrtbased.dll)…
dcalvert
  • 73
  • 1
  • 11
2
votes
2 answers

How do I pass a pandas method as a parameter?

I have a function which calculates the mode of columns of a pandas dataframe: def my_func(df): for col in df.columns: stat = df[col].mode() print(stat) But I would like to make it more generic so that I can change which…
SarahD
  • 91
  • 8
2
votes
1 answer

How to Pass Parameters to a Power BI Report on Report Server from MVC Application at Runtime

I have created a power bi report in Power BI Desktop using a stored procedure having parameters From Date, To Date, CategoryId, DepartmentId. I have uploaded the report to Power BI Report Server. Now I am trying to embed the report in my MVC…
2
votes
4 answers

Passing values to JMeter script at run time through bat file

I need to pass thread group, ramp up time and loop count to a JMeter script at run-time after getting the inputs from the user. For this I have created a bat file like below: @echo off title Accepting User Inputs And Passing It To JMeter Scripts…
Satyajit
  • 152
  • 10
2
votes
1 answer

Passing derived type to refactored method

In my EF Fluent API configurations, I have a number of classes that derive from an abstract base class public abstract class ImageBase { public int ImageId { get; set; } public string ImageTitle { get; set; } public string…
dinotom
  • 4,990
  • 16
  • 71
  • 139
2
votes
1 answer

Passing a collection to print, to print with a separator in Python 3?

In Python 3, you can print a bunch of objects* with a variable number of objects as the first bunch of args: For example: print(192,168,178,42,sep=".") Or for example: print("09","03","2018",sep="-") But like let's say I have a collection of…
leeand00
  • 25,510
  • 39
  • 140
  • 297
2
votes
3 answers

passing structure reference from a c# code to call a c++ DLL function that accept structure reference in its prototype

I hav a function in c++ DLL that has following prototype int function(RefPar ¶ms); how can i call this function from a c# program using "DLLImport". when i tried like below, AccessViolationException happened while running in visual studio…
Jamkan
  • 59
  • 6
2
votes
2 answers

unwrapping object for passing as function arguments

If we have a function like this: function foo(param1: string, param2: number); and an object like this: let obj = {param1: 'blah', param2; 10} How can I directly unwrap the object to pass its data to the function arguments? Something like this:…
Anmol Singh Jaggi
  • 8,376
  • 4
  • 36
  • 77
2
votes
1 answer

Julia: Passing arguments for a function into a function

I was wondering if Julia has an easily already built in capability to pass arguments meant for a function in a function? For example, I'm working with Gadfly but I want to create a function that makes a specific plot, let's say one that does a line…
NoviceStat
  • 115
  • 7
2
votes
2 answers

Default argument to function only if condition is met

I am currently writing a function that I want to pass default arguments if a condition is met. If the condition is not met, no argument should be passed. How can I achieve this? I tried it with ifelse and NULL like in this minimal example but it…
TobiSonne
  • 1,044
  • 7
  • 22
2
votes
1 answer

How can I pass a Defined quad number (8 BYTES) as a parameters to a subprogram in 32 bit NASM assembly

I am using 32-bit NASM assembly and was wondering if there is a way to pass a defined quad number (8bytes) as a parameter to a subprogram in Nasm 32-bit assembly. I know that the stack in 32bit assembly is organized to accept defined double words (4…
John
  • 23
  • 3
2
votes
2 answers

R: Understanding how ellipsis (...) works in nested functions, & how iit doesn't

This is how I have been thinking that ellipsis works in nested functions: when you hand a set of arguments to a function via ellipsis, any function subsidiary to it on the call stack can get at those arguments -- I thought, via its own ellipsis. I…
andrewH
  • 2,281
  • 2
  • 22
  • 32
2
votes
3 answers

Best way to ensure user to specify one and only one of the two function parameters in Python

In some_function, I have two parameters freq and frac, I don't want users to specify both of them, or none of them. I want them to specify just one of them. Here is the working code: def some_function(freq=False, frac=False): if (freq is False)…
KubiK888
  • 4,377
  • 14
  • 61
  • 115
2
votes
4 answers

general programming issues

think about three problems A, B, and C. A uses x,y methods to be solved; B uses x,z and C uses x,y,z. which one would be better and which one could give better performance, and which one could be more readable: "writing three different…
Bastardo
  • 4,144
  • 9
  • 41
  • 60
2
votes
1 answer

Overriding namespace with yaml

Problem statement I want the options supported in a python module to be overridable with an .yaml file, because in some cases there are too many options to be specified with non-default values. I implemented the logic as follows. parser =…