Mercurial > hg > aimmat
annotate aim-mat/tools/@parameter/getuserdata.m @ 4:537f939baef0 tip
various bug fixes and changed copyright message
author | Stefan Bleeck <bleeck@gmail.com> |
---|---|
date | Tue, 16 Aug 2011 14:37:17 +0100 |
parents | 20ada0af3d7d |
children |
rev | line source |
---|---|
tomwalters@0 | 1 % method of class @parameter |
tomwalters@0 | 2 % |
bleeck@3 | 3 % (c) 2011, University of Southampton |
bleeck@3 | 4 % Maintained by Stefan Bleeck (bleeck@gmail.com) |
bleeck@3 | 5 % download of current version is on the soundsoftware site: |
bleeck@3 | 6 % http://code.soundsoftware.ac.uk/projects/aimmat |
bleeck@3 | 7 % documentation and everything is on http://www.acousticscale.org |
tomwalters@0 | 8 function data=getuserdata(param,text,inbox) |
tomwalters@0 | 9 % the whole struct can have an user entry and every part of the structure |
tomwalters@0 | 10 % as well. These can be used by the user for example for the 'other...' |
tomwalters@0 | 11 % radiobutton |
tomwalters@0 | 12 |
tomwalters@0 | 13 if nargin <2 |
tomwalters@0 | 14 data=param.userdata; |
tomwalters@0 | 15 else |
tomwalters@0 | 16 nr=getentrynumberbytext(param,text,inbox); |
tomwalters@0 | 17 if nr>0 |
tomwalters@0 | 18 % cont=param.entries; |
tomwalters@0 | 19 % nrent=length(cont); |
tomwalters@0 | 20 % for i=1:nrent |
tomwalters@0 | 21 % if strcmp(cont{i}.text,text) && strcmp(cont{i}.belongtobox,inbox) |
tomwalters@0 | 22 if isfield(data.cont{nr},'userdata') |
tomwalters@0 | 23 data=cont{nr}.userdata; |
tomwalters@0 | 24 else |
tomwalters@0 | 25 data=[]; |
tomwalters@0 | 26 end |
tomwalters@0 | 27 return |
tomwalters@0 | 28 else |
tomwalters@0 | 29 data='error'; |
tomwalters@0 | 30 disp('error in getuserdata: text not found'); |
tomwalters@0 | 31 end |
tomwalters@0 | 32 end |
tomwalters@0 | 33 |