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
-
2
votes1
answer1113
viewsWorking with the return result of an ajax request with jquery
I wonder if it is possible to compare a value returned from an Ajax function with an external variable using jquery. When I try to make the comparison I realize that the external variable is not…
-
2
votes1
answer455
viewsReturn Result of an IF executed by Command Prompt(CMD) in C#
Hello, I’m trying to get a return from an IF line from Command Prompt (CMD) with Visual Studio 2015 in C#, but I’m not getting it. The following Code, runs the CMD, inserts the directory path that…
-
2
votes1
answer102
viewsShould I specify the type of return of a procedure in Python?
For some time I have studied and learned a little more about Python. I recently read an article about the description of python typing using the module typying. Since I learned about this feature I…
-
2
votes0
answers248
viewsSwitch Case - Break and Return inside a Function - Arduino
Hello, good afternoon! I would like to understand how the switch case works in the Arduino C++ language. I have the following hypothetical situation: estado_principal=0; estados_Japão=0; setup () {…
-
1
votes1
answer220
viewsTreat the return of a null datatable line
I’m used to developing in VB.net and am starting a new project in C#. net with VS2013. I realized that in many things there is an expressive difference in syntax and I came across a question. How I…
returnasked 9 years, 6 months ago Gilberto Otsuka 11 -
1
votes1
answer1935
viewsJSONP: status code 200 OK and still returns $.Ajax(...error:Function()...)
We’re having trouble making a request $.ajax, JSONP. The problem is that even with the positive return (Status Code:200) the function shown below always returns the error check result as positive.…
-
1
votes1
answer172
viewsFunction return type for a chained list
What kind of return to use in a chained list? For example, insert at the beginning of the list. void inserir(pessoas **pessoa, int valor) no return (void). Or return a pointer from the list.…
-
1
votes4
answers646
viewsPerform function by clicking except on specific item with jQuery
I have the following code: $(".teste").click(function() { return false; }); Inside that div .teste I have links with the class .link and I want, when clicking on the div, the return false, but that…
-
1
votes2
answers1654
viewsPhp and guzzle, how do you get to an address and pick up what you return?
I need to send data by get and pick up what to return to know if it worked or not, however, with Curl and file_get_contents not giving (seems to be the server that receives the request), so I’m…
-
1
votes2
answers763
viewsWhat is the best way to read a sql server error return?
How best to read an error return from sql server in a C# web form application? I got the following.. No sql server; END TRY BEGIN CATCH Raiserror('Erro ao gerar os dados', 18, 1); return; END CATCH;…
-
1
votes2
answers77
viewsWhat was my mistake with that code?
Hello, I’m starting to study the JS language and I stopped here, I don’t know what my mistake, someone could explain to me what I’m doing wrong? <!DOCTYPE html> <html> <head>…
-
1
votes2
answers234
viewsWhy is the recursive function return not being used?
What happens when I call a function, recursively, without assigning its return to a variable? Why there is no need, in this case, to assign the function mergeSort explicitly the variable array?…
-
1
votes1
answer566
viewsHow to get the Return of a method that depends on another within a class?
I’m using a class called Semelhantes that will have 2 methods. The features magpie 3 characteristics of the current property through the id. The resemblant rides a query which aims to bring…
-
1
votes1
answer304
viewsDictionary as input argument is being modified within the function
In the code below the dictionary used as input argument is also being modified by the function. I need to perform a deepcopy() at all times? def muda(a): a['valor'] = 50 return a dic1 = {'valor':…
-
1
votes1
answer2252
viewsCalculate with Javascript and return to html
So guys, I just need to get some HTML information and get back the result of the calculation, but I couldn’t. <html> <head> <title>Calculadora</title> <script…
-
1
votes0
answers702
viewsWhat does it mean and what is the purpose of 'Return 0'?
I recently started some studies on C/C++ and in the vast majority of the initial examples I saw, I came across return 0 at the end of the code. #include<iostream> using namespace std; int…
-
1
votes1
answer28
viewsReturns value of an array dynamically
I have an array $teste = [1,2,3,4]; <Input type="text" value ="teste[0]" /> //retorna "1" How I could bring all array values into inputs?
-
1
votes0
answers44
viewsPass vector start and end to Sort function using c++ method overload
I want to access using overload using node which is a base class object method getInicioVetor and getFimVetor within the daughter class, I wonder if there is a way to do this? I tried so only that…
-
1
votes2
answers106
viewsReturning an object. Any Smell code here?
I thought of the following public method: public RespostaDeArme armar(); The class RespostaDeArme would be so: public class RespostaDeArme { private final ResultadoDeArme resultado; private final…
-
1
votes1
answer51
viewsIs there any way to modify what the module will return in Lua?
I want to know if it exists since I have a data storage system, in which the data stays in a table and when the player enters,this data is stored in a module script (The only one that returns…
-
1
votes0
answers28
viewsFunction that returns more than one variable in c
I need to do a function that takes 3 floats and returns the average, the largest number among the 3 and the difference between the average and the largest. I tried to make the return by a pointer…
-
1
votes0
answers244
viewsDoes not access the Onresponse() retrofit android method
I’m making a call to a post method that returns an id generated through retrofit 2, however, in return, never access the method onResponse, I’ve tried to use other objects and formats, but none…
-
1
votes3
answers1181
viewsHow to access the elements of a list declared in a different class?
I have developed a code that generates a list when the following input data is informed: List size (or how many "Indexes") The values that will fill the said "Indexes". Values are collected within a…
-
1
votes1
answer58
viewsString Return
I’m trying to return a String format in a function, however error n occurs defined. func descreve(x, y int) string{ total := soma(x, y) return "%d + %d = %d", x, y, total } I don’t want to wear just…
-
1
votes2
answers58
viewsproblems with the Return function
I’m trying to make a program where the person has to write a number, but when she writes a number that doesn’t fit the requirements she has to write another. I can’t use the function return…
-
1
votes0
answers57
viewsC code only compiles once and then closes
I have a code that I am writing in C, and then a problem is constantly happening. I don’t know if it has anything to do with memory allocation. I have a function: struct elementodos…
-
1
votes2
answers17219
viewsFunction that returns vector
How to return a vector within a function? And how do I call it in main? This Return in the case: (vector Return;) #include <conio.h> #include <stdio.h> #include <stdlib.h> float UK…
-
1
votes1
answer165
viewsPointer return pointing to a local character vector?
#include <stdio.h> char *local(void); void main(void) { char *ponteiro = local(); printf("%s\n", ponteiro); /*Saida = - (*/ } char *local(void) { char nome[12] = "programador"; char *ponteiro…
-
1
votes1
answer46
viewsJavascript: Function is not returning the correct value
What could be wrong with this function? Where is the alert, is coming the correct result but is returning 0. function AprovaCotacao(numForn) { var forn_aprovado = $("#cot_fornecedor" +…
-
1
votes2
answers30
viewsWhich way is more correct not to let a function run
Well, I couldn’t find a more specific title for my question, my doubt is simple. I won’t decorate much. Come on. Which of these two are correct: Without return false; public static function…
-
1
votes1
answer69
viewsThe function returns Undefined. What’s wrong?
var pulaLinha = function() { document.write("<br>"); } var mostra = function(frase) { document.write(frase); …
-
1
votes1
answer58
viewsIs it possible, in a function, to return the reference to an array index?
The idea is to have a function that receives a array and return the reference to an index of the same, for example: $list = ['a', 'b', 'c', 'd', 'e']; function ref(&list) { return &$list[3]…
-
1
votes1
answer102
viewsHow does the return of functions in C work?
From what I’ve been seeing, every C function needs a comeback, whether I’m right or not? 1- What is the reason for this? It influences something? (I would like a logical explanation if possible). 2-…
-
1
votes1
answer106
viewsReturn Undefined
The code itself is working, as far as I’m concerned, the problem is that I’m not sure why my function is returning Undefined. It’s a simple function that’s returning what I really want, but I really…
-
1
votes2
answers1559
viewsCS0029 Error - Cannot implicitly convert "int" to "bool" as a function of C#
The code receives a user number and print if it is positive for True and if it is negative for False, only that there is a mistake of types going on and I don’t understand how to solve. using static…
-
1
votes2
answers41
viewsDoubts with this function
I have this code in javascript and want to ask some questions: HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport"…
-
1
votes2
answers173
viewsCan I use the dd() function in production?
I created a function that is called in another class to perform a task during a request in a Controller of my application. I put a return in that function to interrupt its execution in a specific…
-
1
votes1
answer80
viewsHow to pass values from one function to another?
I made the code below, in order to receive and display data, as if they were related to a tax bill. The code displays the following error when running: File "main.py", line 49, in <module>…
-
1
votes2
answers322
viewsWhy the function returns the Undefined value
I am trying to check whether an item within the array is divisible or not by another number passed as a function parameter. When an item is divisible returns that same item. If not, it returns "No…
-
1
votes1
answer35
viewsReturning multiple auto variable types in C++14
I created a class, which has 4 attributes int valInt, float valFloat, double valDouble, bool valBool, and a method called getValue() of the auto type that returns the value according to another…
-
1
votes2
answers42
viewsuseEffect returning null
I’m starting with React Native, but I’m having trouble getting a list when loading the screen using useEffect, every time you start the screen the first time, setList returns empty, and when I click…
-
0
votes1
answer89
viewsPhp equal functions return different values
I have this function: function login($username, $password) { $user_id = user_id_from_user_name($username); $username = sanitize($username); $password = md5($password); return…
-
0
votes1
answer88
viewsFetch value from a non-static method of the class itself, in a jfieldtextFocusLost method
I have a method created by me that makes the return of a Boolean: public boolean ValidaNumero() { long valor; if(NIPCC.isFocusable()){ if (NIPCC.getText().length() != 0 ) { try { valor =…
-
0
votes1
answer217
viewsHow to return a "OUT" parameter in Genexus Ev3 U1 Smartdevices?
Develop with Genexus Smart Devices Ev3 U1 for Android. I intend to develop a screen Father that by clicking a button opens the screen Son, where the user selects an item in a grid and returns to the…
-
0
votes2
answers117
viewsHow to return more than one property with JSON?
I would like to know how I return more than one property in PHP. Below is the code where I return the user name and wanted to return, in addition, his registration. I tried to do the same by adding…
-
0
votes0
answers90
viewsReturning an empty table
create function teste( teste varchar ) returns setof record AS $$ begin execute teste; return ; end; $$ language plpgsql; select teste ('select * from public.opcional '); This returning me record…
-
0
votes2
answers1947
viewsHow to use function return in Scilab or Matlab?
I’m doing a simple numerical program. But I can’t use return of functions in Scilab someone can help me? The function has to solve a calculation and then return the value for this variable to…
-
0
votes1
answer173
viewsAndroid does not interpret command " n" of a web page
I’m creating an app that it accesses a URL page, query some data, and returns the result in a Alert dialog, however in the web code, made in PHP, I need to put some " n" to format the data, and…
-
0
votes1
answer341
viewsRun the function once take the Return and use in a codeIgniter loop
Hello I’m having trouble recovering the Return from a model and using it in a loop (foreach), without the function running again several times... How can I take Return and use it several times? Code…
-
0
votes2
answers252
viewsReturn 2 values in a foreach
I would like to return two values in one foreach, can help me? For Each item In Funcao() teste1 = gostaria de pegar aqui o resultado 1 teste2 = gostaria de pegar aqui o resultado 2 Next Private…