Most voted "return" questions
In Programming, the Return statement makes the execution leave the subroutine that contains it and continue from the immediately following point to which this subroutine was invoked. Return addressing is usually saved to a call stack as part of the invocation process of the subroutine. Return statements, in many languages, define the return value of a function.
Learn more…152 questions
Sort by count of
-
0
votes1
answer340
viewsReturn of javascript asynchronous methods
I would like to save the return of an asynchronous function. The function is as follows: cb.tabela(serie).then(function(tabela) { console.log(tabela); }, function(err){ console.log(err); }); I wish…
-
0
votes3
answers86
views -
0
votes2
answers426
viewsReturn when the function is over
How to return to alert("SUCESSO") as soon as you fall into return alert("ELSE");? sincronizar: function () { sincronizarCliente().then(function () { alert("SUCESSO"); }, function () { alert("SEM…
-
0
votes0
answers147
viewsReturn method
reciso create a method that returns the variable HUMIDITY; However I need to make a Thread to update the value of humidity every little time. (Moisture is read through the Arduino). You need to…
-
0
votes1
answer1773
viewsWhat is the Javascript "Return" function for?
One of the functions I hate the most is the "Return" because I don’t understand what she does or didn’t do: var quarter = function(number){ number / 4; } if (quarter(12) % 3 === 0 ) { console.log("A…
-
0
votes1
answer3159
viewsQuery sql with longer and shorter date limit
My code should return values from the database, related to the current day (today), but only related to the month and day, I searched a lot but could not find something to help me $data_atual =…
-
0
votes2
answers410
viewsNeed to declare variables in a Javascript function
Hello. I’m starting to learn programming logic. When I create a Javascript function, I declare and ask to return its value. function exemplo(teste){ var saida = teste + 4; return saida; } Well, when…
-
0
votes1
answer27
viewsBring Back between two functions - Javascript
Hello, I have the fuction list , which brings a GET url in another Function.. How do I get the return of {data.name} out of the Function list ?This form below does not return :/ function list(){…
-
0
votes1
answer265
viewsOutput of a void function
I’m programming a word hunt and a problem in the void function is making it difficult. In the code I use functions to scan the matrix in all directions and returns me the initial and final…
-
0
votes1
answer166
viewsTreat functions that return multiple Python values
For example, I have a function mergeSort(alist)that has return return count, blist i.e., returns an integer that is the inversion counter and a list of values. When passing a list 5 4 3 1 2 5 and…
-
0
votes1
answer111
viewsSave a function’s results to an Ionic variable 3 + Firestore
How to save the result obtained in r.get('Quant') in a variable and return its value, because the first console.log shows the data I obtained, but the second does not, and the Return Quant always…
-
0
votes2
answers81
viewsPython: Return a list in 2D format
I want to use the __str__ to receive a list and returns it in the form of a matrix. Example: list_exemplo = [[0,1], [2,3]]would return as: [[0, 1], [2, 3]] How do I do it in the method __str__?…
-
0
votes1
answer88
viewsConvert String Json CSS Inline to an array or json with PHP
I have a register in the json database and inside it there is a "style" object in which it has an inline css code, for example: "padding: 90px 0px 20px 0px; background: #000000; display: block;"…
-
0
votes1
answer202
viewsChange a char array within a function
I am trying to pass a char array pointer to a function. I want it to make changes to this char array. Follow the function code: void dhnfe( char tzd, char hverao, char *dh) { if (hverao == 1) {…
-
0
votes2
answers76
viewsGoing into if wrong
I made this code and expected it to return me 'Jedi Master', but always returns 'Intermediate'. First I had done using switch-case instead of if-lse and it always returned me 'Invalid' (in the case…
-
0
votes0
answers1019
viewsReturn a matrix of a function in C
Hello, I am doing a program in C that requires to be modularized, that the user registers the desired courses, prints on the screen the courses,but I want to use the matrix of courses, in another…
-
0
votes0
answers469
viewsGet a return of a method in another Java class
I have a method in my Spring boot API that receives the data from the user who is logging in, checks if it exists and if the password checks. Once this is done, return returns a JWT token. I need to…
-
0
votes1
answer600
viewsReturn every page via Curl
I need to return a page that is on text/html, but is coded with zlib, yes I tried to decode but no chance, since the function zlib_decode, is not documented so I did searches but all unsuccessful,…
-
0
votes2
answers953
viewsHow to return the page in LARAVEL 5.4
I am with a problem, I am with 4 table, Courses, disciplines, teachers and templates, each with a page for themselves, when I change or delete something in disciplines, teachers I return to the…
-
0
votes1
answer95
viewsAngular - HTTP Interceptor returns the value of a promisse
I have to apply a descriptografia on the return body of a request via Interceptor, but the method of decryption is asynchronous and returns a promisse. Follow a section of the class: intercept(req:…
-
0
votes1
answer204
viewsUse of Class in Kivy
Good afternoon, I want to make a program that uses several combobox and in one window. But I can’t get both. When I run the program, only one of the combobox appears. Below I send the current code.…
-
0
votes1
answer219
viewsNot all paths return value
The event Cadastrar is appearing with the error. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using CamadaModelo; using…
-
0
votes1
answer70
viewsImplicit recursion when assigning the return of a function to a variable?
Speak guys, I’m starting studies in Python and I came across a behavior a little strange for me. It’s this: I have a file test py. which contains some functions. In another file, exempl1.py imported…
-
0
votes1
answer177
viewsFunction Return Java Script
I did a lot of research on callbacks and asynchronous in javascript. Function Helloworld.prototype.getCont searches the ID of an account and returns an EX number: 1; Function…
-
0
votes3
answers99
viewsReturn method asks return that has already been given
I have the following class: public class Exemplar { private boolean disponivel; private int codigo; // seus setters e getters } and this other: public class Biblioteca { private…
-
0
votes1
answer43
viewsProblem with SQL return
I have the following 3 tables: Clients, Requests, Requests: Customers: Solicitations: requeca_description The request table links to the client table(cliente_id = id[client table]) and linked to the…
-
0
votes1
answer204
viewsCall a function that returns an array C#
I need the user to enter a number that will be the amount of numbers to be calculated, for example: if I type 4, there will be 4 different numbers to do a given action (add, subtract, multiply or…
-
0
votes1
answer836
viewsDart/Flutter: how to use return of one method in another method? both invoked in the Class Constructor
I am using Dart/Flutter to develop an application and in it I have two Firebase Listeners methods, as shown below, and I would like to know how, in the constructor method, I trigger one of the…
-
0
votes2
answers56
viewsLooping and Finishing? In Python
Hi, guys. I have a problem with my program. I’m not getting it looped until I "shut it down" it. I’ll be leaving his code, making it easier for you to understand. Where the operator selected to play…
-
-1
votes1
answer174
viewsI need to count the prime numbers to a certain number n
Write the n_primes function that takes as argument an integer greater than or equal to 2 as parameter and returns the number of primes that exist between 2 and n (including 2 and, if applicable, n).…
-
-1
votes1
answer16
viewsProblem with function Undefined return
Good evening, I made the following algorithm in Javascript: var res = 1; console.log(fatorial(3)); function fatorial(n){ if(n == 1){ console.log(res); return(res); }else{ res *= n; fatorial(n - 1);…
-
-1
votes2
answers81
viewsWhat does the "retn" statement mean with an argument?
Is it possible to see return instructions with an argument, how this is done and how the return value is treated? It is to return an argument in the stack?…
-
-1
votes1
answer437
viewsReturn two models in a view (foreach)
good morning. I’m new to C# and Asp . net and I ran into a problem. Developing a virtual calendar, I would like to display two queries on a page just when the user logs in, however, there in my…
-
-1
votes1
answer80
viewsnull Object Reference
Logcat java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean)' on a null object reference…
-
-1
votes2
answers84
viewsHow do I get a given function to return the value of a date variable and a numeric one in php?
I created a function that calculates the next working day of a given date that it receives, but in addition to returning me this new date I wanted it to increment one number more than one counting…
-
-1
votes1
answer174
viewshow to render data from an API in Reactjs?
Sorry, guys, I’m very new to programming and I’m doing a project for a college. I managed to connect the api, I can bring the object from there, but I can’t render this data that is returned, I’ve…
-
-1
votes1
answer56
viewsPython function prints the result but Return = None
I made a function to solve a sudoku game, the function is working correctly (the game is being solved), but the Return of my function is coming as 'None'. By placing a print on the function it…
-
-1
votes0
answers31
viewsDoubt on how to return an object from a method and use it in another class
I’m doubting how to generate an object in a way. I wanted to return the values that are inside the red box, to fill an array with each object of this method. The exit would stay inside the main: My…
-
-2
votes2
answers485
viewsHow can I call a class void method to display an msg in a form
I have a method public void listarProduto(). It needs to have all the user input information. My problem is time to call this method within a MessageBox() in the form for the message to be…
-
-2
votes2
answers170
viewsMaking Javascript function accounts
Hello, I have to multiply using the function, are 3 calculations. When I do the following structure, only the last result appears in Return. function multiplicar(){ return (7*5), (7*10), (50*0.5); }…
-
-2
votes1
answer41
viewsI am making a program in python, and Return is not working
def primo(b, d): d = 0 c = 1 x = 0 while c < b+1: if b % c == 0: x += 1 c +=1 if x == 2: d = 1 return d d = 0 c = [] b = 3 a = int(input ("coloque o número que você quer que seja 'fatorado': "))…
-
-2
votes1
answer186
viewsStatement for 2 arguments, how does it work?
I saw this statement in a code on codewars and I couldn’t understand how it works: def multiple_of_index(arr): return [val for index, val in enumerate(arr) if index and val % index == 0]…
-
-2
votes1
answer2656
viewsCalculating Javascript false/rue relationship
Could help me solve this question, it should return false/true! We need to create a function that checks if two people are half brothers! In order for you to solve this exercise, we have defined for…
-
-3
votes1
answer1085
viewsUse of python Return
def repita(): x = 2 while n % x != 0: x += 1 repeat() while n > 1: n = n / x #aqui se encontra o primeiro problema, já que "n" não é reconhecido fora da função x += 1 if n % x != 0:#mesmo…
-
-3
votes1
answer68
viewsWhy does my function only return "even"?
function parimp(n){ for(var i = 0; i <= n; i++){ if(i % 2 == 0){ return "par"; }else{ return "impar"; } } } var s =…
-
-3
votes1
answer81
viewsHow to go back at a specific point of the code in c++?
I need to go back into the code at three specific points and I don’t know how to do it. I need at different times of my code I need to return to one of the three points already established, but they…
-
-3
votes1
answer38
viewsHow to duplicate a struct in "C"
I have an activity that is to create a struct with SIZE = 5 initially, but I would like it to double its value if it is necessary to insert a sixth value, created a return function for this but the…
-
-3
votes1
answer68
viewsHow to unify the results of Count POSTGRES?
Good morning, I need this query to return the unified result, different from what it returns to me, does anyone have any idea how to do this in Postgres?? went until May(May) but continues until the…
-
-4
votes1
answer235
viewsCould someone help me with a JS exercise? CONDITIONAL
Guys, help here, please! I need to make this code work. I’ve tried everything and keep going wrong. Like you would do? Sets the function today Magazine, which receives by parameter a string that…
-
-4
votes3
answers171
viewsWhy does it return "Undefined" because it has an "if/Else"?
I have this logical condition using the if/Else! function area(largura, altura) { const area = largura * altura if (area > 20) { console.log(`O valor acima do permitido: ${area}m2.`) } else {…