Questions tagged [arguments]

An argument is a value passed to a function, procedure, or command line program. This also refers to the Array-like `arguments` object in JavaScript.

An argument is a value passed to a function, procedure, or program. It is often used interchangeably with the word "parameter", which also has more specific definitions. Usually "argument", or "actual parameter" (as opposed to "formal parameter") is the value of the parameter used within the called routine.

In other words, parameters are used in procedure definitions, and arguments are used in procedure calls.

arguments can also refer to the Array-like object in JavaScript that is available inside functions, this object can be used to access all of the function's arguments regardless of the function's signature.

11091 questions
3
votes
2 answers

Passing Unicode command-line arguments to a console app

I’m trying to write a console application that can accept filename arguments and want it to be able to handle Unicode filenames. The problem is that I cannot figure out how to test it. How can you pass Unicode arguments to a console app? I tried…
Synetech
  • 9,643
  • 9
  • 64
  • 96
3
votes
2 answers

Explode array elements into comma-separated arguments (Node.js)

Say I have a function that takes an arbitrary number of arguments (the last is callback): xxx.create ('arg1', 'arg2', ..., 'arg10', callback) { ... } But it's ugly. I want to be able to extract the first few parameters and do something…
Pooria Azimi
  • 8,585
  • 5
  • 30
  • 41
3
votes
7 answers

how to pass array string in JavaScript function from PHP end as a argument?

I am getting the error missing ) after argument list in my Firebug console. emissing ) after argument http://a8.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/393131_320846714645076_100001592501599_911297_470580896_n.jpg My question is how to pass…
Query Master
  • 6,989
  • 5
  • 35
  • 58
3
votes
3 answers

passing array as a command argument

I am trying to pass an array to a ruby script from a command line and facing some issue. Here is the problem: require 'pp' def foo(arr1, var, arr2, var2) puts arr1.class pp arr1 pp arr1[0] puts arr2.class pp arr2 pp arr2[0] end foo…
codeObserver
  • 6,521
  • 16
  • 76
  • 121
3
votes
1 answer

Calling a Word VBA Sub with arguments from Excel VBA

I have a very simple Word sub in a dotm template: Sub YHelloThar(msg As String) MsgBox (msg) End Sub I then have an Excel sub: Sub CallWordSub() Dim wdApp As Word.Application Dim newDoc As Word.Document 'Word template…
Pixel Elephant
  • 20,649
  • 9
  • 66
  • 83
3
votes
6 answers

Is there a difference between javascript arguments and custom options as parameters?

is there a difference accessing javascript arguments via the default 'arguments' and using an explicit object such as 'options'? are these two similar apart from that one accesses the array arguments and the other accesses the object…
Pete_ch
  • 1,301
  • 2
  • 28
  • 39
3
votes
1 answer

Perl: transfer list of huge strings to subroutine without their copying

The task is to transfer a list of huge strings to subroutibe, but avoiding their copying on transfer. Say I have a reference named $ref pointing to the very large string. Also let's have f($) subroutine accepting a single argument. There are no…
indexless
  • 389
  • 3
  • 11
3
votes
1 answer

VBScript - Don't know why my arguments are not used the same way as variables

I have written a VBScript to enumerate events from the event log on a particular day. The first query select from the NT event log events between todays date and yesterdays date, Set colEvents = objWMIService.ExecQuery _ ("Select * from…
Nasa
  • 173
  • 1
  • 2
  • 8
3
votes
3 answers

C++, polymorphism vs. templatization of a function argument

There are two classes A and B, where A is the base class and B is the derived class: template class A {T a;}; template class B: public A {T b;}; and the following class representing a modified container template…
justik
  • 4,145
  • 6
  • 32
  • 53
3
votes
3 answers

Members vs method arguments access in C++

Can I have a method which takes arguments that are denoted with the same names as the members of the holding class? I tried to use this: class Foo { public: int x, y; void set_values(int x, int y) { …
Alex
  • 43,191
  • 44
  • 96
  • 127
3
votes
2 answers

Can you set a default value for an argument in a remote CFC function?

The ColdFusion 8 documentation states the following about the "required" attribute of CFARGUMENT: "All arguments are required when invoked as a web service, irrespective of how they are defined." However, I don't want ColdFusion to throw an…
Eric Belair
  • 10,574
  • 13
  • 75
  • 116
3
votes
1 answer

Making a command-line command with Linux

I would like to make a Lua script that could run with arguments in Linux, for an example, lua foo.lua 25 would process the number 25 and give you an answer based off of that, my current program uses io.read to ask the user to enter a number, but I…
3
votes
2 answers

function argument definition issue in R

Here is my problem, when I want to develop a function for widespread use. dataframe1 <- data.frame(V1 = 1:10, V2 = 11:20, V3 = 21:30, V4 = 31:40) myfun <- function (dataframe, A, B, yvar) { dataframe1$A <- as.factor(dataframe$A) …
jon
  • 11,186
  • 19
  • 80
  • 132
3
votes
1 answer

Global variables and arguments in matlab, which is fastest?

I am using a recursive function in Matlab where some variable are required at each level, these don't change. Though some do change in functions and also need to be reflected in main program. I'd like to know which is best: To define variables…
3
votes
4 answers

get dictionary value using .(dot) operator using dynamic keyword, it's possible?

I have the following class: public class foo { public Dictionary data = new Dictionary(); public foo(params object[] args) { foreach (object arg in args) { …
The Mask
  • 17,007
  • 37
  • 111
  • 185