Questions tagged [argument-passing]

Argument-passing may refer to two different things: (1) the process of providing a program being started with some initial pieces of information (the arguments) on its command line; (2) the process of providing the initial values (the arguments) for the parameters of a function when it is called.

777 questions
9
votes
2 answers

Using process.start in a wpf application to invoke another wpf application

I am trying to invoke one wpf application from another wpf application. The invoking wpf application makes the call ProcessStartInfo BOM = new ProcessStartInfo(); BOM.FileName = @"D:\WPFAPPLICATION.exe"; BOM.Arguments =…
Sana
  • 147
  • 1
  • 1
  • 13
8
votes
0 answers

Passing arguments or environment to Mac installer script

I tried to write installer with packagemaker which runs a shell script during installation. I want to pass some arguments to the shell script during silent mode installation. Something similar to $installer -pkg MyInstaller.pkg -my_argument1…
user1119324
  • 151
  • 1
  • 3
8
votes
2 answers

How can I pass arguments into SwingWorker?

I'm trying to implement Swing worker in my GUI. At the moment I have a JFrame containing a button. When this is pressed it should update a tab displayed and then run a program in the background thread. Here is what I have so far. class ClassA { …
user843337
8
votes
2 answers

C++ managed array size

I have this function(array^ a) How do I know the length of this array? Like C++, the size has to come with the function? Thanks,
ABCD
  • 7,914
  • 9
  • 54
  • 90
8
votes
4 answers

omit passing an empty quoted argument

I have some variables in a bash script that may contain a file name or be unset. Their content should be passed as an additional argument to a program. But this leaves an empty argument when the variable is unset. $ afile=/dev/null $…
XZS
  • 2,374
  • 2
  • 19
  • 38
8
votes
1 answer

extending Lua: check number of parameters passed to a function

I want to create a new Lua function. I can use function with parameters (I'm following this link) in order to read function parameters. static int idiv(lua_State *L) { int n1 = lua_tointeger(L, 1); /* first argument */ int n2 = lua_tointeger(L,…
Jepessen
  • 11,744
  • 14
  • 82
  • 149
8
votes
3 answers

Default argument in R function (formal argument matched by multiple actual arguments)

Simple question, I hope. I want to write a plotting function that has a default value for the y-axis label if the user doesn't specify. I'd also like to allow the ... argument for other plotting parameters, and allow the user to set ylab manually.…
Stephen Turner
  • 2,574
  • 8
  • 31
  • 44
8
votes
3 answers

How do I pass arguments to C++ functions when I call them from inline assembly

So, I would like to be able to call functions from a c++ dll. For certain reasons, I would like to call them from an __asm block in my C++ code. My question is this: I know that before I call the function, I have to push its arguments on the stack…
Emil D
  • 1,864
  • 4
  • 23
  • 40
8
votes
3 answers

Can you call a servlet with a link?

Can you call a servlet with a link? For example link text And possibly pass parameters to the request object by adding them to the querystring. If not, I have seen this kind of thing: RequestDispatcher dispatcher =…
Ankur
  • 50,282
  • 110
  • 242
  • 312
8
votes
7 answers

bash string quoted multi-word args to array

The Question: In bash scripting, what is the best way to convert a string, containing literal quotes surrounding multiple words, into an array with the same result of parsed arguments? The Controversy: Many questions exist all applying evasive…
nickl-
  • 8,417
  • 4
  • 42
  • 56
8
votes
1 answer

Perl how to take advantage of a block argument in my subroutine (like grep does)

grep can be invoked in two ways as listed below. I properly miss a piece of information to understand this block magic. Maybe a good soul can explain to me how grep internal gets a reference to the block and deals with that or even better how can I…
user2050516
  • 760
  • 2
  • 5
  • 15
8
votes
1 answer

How to unshift or add to the beginning of arguments object in JavaScript

I've just learned the convention for popping off the first element of the arguments array (which I also learned is actually an Object). Now I need to do the opposite. I need to use an unshift operation to add a value to the beginning of the…
at.
  • 50,922
  • 104
  • 292
  • 461
8
votes
4 answers

void pointer as argument

The following C snippet: [...] void f1(void* a){ printf("f(a) address = %p \n",a); a = (void*)(int*)malloc(sizeof(int)); printf("a address = %p \n",a); *(int*)a = 3; printf("data = %d\n",*(int*)a); } void f(void){ void* a1=NULL; …
Will
  • 155
  • 1
  • 2
  • 5
7
votes
2 answers

pass parameters to php with shell

my question is probably easy to answer. i want to execute my php file with shell and pass parameters to it via shell example php test.php parameter1 parameter2 is there a way to do that except using GET ? thanks
Don Gorgon
  • 2,321
  • 3
  • 18
  • 20
7
votes
1 answer

Problems passing arguments with callNextMethod() in R

My question: Why is callNextMethod() not passing arguments as expected to the next method? Situation: Say I have two hierarchical classes foo and bar (bar is subclass of foo) for which I have a method foobar that can dispatch for both classes (i.e.,…
Henrik
  • 14,202
  • 10
  • 68
  • 91