Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!f1g2000cwa.googlegroups.com!not-for-mail
From: "NZTideMan" <mulgor@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to do GOTO in Matlab
Date: 15 Dec 2006 11:50:08 -0800
Organization: http://groups.google.com
Lines: 25
Message-ID: <1166212208.246015.308430@f1g2000cwa.googlegroups.com>
References: <1165778984.266098.310630@73g2000cwn.googlegroups.com>
NNTP-Posting-Host: 202.78.152.105
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1166212214 940 127.0.0.1 (15 Dec 2006 19:50:14 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 15 Dec 2006 19:50:14 +0000 (UTC)
In-Reply-To: <elut9f$r1h$1@fred.mathworks.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: f1g2000cwa.googlegroups.com; posting-host=202.78.152.105;
Xref: news.mathworks.com comp.soft-sys.matlab:384043



Could I suggest a minor improvement to Steven's excellent dialog:

function yn = areyousure2
yn = [];
count=0;
while isempty(yn)
    ButtonName = questdlg('Are you sure?', 'Confirmation dialog', ...
        'Yes', 'No', 'Maybe', 'Yes');
    switch ButtonName
        case 'Yes'
            yn = true;
        case 'No'
            yn = false;
        case 'Maybe'
            Count=Count + 1;
             if Count < 3
                       disp('Please decide if you are sure or if you
are not.');
              else
                      disp('Stop dithering and decide one way or the
other');
             endif
    end 
end