Quantcast
Channel: Active questions tagged return-value - Stack Overflow
Browsing latest articles
Browse All 228 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


Android Bluetooth - createBond return value

I am working on a Bluetooth application. It consists, among other things, of a list view displaying the paired and visible devices. Long clicking on the unpaired ones opens up the pairing dialog which...

View Article

How to catch the duration and return value of many python parallel sub-process

I need to write some code in python that launches 8 processes in parallel and that, for each process, is able to report their return value and their duration in microseconds.Unfortunately I don't know...

View Article

Is there a "return NULL" equivalent for return-by-reference functions?

I'm working with existing code that returns a reference, something like this:int &func(){ static int i = 5; return i;}I would like to return an error case as "NULL" but of course NULL doesn't work...

View Article


Multiple values in single-value context

Due to error handling in Go, I often end up with multiple values functions. So far, the way I have managed this has been very messy and I am looking for best practices to write cleaner code.Let's say I...

View Article

My factorial function is not returning factorial

I am not able to find out why my function returns the user input only rather then the factorial of the input.#include <stdio.h>#include <math.h>int factorial(int x){ //int x; int sum = 1;...

View Article

In php, should I return false, null, or an empty array in a method that would...

I've found several responses to this, but none pertaining to PHP (which is an extremely weak typed language):With regards to PHP, is it appropriate to return false, null, or an empty array in a method...

View Article


Image may be NSFW.
Clik here to view.

Accessing PSCustomObject Properties After Return from Function in PowerShell

I am working on a HealthCheck script that will check if a specific application is installed and verify the version number of the app, and verify id the service for that app is running. For testing...

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
Browsing latest articles
Browse All 228 View Live


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