Most voted "variables" questions
A variable is a named data storage location in memory. Using variables , a computer program can store text numbers, binary data, or a combination of any of these data types. They can be transferred in code, to other functions and even other applications.
Learn more…645 questions
Sort by count of
-
1
votes1
answer111
views -
1
votes2
answers166
viewsHow to return the name of an instance of a class?
To avoid having to manually type the data after an update to the objects, I decided to create a method of type static to be accessed by passing the object as parameter. public static void…
-
1
votes1
answer30
viewsD3.JS: Variable with getElementById default value
I am creating a visualization in D3.js, in which I am importing the date through a dynamic string that requires a variable, which I named honeystring. Variable var honeyyear =…
-
1
votes2
answers803
viewsError in assigning a value to a variable
I’m doing some algorithms on Visualg and came across the following error: Error in assigning values to variable d: REAL to INTEGER My code is this one: Algoritmo "acertoMiseravi" d: inteiro Inicio…
-
1
votes1
answer294
viewsHow to list and delete Variables in Mysql?
I know it’s a very basic question, but I can’t get a straight answer on the Internet. I wonder how to list and delete variables in Mysql. Ever since I thank.
-
1
votes1
answer1411
viewsHigh 5.6 - global and dynamic variable
I have an API with Laravel 5.6 and need to create global variables that throughout the application can have their value changed, but I’m having problems. Example: 1. In the first request, the value…
-
1
votes2
answers558
viewsHow to save the value of a variable in Android Studio?
I am developing a small game just for friends and do some tests, the problem is that I know virtually nothing of programming and got stuck in the data saving part. I have read several times and seen…
-
1
votes2
answers327
viewsHow many times will the x variable be created at the end of the loop? Why?
In the following loop, how many times the variable x will be created at the end of loop? Why? for (int i = 0; < 10; i++) { double x = i + 10; System.out.println(x); }…
-
1
votes1
answer82
viewsTitle with PHP variable
Hi, I developed a page php details. which uses the get method to take the information of the dice and play on the page. And put a variable $name within the HTML title <title><?php echo…
-
1
votes1
answer73
viewsSingle-line save in DB, the result of the PHP variable (WHILE/LOOP) of a MYSQL Query
I have the following problem: When performing a query, the while result is composed of more than one value, for example: $query_sku = mysqli_query($connect, "SELECT t.column_name FROM skus AS s…
-
1
votes1
answer473
viewsHow to concatenate the name of a variable into C++?
Is it possible to concatenate the name of a variable into C++? Something like this: using namespace std; int main() { int casa = 10; string a = "ca"; string b = "sa"; cout << a+b <<…
-
1
votes1
answer200
viewsUpload external content with AJAX to global Javascript variable
I’m uploading some data from an external file (.txt) local using AJAX, I would like to know how I can store this data in a global variable for data manipulation, because I need to separate some…
-
1
votes2
answers110
viewsHow to prevent function modifies global variable?
Creating a function to return a given value, from received parameters, it modifies the variable it receives. For example: var a = ["oi", "tchau"]; function duplicar(c) { var b = c; b[0] = b[0] +…
-
1
votes3
answers154
viewsHow to "mount" a multiple variable?
Would it be possible to mount a variable to pass a value to it? For example: var teste0 = "valor"; var teste1 = "outro valor"; var teste2 = "mais um valor"; for(int i=0;i<3;i++){ teste+i = "mudou…
-
1
votes2
answers69
viewsWhat is the difference between these two statements?
Let’s say I created a struct point that gives a certain point in a "map". struct Ponto { let x: Int let y: Int init(x: Int, y: Int) { self.x = x self.y = y } What would be the difference between…
-
1
votes2
answers741
viewsHow do I put the value of a variable in a statement of another variable?
NomeDoProduto1 = str(input("Qual o seu primeiro produto? ")) NomeDoProduto2 = str(input("Qual o seu segundo produto? ")) NomeDoProduto3 = str(input("Qual o seu terceiro produto? ")) PrecoProduto1 =…
-
1
votes1
answer143
viewsVariable changes value when calling function
I created a variable v, who receives n random numbers. when create another variable by calling a function and passing v by parameter, the v mute. n = int(input("Entre com o tamanho de vetor: ")) v =…
-
1
votes2
answers233
viewsVariable is not being found
Why the following program does not work? package javaapplication1; import java.util.Scanner; public class Exemplo008 { public static void main(String[] args){ Scanner teclado = new…
-
1
votes0
answers79
viewsphp variable that stores html code
I haven’t used php for 2-3 years, I even learned about it, but recently I went to look at some code to make some modifications to a site and I’m having a great difficulty, the first is this, has a…
-
1
votes1
answer558
viewsI need to export a variable from one typescript to another, but the variable does not get the value I need
I need to export the language variable of a ts to another, however, the variable (language) that is being exported does not present the value that I want to export. I tried to put the export in some…
-
1
votes1
answer75
viewsVariable loses value inside "for"
a=2 for a in range (9) : print (a+1) Why using the for, in this case, it is printed from 1 to 9, and the variable a is equal to 2?
-
1
votes1
answer137
viewsDoubt about closures, function inside loop
I’m studying about closures in Javascript based on the book "You Don’t Know Js" by Kyle Simpson. I understood the concept of closure, that he can "hold" the reference to the lexical scope outside…
-
1
votes2
answers105
viewsMore appropriate way to name a list
Hello I would like to ask a question about attribute names. What would be the most appropriate way to name a list? Let’s assume that I have an attribute which is a list of Ufs. What would be the…
-
1
votes2
answers342
viewsUse of the unassigned local variable of two strings in C#code
My code should be entered the gender of a person, height and age of a person in a repeat loop for 10 people. The code must show the greater weight, lower weight, average height of 10 people, the…
-
1
votes0
answers32
viewsUse variable value as JS parameter
I was doing some tests to train JS with HTML. Then I made a newsletter system, where a newsletter Object has the notes of some subjects, and by a select chose the subject and which bimonth wanted:…
-
1
votes1
answer45
viewsPrint with variable or by direct account?
Are these two methods the same in terms of performance? Is one better than the other or is it better in terms of code organization? Method 01: direct printf("%.4lf\n", sqrt( pow(x2-x1, 2) +…
-
1
votes0
answers58
viewsHow to dynamically define the function to be called in Python
Hello, I would like the program user to write a function for later use, however I’m having difficulty to implement this: See the example below: def funcao_integracao(x): y=x**2 return y def…
-
1
votes2
answers77
viewsPerformance problem when declaring variables
I’m making a code that a very large function, where I declare some local variables with const and let. To improve his reading I’m dividing this function into several small functions. So I ended up…
-
1
votes1
answer54
viewsUse a form int variable in another form C#
I have been trying to use my Form1 double money variable in form2, because I need the amount received in Form1 in form2, I left the publish variable and tried to instantiate but still giving error:…
-
1
votes1
answer57
viewsHow do I insert NA, or deviation of missing data, when making Webscraping (rvest) from a page in R?
I’m downloading the hotel rates at Natal- RN by the Booking.com website. The code is programmed to download according to the check-in date the hotel name (nomes_i), the name of the room (quarto_i)…
-
1
votes1
answer103
viewsHow to print variable component in Laravel 7?
I have a $user variable in my Controller. So: public function index() { $userBiografia = "Biografia do Usuário"; return view('user.index', compact('userBiografia')); } I can print it peacefully in…
-
1
votes2
answers87
viewsHow to define which inputs will be accepted by the code?
I have a code where as the user enters data, I want to create a list that will be used for operations later. Output input would be the key "f" interrupting the repeat structure and initiating…
-
1
votes1
answer60
viewsParameter of a function
How the code ran right if the function parameter experiencia does not have the same variable name anosEstudo. How Javascript understands that they are the same thing? <script> var anosEstudo =…
-
1
votes2
answers62
viewsRepeat loop in C++
Good night, my friends! I’m starting the ADS course and I have a question. I need to create a loop of repetition for 50 students by collecting 4 grades of 4 exams, and at the end, present a report…
-
1
votes1
answer42
viewsCan you insert a variable by passing it as a regular expression in the awk command?
Example: VARIAVEL="Pará" echo "$VARIAVEL" | awk '/^P/ { print $1 }' What this does is just search for any word started with a capital letter P. Okay, so far so good! Now, I want to know if you can…
-
1
votes3
answers59
viewsValue of a "for" returned infinitely
Contextualizing: I have an exercise that suggests creating a program to read student grades and show grades equal or higher than average. Thus, the following code was written: #include…
-
0
votes2
answers631
viewsProgram "jumping" Variables
The program is skipping the variables without even putting the number I want to use on it. All I can do is put the first one in and then it jumps and it goes to zero. I don’t know if it’s program…
-
0
votes1
answer518
viewsVariable in Ajax request
Code to receive the numeroCartao of the user via $_Session and show all information about it. And from here I can delete this user via AJAX. In this excerpt of the code I can see the array…
-
0
votes4
answers1051
viewsHow to do if and Else of between 2 variables with output in a third?
I’m so sorry, but I had to rewrite my entire question because I wasn’t being objective enough to make myself understood, when I omit code as was the previous case is not to hide something is just to…
-
0
votes0
answers105
viewsRecover values passed by Jquey on an ASP page
Dear friends, I am with a big problem, I created a page that loads more values (load more) where I enter values via Jquery and recover in another ASP page through request example: page_number =…
-
0
votes1
answer1278
viewsHow to put an SQL command in a variable
I have a following SQL command and I need to put it inside a variable in SQL. The code is this. WITH DB_CPU_Stats AS (SELECT SUM(total_worker_time) AS [CPU_Time_Ms] FROM sys.dm_exec_query_stats…
-
0
votes2
answers193
viewsVariable call another
I need to declare a variable and call an object name by code and also call the type. I tried nesting the foreach but it didn’t work. I tried to declare the variable $tipo out of function but also…
-
0
votes2
answers95
viewsHow to change filename with variable
This is the file with the variable I want. # pt/lang.php <?PHP $rp_lang = "pt"; ?> This is the file I want to insert but I want the variable to change the ending either to "pt" or "en" or any…
-
0
votes1
answer90
viewsLoop error in stock control
<?php $sql = mysql_query ("SELECT * FROM cadastro "); while($resultado = mysql_fetch_array($sql)){ $idrepete = $resultado['id']; ?> #divId<echo idrepete; ?>{ width:100%; } <?php }…
-
0
votes1
answer1862
viewsPass PHP variable value by Javascript
Now follow the function; what I need is to simply pass the value of a Javascript variable into PHP, if I make an isolated code without so many quotes and calls works, but when I mix everything gives…
-
0
votes1
answer62
viewsHow to access an environment variable with .(dot) in the name
Hello, can anyone tell me how to access an environment variable with .(dot) in the name using linux terminal
-
0
votes1
answer2617
viewsHow to use the current date in a trial?
Good night, you guys. I need some help. For you to understand, I am trying to execute a system process that asks me some variables that I can pass them in a fixed way, but one is date. in case the…
-
0
votes3
answers86
viewsUsing variables in the Model
Well, I have the following function in my Model : public function get_learning_category_list() { $categorias = $this->db->select('t1.id, t1.title, t1.metadata, t1.meta_title, t1.description,…
-
0
votes1
answer993
viewsAccess variables from another iOS Swift class
I have a class Main in my application, and in it I have created the variable cod which receives the value of 0, in this class I also have a sequence of buttons that in them contain the event of…
-
0
votes0
answers194
viewsHow to loop within a variable in Javascript?
I have a page index.php. In it has a loop which collects row by row from a mysql database table and inserts into variables that are sent to the file dashboard.js where the code is below. var…