User`s guide

An Address Book Reader (GUIDE)
Current_Phone = Addresses(i).Phone;
set(handles.Contact_Name,'string',C urrent_Name)
set(handles.Contact_Phone,'string', Current_Phone)
% Update the index pointer to reflect the new index
handles.Index = i;
guidata(hObject, handles)
Save Address Book Changes from the Menu
When you make changes to an address book, you need to save the current
MAT-file, or save it as a new MAT-file. The File subm enus Save and Save
As enable you to do this. These m enus, created with the Menu Editor, use
the same callback,
Save_Callback.
The callback uses the menu
Tag property to identify whether Save or Save
As is the callback object (i.e., the object whose handle is passed in as the first
argument to the callback function). You specify the menu’s
Tag property
with the Menu Editor.
Save the Addresses Structure
The h andl es structure contains the Addresses structure, which you must
save (
handles.Addresses) as well as the name of the currently loaded
MAT-file (
handles.LastFile). When the user m akes changes to the name
or number, the
Contact_Name_Callback or the Contact_Phone_Callback
updates handles.Addresses.
Save the MAT-File
If the user selects Save,thesave command is called to save the current
MAT-file with the new nam e s and phone numbers.
If the user selects Save As, a dialog box is displayed (
uiputfile) that enables
the use r to select the name of an existing MAT-file or spe cify a new file. T he
dialog box returns the selected file name and path. T he final steps include:
Using
fullfile to create a platform-independent path name.
Calling
save to save the new data in the MAT-file.
Updating the
handles structure to contain the new MAT-file name.
Calling
guidata to save the hand les structure.
10-93