A process of setting or re-setting the value stored in the storage location(s) denoted by a variable name.
Questions tagged [variable-assignment]
4336 questions
1
vote
2 answers
SQL Server: fetching a variable name from a table and assigning value inside the stored procedure
I have some variable name stored in a table, which I need to populate in a stored procedure based on a condition.
For example:
Query: select column1 from TestTable
Output of Query: @FromDate
Now inside the stored procedure, I have the…

Fahad Majeed
- 11
- 2
1
vote
2 answers
Assigning a value to a JavaScript matrix inside of a forEach gone wrong
The bitGraph.dfs() function returns an array of strings, with a format of 'i,j'. The matrix ends up with columns of ones and zeros. The goal is to have the indexes parsed from the strings of the matrix assigned to ones.
I checked the debugger and…

Kristijan Lazevski
- 13
- 3
1
vote
3 answers
IEnumerable assignment
I have two objects declared as IEnumerable xVal and IEnumerable yVal.
Then some where is my program I have:
var xVals = from p in result where p.chemical == "Benzene" select p.SampDate_Name;
var yVals = from p in result where…

Suhartha Chowdhury
- 11
- 3
1
vote
1 answer
Changing variable labels/legend in raster plot to discrete characters
I have just made a plot using raster data that consists of 6 different land types and fit them to polygon vectors. I'm trying to change the values on the continuous scale bar (1-6) to the names of each landtype (e.g. grasslands, urban, etc) which is…

Alex White
- 21
- 2
1
vote
1 answer
Assign "variable variables" to a directory
I would like to assign the following variable names to a directory for easy manipulation later. The idea is as follow:
data_1= fits.getdata(.....)
data_2= fits.getdata(.....)
data_3= fits.getdata(.....)
.
.
N=10
d={}
for i in range(N):
d['data_'+…

Jeicot Delgado
- 11
- 1
1
vote
1 answer
Powershell Dynamically call Azure Devops variables inside script
I have a requirement to load the variables inside a variable group into an azure keyvault. We do not want to link the variable group to the keyvault in order to be able to close the keyvault external network access.
So I started developing a…

Jorge Rodrigues
- 97
- 1
- 9
1
vote
3 answers
Bash script execute wget with an input inside url
Complete newbie, I know you probably can't use the variables like that in there but I have 20 minutes to deliver this so HELP
read -r -p "Month?: " month
read -r -p "Year?: " year
URL= "https://gz.blockchair.com/ethereum/blocks/"
wget -w 2…

nyetrying
- 21
- 2
1
vote
1 answer
Why is `a => a` different to `a = a` in Ruby?
I understand why a = a in Ruby produces nil (see Why is a = a nil in Ruby?).
But using the rightwards assignment operator, a => a produces an error:
irb(main):001:0> a => a
(irb):1:in `': undefined local variable or method `a' for main:Object…

pxeger
- 148
- 1
- 12
1
vote
1 answer
create new variable out of two variable for a subset of rows
I need to create a new variable (Var_new) out of the values of two old variables (Var_Old_1; Var_Old_2) but in both cases only for a subset of rows.
Let me explain:
I have an index variable, indicating the patient code; called "patientcode" (H01,…

Verena
- 21
- 1
1
vote
1 answer
c# how access a non-static public variable from action
I'm using a NuGet package, FFMpegCore, to transcode videos in a Windows Service created with VS 2022. The package calls an Action during the transcoding process that gives status information which I'd like to return to the user using their org and…

Velocedge
- 1,222
- 1
- 11
- 35
1
vote
2 answers
Ansible define variable if match in regex
I have an extra variable in my command to execute the Ansible playbook.
I would like to assign another variable only if the extra variable has the prefix database + "/"
For example:
ansible-playbook ./test.yml -e "branch=database/1.3.4"
The…

ITnewbie
- 460
- 6
- 23
1
vote
1 answer
Variables declared in shell script not being recognized as a variable and instead a command
Here is the script that I wrote:
#!/bin/bash
directory1 = ~/path/to/directory/
directory2 = ~/path/to/directory2/
diff -r $directory1 $directory2 || echo "files are different"
And here is the output/error message that appears:
./compare.sh: line 2:…

user15985364
- 13
- 3
1
vote
1 answer
Why does Pylint warn "Redefining name from outer scope" against default parameter?
def print_name(your_name = "Anonymous Andy"):
print("Hello, " + your_name)
def your_name():
# This function has same name as variable in above function
return None
print_name() # Prints "Hello, Anonymous Andy"
print_name("World") #…

dungarian
- 203
- 2
- 8
1
vote
1 answer
Dynamic value assignment in Matlab
I have a cellarray whose values are used to initialize corresponding structs.
cellarr = {'NI' ; 'EQ' ; 'TA' } ;
defstr = struct('Raw', '-1') ;
for i = 1:size(cellarr,1)
eval([cellarr{i,1} '= defstr;']) %Yes,I know eval is bad!Any other…

Maddy
- 2,520
- 14
- 44
- 64
1
vote
4 answers
How does javascript x = y work when dealing with objects?
I am working with Omniture tagging and I've got numerous events on the page. In omniture, the base object is s this object is created globally by Omniture.
The s object has a number of "standard" variables that I like to set for it, url, pagetitle,…

Alex C
- 16,624
- 18
- 66
- 98