import script value in different script with new results (diceroller)
I'm learning to write python to create scripts to automate stuff for DD.And I'm positive that there most likely is a built in solution for this.I have certain functions from external scripts that I...
View ArticleRuby quirk: Using 'return' to get a nil value
I am doing a problem at Rubymonk where I have to test if an array is 'nil' before doing an operation (adding items inside a nested array but that is not really relevant to the question). I notice,...
View ArticleReturn type for *this in a builder-class method - lvalue vs rvalue refence
Suppose I have a "builder" class B which builds a class C, and looks somewhat like the following:class B {public: // ... B& set_foo(Foo a_foo) { foo_ = std::move(a_foo); return *this; } C build()...
View ArticleHow is the return value of a method ignored in Java? [closed]
I'm trying to understand how the return value of the HashSet.add() method is handled in Java when it's not used in a condition or assigned to a variable. Here's an example of what I...
View ArticleWhat should main() return in C and C++?
What is the correct (most efficient) way to define the main() function in C and C++—int main() or void main()— and why? And how about the arguments?If int main() then return 1 or return 0?
View ArticleWhat's does a bash function return when there is no “return” statement?
Is the return value of a bash function the status of the last executed command?I wrote this test and it looks like it's so. I just want to verify. No one has asked this question before apparently and...
View ArticleAre two dictionary lookups triggered when assigning and returning a...
Consider this C# example:public sealed class TestClass { private Dictionary<string,int> myDictionary = []; public int TestMethod() => myDictionary["foo"] = 3;}Internally, when TestMethod() is...
View ArticleCreating a custom filter [duplicate]
I am wanting some help with inputting a value into a filter line. The variable in the raw dataset changes it's name each year to the corresponding year and I don't want to replace it in all the code...
View ArticleReturn multiple values from a function, sub or type?
So I was wondering, how can I return multiple values from a function, sub or type in VBA?I've got this main sub which is supposed to collect data from several functions, but a function can only return...
View ArticleHow to call a function and return data from a function to the global scope?
I created an HTML form that, on submit, opens submit_form.php. Inside, I process the data entered into the form and send a confirmation email. I wrote a function for the mail-sending-process.Inside the...
View ArticlePlatform dependent implementations with return values do not work in MAUI
I have problems to implement any platform dependent classes in a MAUI project. The compiler produces errors if I use a method which has a return value.I implemented the function first for each platform...
View ArticleReturn a QString from a function - thread safe?
I'm new to Qt - but this may be a very basic c++ issue. I have a simple function that returns a QString:QString testclass::myfunc(int i){ QString result; switch (i) { case 1: result = "one"; break;...
View ArticleBest practice: ref parameter or return value?
Actually I am doing a list as a reference parameter as follows:public static List ListMethod(List result)I saw some people doing in this way too:public static void ListMethod(ref List result)If I'm not...
View ArticleReturn multiple values from a C# asynchronous method
I have worked with asynchronous methods and the methods which return multiple values, separately. In this specific situation, following "GetTaskTypeAndId()" method should be asynchronous and should...
View ArticleShould accessors return values or constant references?
Suppose I have a class Foo with a std::string member str. What should get_str return?std::string Foo::get_str() const{ return str;}orconst std::string& Foo::get_str() const{ return str;}What is...
View ArticleEstimate standard errors for return periods [closed]
In Coles book describes how to estimate the standard errors of the return periods based on the delta method. He does not have the fill formula though. Are there any packages that do that automatically?...
View ArticleReturn 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 ArticleWhat does it mean to return a value?
I'm fairly new to programming, and I'm confused about what it means exactly to return a value. At first, I thought it meant to output what value is being returned, but when I tried that in my own code,...
View ArticleHow to enforce the use of a method's return value in C#?
I have a piece of software written with fluent syntax. The method chain has a definitive "ending", before which nothing useful is actually done in the code (think NBuilder, or Linq-to-SQL's query...
View ArticleAndroid 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