Hi... I'm creating a project with different windows linked by PushButtons... In one of them, I set a login... When I run the login window, it runs perfectly, but when I start from the first, I have an error:
??? Attempt to reference field of non-structure array.
Error in ==> Login_Page_IT>ET_LOG_IT_Callback at 81
username=(get(handles.ET_LOG_IT, 'String'));
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> Login_Page_IT at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)Login_Page_IT('ET_LOG_IT_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
I post you the code...
function ET_Log_EN_Callback(hObject, eventdata, handles)
username = get(handles.ET_Log_EN, 'String');
checkuseren(username);
checkuseren function code is:
function checkuseren(username)
if length(username) ~= 7
e_msg=msgbox('Personal Code needs 7 characters!', 'ERROR: PERSONAL CODE', 'error');
end
[USER PWD CF NAME SURNAME]=textread('Login.txt', '%s %s %s %s %s', 'headerlines', 1, 'delimiter', '\t');
flag=find(ismember(USER,username));
if flag
else
e2_msg=msgbox('ACCESS DENIED! Personal Code is not in the DB or is uncorrect!', 'ERROR: PERSONAL CODE', 'error');
end
I can't understand WHY the window runs if I load it, but it doesn't if I start my program by the first window...
EDIT: THE ERROR IS ABOUT
username = get(handles.ET_Log_EN, 'String');
I checked syntax and all names I gave, I wrote it correctly...