Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Callbaks, Passing by reference, setting output
Date: Fri, 14 Sep 2007 16:23:53 +0000 (UTC)
Organization: King's College London
Lines: 19
Message-ID: <fcecip$j59$1@fred.mathworks.com>
References: <fcdm6c$vk$1@fred.mathworks.com> <fcdmnr$6j9$1@fred.mathworks.com> <fce4ei$k20$1@fred.mathworks.com> <fce5sd$9k6$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1189787033 19625 172.30.248.35 (14 Sep 2007 16:23:53 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 14 Sep 2007 16:23:53 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1477
Xref: news.mathworks.com comp.soft-sys.matlab:428580



I see the problem.

By their nature, callbacks can not have left-hand side 
arguments.

You need to pass your answer back another way e.g. by 
putting it in the user data area of the text object from 
the callback:

set(hObject,'UserData',value+var2)

then use the appropriate get method in your main code. 

Then of course you need to get your code to hang up until 
the callback has done it job (see uiwait and uiresume).