return

Java - Returning a value from function !

How does returning a value from a function internally works ? See this example.. ...

How to return value from function? (translate actionscript to c#)

So... I want to return value when C# function is called. I need a code example (simple summ of a,b values will be ok) Please help I need something like this ( I know ActionScript so I will write in it): public function sum(valueA:int, valueB:int):int { var summ:int = valueA + valueB; return summ; } How to translate it into C#?...

Flex / Flash builder : no returning data using database

Hello, i'm following some flex tutorials everything's working as wanted expected for one thing : When i use my function getServerByBrand($brand) there is no returned data into my datagrid and i don't know why because it uses the same schema as getAllserver() which is working . I don't know whether it's cause by the function itselft ...

OCaml: Currying without defined values

I have two functions f and g and I am trying to return f(g(x)) but I do not know the value of x and I am not really sure how to go about this. A more concrete example: if I have functions f = x + 1 and g = x * 2 and I am trying to return f(g(x)) I should get a function equal to (x*2) + 1 ...

Display dynamically created php image after POSTing data

I have a php script which outputs an image, how can I POST data to it and display the resulting image without refreshing the rest of the screen, so far I have got the code below which returns a png. function go(){ $.post("test_image.php", $("frm").serialize(), function(data){ //alert(data);//proves a png image is returned. ...

See return value in C#

Hi, Consider the following piece of code: As you can see we are on line 28. Is there any way to see the return value of the function at this point, without letting the code return to the caller function? Foo.Bar() is a function call which generates a unique path (for example). So it's NOT constant. Entering ?Foo.Bar() in the immidi...

Scala return type for tuple-functions

Hello Guys, I want to make a scala function which returns a scala tuple. I can do a function like this: def foo = (1,"hello","world") and this will work fine, but now I want to tell the compiler what I expect to be returned from the function instead of using the built in type inference (after all, I have no idea what a (1,"hello","w...

PHP open_basedir - to return value?

I want to return the value of open_basedir in a php script.. how can I do it? If value is blank it should echo that is blank.. Thanks! ...

C++ function will not return

I have a function that I am calling that runs all the way up to where it should return but doesn't return. If I cout something for debugging at the very end of the function, it gets displayed but the function does not return. fetchData is the function I am referring to. It gets called by outputFile. cout displays "done here" but not "da...

Prolog returns Out = _G431 when it suppose to return a list of lists

createSchedule([[math109]], fall, Out). [[cs485, cs485], [cs355, cs355, cs462, cs462, cs462], [cs345, cs345, cs352, cs352, cs352, cs362, cs362, cs362, cs396, cs396, cs396], [cs330, cs330, cs330], [cs255, cs255, cs255, cs268, cs268], [math114, cs245, cs245], [math112, cs145, cs146], [math109]] Out = _G431 this is what prolog returns an...

Java return to position N in call stack.

Using the return keyword in Java code will return execution to the last piece of calling code in the call stack. If object foo calls baz.bar(), the return keyword in the bar method will continue code execution in foo. Let's say I have object foo that calls foofoo that calls foofoofoo in the above scenario, and foofoofoo calls baz.bar()....

Is return an operator or a function?

This is too basic I think, but how do both of these work? return true; // 1 and return (true); // 2 Similar: sizeof, exit My guess: If return was a function, 1 would be erroneous. So, return should be a unary operator that can also take in brackets... pretty much like unary minus: -5 and -(5), both are okay. ...

Return statements for all functions

How common is it for coding style guidelines to include a requirement that all functions include at least one return statement (even functions which return void)? To avoid being subjective or argumentative, I'd like answers which can name specific companies or open-source projects which have this requirement. If you haven't ever come ac...

Where to put "return false" in this code (provided)

Initially i was looking for an answer to a show/hide page jumping issue. Having found an answer here: http://stackoverflow.com/questions/2024342/link-with-href-scrolls-page-to-top-when-used-with-jquery-slidetoggle, I need to understand where to put "return false" in the following code: toggleDetail : function(obj) { $(obj).parent()....

How to specify allowed exceptions in WCF's configuration file?

Hello! I´m building a set of WCF services for internal use through all our applications. For exception handling I created a default fault class so I can return treated message to the caller if its the case or a generic one when I have no clue what happened. Fault contract: [DataContract(Name = "DefaultFault", Namespace = "http://...

Is it possible to return a list of numbers from a Sybase function?

I'm trying to overcome a very serious performance issue in which Sybase refuses to use the primary key index on a large table because one of the required fields is specified indirectly through another table - or, in other words; SELECT ... FROM BIGTABLE WHERE KFIELD = 123 runs in ms but SELECT ... FROM BIGTABLE, LTLTBL WHERE KFIELD =...

template function roundTo int, float -> truncation

Hi, according to this question: http://stackoverflow.com/questions/2833730/calling-template-function-without-type-inference the round function I will use in the future now looks like: template < typename TOut, typename TIn > TOut roundTo( TIn value ) { return static_cast<TOut>( value + 0.5 ); } double d = 1.54; int i = rountTo<...

C++ Returning Pointers/References

I have a fairly good understanding of the dereferencing operator, the address of operator, and pointers in general. I however get confused when I see stuff such as this: int* returnA() { int *j = &a; return j; } int* returnB() { return &b; } int& returnC() { return c; } int& returnC2() { int *d = &c; return *...

C# function normal return value VS out or ref argument

I've got a method in C# that needs to return a very large array (or any other large data structure for that matter). Is there a performance gain in using a ref or out parameter instead of the standard return value? I.E. is there any performance or other gain in using void function(sometype input, ref largearray) over largearray fun...

Can a constructor return a NULL value?

I know constructors don't "return" anything but for instance if I call CMyClass *object = new CMyClass() is there any way to make object to be NULL if the constructor fails? In my case I have some images that have to be loaded and if the file reading fails I'd like it to return null. Is there any way to do that? Thanks in advance. ...