From: Beskie on
I'm writing a GUI with guide and it has 7 pop-up windows for the user
to enter information depending on the product. They only fill out one
of the seven pop-ups. Each pop-up menu has 20-25 edit boxes and I'm
using setappdata and getappdata to transfer the information back to my
main program. My question is, is there a simple way to loop through
the handles.Edit1....Edit25 and read the strings? Or am I stuck with
25 lines of

setappdata(Main_GUI, 'string1', get(handles.Edit1,'string')?

or is there better altenative method?

Thanks,
Beth
From: Nathan on
On Apr 14, 3:11 pm, Beskie <beskie...(a)yahoo.com> wrote:
> I'm writing a GUI with guide and it has 7 pop-up windows for the user
> to enter information depending on the product. They only fill out one
> of the seven pop-ups. Each pop-up menu has 20-25 edit boxes and I'm
> using setappdata and getappdata to transfer the information back to my
> main program. My question is, is there a simple way to loop through
> the handles.Edit1....Edit25 and read the strings? Or am I stuck with
> 25 lines of
>
> setappdata(Main_GUI, 'string1', get(handles.Edit1,'string')?
>
> or is there better altenative method?
>
> Thanks,
> Beth

Try something like this:
for a=1:25
setappdata(Main_GUI,sprintf('string%d',a),get(handles.(sprintf('Edit
%d',a)),'string')
end

-Nathan
From: Beskie on
That worked perfectly, thank you!