return

flex3 function not returning String properly

hi guys, im trying to return a string value from a method inside my script tag however it always returns an object and i cant get at the string value. Here is the code: i retrieve the object returned from a webservice call;; private function getNameResults(e:ResultEvent):String{ var name:Array = new Array(e.result); var...

Coding practice: return by value or by reference in Matrix multiplication?

I'm writing this question with reference to this one which I wrote yesterday. After a little documentation, it seems clear to me that what I wanted to do (and what I believed to be possible) is nearly impossible if not impossible at all. There are several ways to implement it, and since I'm not an experienced programmer, I ask you which ...

Boolean expressions in Java

Hello, I have a question about the meaning (evaluation) of Boolean variables in return statements in Java. I know that: if (var) { ... } is the same as: if (var==true) { ... } In the second case we explicitly say var==true, but we don't need to do this, because Java evaluates var as true anyway. I hope I have understood this righ...

return eats exception

I found the following behavior at least weird: def errors(): try: ErrorErrorError finally: return 10 print errors() # prints: 10 # It should raise: NameError: name 'ErrorErrorError' is not defined The exception disappears when you use return inside a finally clause. Is that a bug? Is that documented anywhere? ...

How do you call an ASHX from JavaScript?

I want to call an ASHX file and pass some query string variables from JavaScript and get the return string into a string in the JavaScript. How would I do this? The ASHX file is already coded to response.write a string based on whatever the query strings are. ...

Flex:How to retrieve the pre edited value of the cell of a datagrid to an itemeditor in a flex

I wrote a custom item editor for a datagrid in flex. My question is how to retrieve the pre-edited value of the datagrid cell after the item editor initializes and also in the custom item editors code. ...

Use of return keyword in code block

What is the difference between saying: if (abc == "a") { // do something here... return; } and the same as above, but without the return keyword? I am a C# coder and I know that the return keyword followed by a type or variable returns that item, but in the above context, return seems to be just to exit the code block but does it mak...

Get Return Value of NSTimer's Target

I have an NSTimer which is setup like this: [NSTimer scheduledTimerWithTimeInterval:0.5 target:timerTarget selector:NSSelectorFromString(targetSelector) userInfo:nil repeats:YES]; How can I get the return value of the timerTarget method? ...

Error in returning a pointer from a function that points to an array

Greetings Everyone, I'm in a bit of a fiddle in that I dont know why my code brings up the following error when compiling: 1>..\SA.cpp(81) : error C2664: 'CFE' : cannot convert parameter 1 from 'int' to 'int []' 1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast Esse...

Running a stubborn executable in Dos Batch file...

I've got a pretty stubborn executable that I would like to execute sequentially multiple times from within a Dos batch file. (Due to IT constrains currently constrained to using Dos batch files.) I am able to use START to launch the executable, however, it seems the executable is expecting the user to hit return prior to "really" runni...

return key word in a void method in java?

Hi all. Looking a path finding tutorial here (http://www.cokeandcode.com/pathfinding) which i was linked to from SO :) good work people. Working in integrating the code into my game, and i noticed a "return;" line inside a void method. class is PathTest on website, line 130. I know im a novice at java, but can anyone tell me why its th...

How can I return multiple values from a function in C#?

I read the C++ version of this question but didn't really understand it. Can someone please explain clearly if it can be done and how? Thanks, Ash ...

Python: How to return something from a function that makes a dictionary

Hi again, I've made a function that creates a dictionary. In my previous thread/question, Andrew Jaffe writes this: "In addition to all of the other hints and tips, I think you're missing something crucial: your functions actually need to return something. When you create autoparts() or splittext(), the idea is that this will be a fun...

How to capture enter key being pressed on pages containing multiple forms?

I have inherited a web application where the usual ability to press return in any of the input fields has been disabled for the very good reason that the page contains multiple forms, and the application would not be able to determine (or, so I am told) which form to action. The application has been designed so there are no submit button...

How does one return from a groovy closure and stop its execution?

I would like to return from a closure, like one would if using a break statement in a loop. For example: largeListOfElements.each{ element-> if(element == specificElement){ // do some work return // but this will only leave this iteration and start the next } } In the above if statement I would lik...

Generic return

Hi, there is an immutable class: Scope<Cmp extends Comparable<Cmp>> public Scope<Cmp> crop(Scope<Cmp> scope) { ... return new Scope<Cmp>(starts, ends); } it has many similar methods is extended by: Timerange extends Scope<Date> and many others (also immutable). Id like them to return object of its type. For example: time...

How to execute and get content of a .php file in a variable?

I want to get contents of a .php file in a variable on other page. I have two files, myfile1.php and myfile2.php. myfile2.php <?PHP $myvar="prashant"; // echo $myvar; ?> Now I want to get the value echoed by the myfile2.php in an variable in myfile1.php, I have tried the follwing way, but its taking all the contents includ...

Why does the return keyword cause problems in my 'if block'?

The following code works fine: person = {:a=>:A, :b=>:B, :c=>:C} berson = {:a=>:A1, :b=>:B1, :c=>:C1} kerson = person.merge(berson) do | key, oldv, newv | if key == :a oldv elsif key == :b newv else key end end puts kerson.inspect but if I add the return keyword inside the "if block", I get an error: person = {:a=>:A, :b=>:B,...

paypal dynamic return address

I have a single product, a file that is dynamically created and I need a paypal to return a customer after payment is done to the address of the file. Simple Buy Now button is elegant but if I put <input type="hidden" name="return" value="http://www.mysite.com/x727x7e.dat"&gt; into a button's code, simple browser's Page - View Source ...

How do I return the last primary key of the last added item in java?

Hi all. Have a linking (or ref) table which has a dual primary key. Need to return the last primary key which was auto generated from the current connection in a selected table. This is in java. The database is in MS Access if that makes a difference. Sorry for the rushed description, but our team is working to a tight schedule. Any l...