Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Browsing latest articles
Browse All 235 View Live

window.opener.returnValue in Chrome with showModalDialog

I am trying to use window.opener.returnValue with showModalDialog. There are numerous references to a technique which can be used to workaround window.returnValue not working. However it just doesn’t...

View Article


Return value in a Bash function

I am working with a bash script and I want to execute a function to print a return value:function fun1(){ return 34}function fun2(){ local res=$(fun1) echo $res}When I execute fun2, it does not print...

View Article


Why does this CodeIgniter controller method always redirect after calling the...

I'm building a log in for my website. I have this if statement:$application = 'home';$this->user_model->loggedin() == TRUE || redirect($application);$rules =...

View Article

Return value from a stored proc on error

I have an sp in SQL Server that when errors returns -4What does -4 mean? Is there a table somewhere explaining what the possible return values are?There must be some standardFor exampledeclare @RetVal...

View Article

Is there a benefit to using a return statement that returns nothing?

I'm refactoring a large javascript document that I picked up from an open source project. A number of functions use inconsistent return statements. Here's a simple example of what I mean:var func =...

View Article


What decides if a value is returned from a PowerShell function?

I'm trying to figure out what dictates if a value is returned from a PowerShell function or not, and I've run into some oddities. The about_return docs say:In PowerShell, the results of each statement...

View Article

Matlab: Abort function call with Strg+C but KEEP return value

I have a function in matlab with something like this:function [ out ] = myFunc(arg1, arg2) times = []; for i = 1:arg1 tic % do some long calculations times = [times; toc]; end % Return out = times;endI...

View Article

Why is "return by value" idiomatic in Rust (as opposed to out parameters)?

I am starting to learn Rust. In a lot of examples I have come across so far, I have noticed that functions are often implemented to return variables by value even if they are of a complex data type...

View Article


How to assign from a function which returns more than one value?

Still trying to get into the R logic... what is the "best" way to unpack (on LHS) the results from a function returning multiple values?I can't do this apparently:R> functionReturningTwoValues <-...

View Article


CodeIgniter model method not returning value to controller

I'm using the count_all_results() function to return a user's number of languages spoken. But when I try to pass the number to the view, I keep getting a php undefined variable (for $lang_cnt). Below...

View Article

Check value of system function

I want to find the return value of the mount command which is passed into the system function using the C language. How can I do this?For example:printf("return val = %d",WEXITSTATUS(system(mount...

View Article

What is the correct value of HTML 's `returnValue` per spec when the dialog...

Check this dialog box implementation.const open = document.getElementById('open')const dlg = document.getElementById('dlg')open.addEventListener('click', function () {...

View Article

What does a function return if it does not contain a `return` statement?

I've watched some videos and they said "functions always return a value". If we don't use the return statement, then what does it return instead? Like the function below:function Foo(){ var x = 4. y...

View Article


How to execute shell command in Groovy and get the return code $?

I can't get the return code (not the output or error) from executing a shell script within Groovy.For all what I tried, it either asks me to escape or just print the $? instead of give me 1 or...

View Article

If an expression in a return modifies an earlier result parameter, does the...

For example, does the Go language spec guarantee the following will print true?https://go.dev/play/p/Rybua4uBb87package mainimport "fmt"func main() {...

View Article


C# function to return array [closed]

/// <summary>/// Returns an array of all ArtworkData filtered by User ID/// </summary>/// <param name="UsersID">User ID to filter on</param>///...

View Article

I get one return value from the REPL and another from the file in Common...

When I use the REPL I get this result:* (block my-block (print "We see this") (return-from my-block 10) (print "We will never see this"))"We see this" 10* But when I load the file I get this...

View Article


How do I do anything with multiple return values in Racket?

It seems that in order to use multiple return values in Racket, I have to either use define-values or collect them into a list with (call-with-values (thunk (values-expr)) list).In the latter case, why...

View Article

How to ignore a JavaScript fetch error and return null instead?

I asked the Stack Overflow AI already: link, but I didn't found the answer helpful.My question is: I want to fetch other content with JavaScript, but return null if a 404 error occurs.Example:function...

View Article

CodeIgniter model method using recursion unexpectedly returns null [duplicate]

I have this method called treetrunk() that runs up a parent child relationship and is supposed to return an array if ids as a "branchPath" - the method seems to be working just fine as a var_dump()...

View Article

How to return a string value from a Bash function

I'd like to return a string from a Bash function.Java example:public String getSomeString() { return "tadaa";}String variable = getSomeString();This bash example works, but are there better...

View Article


How to return two tables in T-SQL using stored procedure or functions?

I have property details and I want vacant property & occupied separately in two different table as a return result. Kindly let me know is it possible to return 2 tables, as a result, using stored...

View Article


Intellij warning: Return value of the method is never used

I have some code that seems OK, but Intellij IDEA warns about many of its methods that return values thatReturn value of the method is never usedHere is the actual code below, a builder class.public...

View Article

codeigniter not fetching data from DB [duplicate]

Email or password is not fetching from db for verification. model: class Login_model extends CI_Model{ public function login_valid($email,$password) { $q = $this->db-> select('*')...

View Article

Should I return EXIT_SUCCESS or 0 from main()?

It's a simple question, but I keep seeing conflicting answers: should the main routine of a C++ program return 0 or EXIT_SUCCESS?#include <cstdlib>int main(){return EXIT_SUCCESS;}orint...

View Article


What does the return value of a `thrd_start_t` do?

In C, a thrd_start_t is a function with a signature of int (*)(void *). main returns an int as an error code to the instantiator, but in the case of a thread, we're the instantiator. I don't see any...

View Article

Cumulative return value in C?

Currently following CS50 and learning recursion in C.This program returns the number of steps taken to get from n to 1, using the Collatz conjecture. I understand most of what's going on here, except...

View Article

Python code always returns False, even if function is 'return True' [closed]

Using Spyder IDE with Python, I have a function that always returns False, even if the function is literally 'return True'I'm doing an online Python course and had to write code to see if all the...

View Article

"Invalid argument supplied for foreach()" error when iterating the data from...

I am using CodeIgniter MVC architecture to query a database and display results.The model does this:function currentfunction($id){ $query = $this->db->get_where('mytable', array("id =" =>...

View Article



When to choose between throwing exceptions or returning return codes?

This question is brought about by the below examples. I have approached a couple of people for their opinions, but still would like some more help and context from the general community.Here is an...

View Article
Browsing latest articles
Browse All 235 View Live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>