Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!not-for-mail
From: dpb <none@non.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: repetitive counter (GUI)
Date: Mon, 13 Jul 2009 16:09:33 -0500
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <h3g8bd$lin$1@news.eternal-september.org>
References: <h3g5v9$6ep$1@fred.mathworks.com> <h3g6rd$58f$1@fred.mathworks.com> <h3g7ie$mr4$1@fred.mathworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.eternal-september.org U2FsdGVkX18uQ16J+uwT2mG5KHa5sos3aUhpygu6ouu/nr9hOMP4JMGNYbCZHLcaj7TRsb0JDBPw1PwAKFcrv8boha3NjLGcJ+zbxx5DT0PYBNy5KePIP0lEssreAxMyuPvgMiWdspo=
X-Complaints-To: abuse@eternal-september.org
NNTP-Posting-Date: Mon, 13 Jul 2009 21:18:38 +0000 (UTC)
In-Reply-To: <h3g7ie$mr4$1@fred.mathworks.com>
X-Auth-Sender: U2FsdGVkX1/79++T7ynSlkZ4p7pljHyJimanpUT4Gns=
Cancel-Lock: sha1:xnfgjkkI36jAucQH+YxE/1PwDfk=
User-Agent: Thunderbird 2.0.0.22 (Windows/20090605)
Xref: news.mathworks.com comp.soft-sys.matlab:555153


ching l wrote:
....
> it does increase but it didn't stop at 2. It increases till 3 and
> repeat counter=3 again.
> 
> Any idea why?
> 
...
>> "ching l" <chinglnc@hotmail.com> wrote in message
>> <h3g5v9$6ep$1@fred.mathworks.com>...
>>> handles = guidata(gcbo);
>>> if(handles.count <= 2)
>>>   handles.count= handles.count+1; handles.count
>>> else
>>>  set(hObject, 'enable', 'off') % switch off button 
>>> end
...

[Top posting repaired...please don't do that; it makes following the 
conversation much more difficult...]

 > it does increase but it didn't stop at 2. It increases till 3 and
 > repeat counter=3 again.
 >
 > Any idea why?

As it happens, yes... :)

What happens in your logic when enter the function w/ handles.count==2?

--