Can I reference an existing variable when defining a new variable in Neoload - variables

I am defining some new variables in NeoLoad as in this screenshot:
I will be defining at least 10 variables like this, so the question is if it is possible to reference an existing variable in the host field? Imagine it like ${db_host} but that does not work.

No you can't. but if you use javascript, you can manipulate the variables easily.
Example :
var ENV = context.variableManager.getValue("ENV");
var IDPART_REQ1 = context.variableManager.getValue(ENV + "-JDD-REQ1.IDPART");

This is not possible with the latest version of NeoLoad.

This option is not possible with neoload, but you can insert a JavaScript element in your test to do that

Related

TFS/VSTS, refer to a variable in a variable

I wonder if its possible to refer to a variable in another variable using variables in VSTS and/or TFS.
For instance lets assume we have the following variables:
var1:http://environment1.somedomain.local/api/endpoint/1
var2:http://environment1.somedomain.local/api/endpoint/2
var3:http://environment1.somedomain.local/api/endpoint/3
what I would like to achive is something like:
varDomain:environment1.somedomain.local
var1:http://$(varDomain)/api/endpoint/1
var2:http://$(varDomain)/api/endpoint/2
var3:http://$(varDomain)/api/endpoint/3
and the be able to use var1,var2 and var3 later on in my build be able to use these as tokens for my web.conifg "transform".. and/or use them in the tasks for my build and/or release.
Anyone aware if its possible to combine variables in this way?
The examples you provided work perfectly. So the answer to your question is, "yes".

Accessing variable from other script

How do I call a variable from other script components?
mirror.transform.position = cop.GetComponent("AI_Car").mirrorPos;
It seems that the public variable carPos declared in the script AI-Car-script cannot be accessed:
'mirrorPos' is not a member of 'UnityEngine.Component'.
2 things:
1) I work in C#, so I may be wrong about this, but I think you have to get the component and THEN get the variable. For example:
var otherScript: OtherScript = GetComponent("AI_CAR");
var newPosition = otherScript.mirrorPos;
2) I think it's best practice to make a temporary variable and then access it. So in the above example, I would then change mirror.transform.position like this:
mirror.transform.position = newPosition;
Obviously it's not not always great to work in vars (sometimes it is, that's an entirely different conversation) but this is just a simple pseudocode example. Hope this helps!
EDIT: here are the docs
You can cast it to the right type:
mirror.transform.position = ((AI_Car)cop.GetComponent("AI_Car")).mirrorPos;
mirror.transform.position = cop.GetComponent<AI_Car>().mirrorPos;
Anyway, the best is to make an AI_Car property, then get it on start, so you can simply read it anywhere in the class by aiCar.mirrorPos or similar.

Can I use e.parameter in conjunction with a global variable to retrieve an external variable in Google Apps Scripts?

I realize the question is confusing. I'm trying to reference many widgets that were created in the main loop of my script from a secondary function using e.parameter.
Instead of referencing each e.parameter separately, by its name, I'd like to be able to make one reference to e.parameter and have the parameter name portion be a globally defined variable.
As in:
e.parameter.some_id
Would be the same as:
var test=[]
test[0]='some_id'
e.parameter.(test[0])
Or some other syntax. I'm trying to reference the parameters in a loop, and using the array means I can increment a for loop counter instead doing if tests for each parameter individually.
I'm certain there's an easier way to do this, but I'm still new to java.
Use e.parameter[test[0]] . It is not java but JavaScript

How to use variable value in live templates in Intellij IDEA?

I want to create live template for setter.
I've created this template
How can I use value of par variable to generate value of var variable? Basically, I want to avoid redundancy here and put name of variable only once and other one will be generated automatically by some algorithm.
UPDATE
I want to clarify a little bit what I want to achieve.
Suppose I want to create setter with name setTime which has parameter time.
public void setTime(long time)
{
// ...
}
I don't want to type "time" twice - capitalized and non-capitalized. I want to type just parameter name so method name will be generated automatically.
UPDATE (Answer)
Turned out that variable order is important. This is final result of what I want
You can use the soutv as an example, notice how it defines a copy of a variable:
It's also possible to define custom expression for live templates via plugins or Groovy code:
How can i add custom expression functions for Live templates in Intellij.

How can a variable be part of another variables name in lua?

I want to set dynamic variable names.
such as
function make(name)
local name..bar = "ipsum"
end
make(foo)
this possible?
For globals it's simply indexing like _G[name..bar]. For locals you could emulate this by setting all globals you use in a local table, and index that one. For an approach to really use a local, I can't help you.