Thread Subject: default value when no callback

Subject: default value when no callback

From: ching l

Date: 22 Jul, 2008 07:11:05

Message: 1 of 7

How to put a default value of the callback if it's not being
called? so that there is always a value even it's not being
used. Like this?


function answer_nochange_Callback(hObject, eventdata, handles)

handles.n= [1, 2, 0]


if handles.n <= 0
   handles.n= 99;
   
end

Subject: default value when no callback

From: David

Date: 22 Jul, 2008 10:17:01

Message: 2 of 7

"ching l" <chinglnc@hotmail.com> wrote in message <g64169
$dj3$1@fred.mathworks.com>...
> How to put a default value of the callback if it's not
being
> called? so that there is always a value even it's not
being
> used. Like this?
>
>
> function answer_nochange_Callback(hObject, eventdata,
handles)
>
> handles.n= [1, 2, 0]
>
>
> if handles.n <= 0
> handles.n= 99;
>
> end
>
>
>

if a function isn't called in the program, and no one is
around to hear it, does it make a return?

sorry, must be the low caffeine level this morning.

Subject: default value when no callback

From: ching l

Date: 22 Jul, 2008 12:32:02

Message: 3 of 7

"David " <dave@bigcompany.com> wrote in message
<g64c2t$e03$1@fred.mathworks.com>...
> "ching l" <chinglnc@hotmail.com> wrote in message <g64169
> $dj3$1@fred.mathworks.com>...
> > How to put a default value of the callback if it's not
> being
> > called? so that there is always a value even it's not
> being
> > used. Like this?
> >
> >
> > function answer_nochange_Callback(hObject, eventdata,
> handles)
> >
> > handles.n= [1, 2, 0]
> >
> >
> > if handles.n <= 0
> > handles.n= 99;
> >
> > end
> >
> >
> >
>
> if a function isn't called in the program, and no one is
> around to hear it, does it make a return?
>
> sorry, must be the low caffeine level this morning.
>
yea..i know it sounds stupid...but I really need a value
there even the function is not called..

Subject: default value when no callback

From: David

Date: 22 Jul, 2008 12:40:25

Message: 4 of 7

"ching l" <chinglnc@hotmail.com> wrote in message <g64k02
$7h4$1@fred.mathworks.com>...
> "David " <dave@bigcompany.com> wrote in message
> <g64c2t$e03$1@fred.mathworks.com>...
> > "ching l" <chinglnc@hotmail.com> wrote in message
<g64169
> > $dj3$1@fred.mathworks.com>...
> > > How to put a default value of the callback if it's
not
> > being
> > > called? so that there is always a value even it's
not
> > being
> > > used. Like this?
> > >
> > >
> > > function answer_nochange_Callback(hObject,
eventdata,
> > handles)
> > >
> > > handles.n= [1, 2, 0]
> > >
> > >
> > > if handles.n <= 0
> > > handles.n= 99;
> > >
> > > end
> > >
> > >
> > >
> >
> > if a function isn't called in the program, and no one
is
> > around to hear it, does it make a return?
> >
> > sorry, must be the low caffeine level this morning.
> >
> yea..i know it sounds stupid...but I really need a value
> there even the function is not called..

then in the function that doesn't call that function you
should set the default value.

Subject: default value when no callback

From: ching l

Date: 22 Jul, 2008 13:33:03

Message: 5 of 7

"David " <dave@bigcompany.com> wrote in message
<g64kfp$d8l$1@fred.mathworks.com>...
> "ching l" <chinglnc@hotmail.com> wrote in message <g64k02
> $7h4$1@fred.mathworks.com>...
> > "David " <dave@bigcompany.com> wrote in message
> > <g64c2t$e03$1@fred.mathworks.com>...
> > > "ching l" <chinglnc@hotmail.com> wrote in message
> <g64169
> > > $dj3$1@fred.mathworks.com>...
> > > > How to put a default value of the callback if it's
> not
> > > being
> > > > called? so that there is always a value even it's
> not
> > > being
> > > > used. Like this?
> > > >
> > > >
> > > > function answer_nochange_Callback(hObject,
> eventdata,
> > > handles)
> > > >
> > > > handles.n= [1, 2, 0]
> > > >
> > > >
> > > > if handles.n <= 0
> > > > handles.n= 99;
> > > >
> > > > end
> > > >
> > > >
> > > >
> > >
> > > if a function isn't called in the program, and no one
> is
> > > around to hear it, does it make a return?
> > >
> > > sorry, must be the low caffeine level this morning.
> > >
> > yea..i know it sounds stupid...but I really need a value
> > there even the function is not called..
>
> then in the function that doesn't call that fun
ction you
> should set the default value.

yeah..the question was how to set the default value?

(set, '0', 'default') is not right?

Subject: default value when no callback

From: David

Date: 22 Jul, 2008 13:51:03

Message: 6 of 7

"ching l" <chinglnc@hotmail.com> wrote in message
<g64nif$o5d$1@fred.mathworks.com>...
> "David " <dave@bigcompany.com> wrote in message
> <g64kfp$d8l$1@fred.mathworks.com>...
> > "ching l" <chinglnc@hotmail.com> wrote in message
<g64k02
> > $7h4$1@fred.mathworks.com>...
> > > "David " <dave@bigcompany.com> wrote in message
> > > <g64c2t$e03$1@fred.mathworks.com>...
> > > > "ching l" <chinglnc@hotmail.com> wrote in message
> > <g64169
> > > > $dj3$1@fred.mathworks.com>...
> > > > > How to put a default value of the callback if
it's
> > not
> > > > being
> > > > > called? so that there is always a value even
it's
> > not
> > > > being
> > > > > used. Like this?
> > > > >
> > > > >
> > > > > function answer_nochange_Callback(hObject,
> > eventdata,
> > > > handles)
> > > > >
> > > > > handles.n= [1, 2, 0]
> > > > >
> > > > >
> > > > > if handles.n <= 0
> > > > > handles.n= 99;
> > > > >
> > > > > end
> > > > >
> > > > >
> > > > >
> > > >
> > > > if a function isn't called in the program, and no
one
> > is
> > > > around to hear it, does it make a return?
> > > >
> > > > sorry, must be the low caffeine level this morning.
> > > >
> > > yea..i know it sounds stupid...but I really need a
value
> > > there even the function is not called..
> >
> > then in the function that doesn't call that fun
> ction you
> > should set the default value.
>
> yeah..the question was how to set the default value?
>
> (set, '0', 'default') is not right?

that depends. what value does that function set if it
isn't called? seems to me it could be anything you wanted
it to be.

Subject: default value when no callback

From: ching l

Date: 22 Jul, 2008 14:20:18

Message: 7 of 7

"ching l" <chinglnc@hotmail.com> wrote in message
<g64nif$o5d$1@fred.mathworks.com>...
> "David " <dave@bigcompany.com> wrote in message
> <g64kfp$d8l$1@fred.mathworks.com>...
> > "ching l" <chinglnc@hotmail.com> wrote in message <g64k02
> > $7h4$1@fred.mathworks.com>...
> > > "David " <dave@bigcompany.com> wrote in message
> > > <g64c2t$e03$1@fred.mathworks.com>...
> > > > "ching l" <chinglnc@hotmail.com> wrote in message
> > <g64169
> > > > $dj3$1@fred.mathworks.com>...
> > > > > How to put a default value of the callback if it's
> > not
> > > > being
> > > > > called? so that there is always a value even it's
> > not
> > > > being
> > > > > used. Like this?
> > > > >
> > > > >
> > > > > function answer_nochange_Callback(hObject,
> > eventdata,
> > > > handles)
> > > > >
> > > > > handles.n= [1, 2, 0]
> > > > >
> > > > >
> > > > > if handles.n <= 0
> > > > > handles.n= 99;
> > > > >
> > > > > end
> > > > >
> > > > >
> > > > >
> > > >
> > > > if a function isn't called in the program, and no one
> > is
> > > > around to hear it, does it make a return?
> > > >
> > > > sorry, must be the low caffeine level this morning.
> > > >
> > > yea..i know it sounds stupid...but I really need a value
> > > there even the function is not called..
> >
> > then in the function that doesn't call that fun
> ction you
> > should set the default value.
>
> yeah..the question was how to set the default value?
>
> (set, '0', 'default') is not right?

when the function is not called, I want it to have a value
of 99.

I just need to know that that particular function/callback
is not being used.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
callback ching l 22 Jul, 2008 03:15:07
rssFeed for this Thread

Contact us at files@mathworks.com