Searching My Music collection, I want to enter a fragment of the Artist Name then Get a list of all Artists that include that Fragment.
the following works but looks rather cumbersome and has duplicated code, is there a better way of coding this ?
the following works but looks rather cumbersome and has duplicated code, is there a better way of coding this ?
Code:
DIM SHARED vArtistFragment as C DIM SHARED vArtist_List as C dlg_title = "test" ui_modeless_dlg_box(dlg_title,<<%dlg% {region} Fragment:| [.40vArtistFragment!FragmentEvent_*]; {endregion}; {line=1,0}; {region} <*15OK><15Close!CLOSE> {endregion}; %dlg%,<<%code% if left(a_dlg_button,14) = "FragmentEvent_" then if a_dlg_button ="FragmentEvent_killfocus" then vFilter = quote(vArtistFragment)+" $ Artist_name" vOrder = "Artist_name" vArtist_List = table.external_record_content_GET("collection_artist_list","artist_name",vOrder,vFilter) temp_count = w_count(vArtist_List,crlf()) DELETE a_vArtist_List DIM a_vArtist_List[temp_count] as c a_vArtist_List.initialize(vArtist_List) ui_modeless_dlg_box(dlg_title,<<%dlg2% {region} Select:| [%M%.40,5vArtist_List^#a_vArtist_List]; {endregion}; {region} <*15OK><15Close!CLOSE> {endregion} %dlg2%,<<%code2% if a_dlg_button = "OK" then showvar(vArtist_List) end if if a_dlg_button = "CLOSE" then ui_modeless_dlg_close(dlg_title) end if %code2%) end if a_dlg_button = "" end if if a_dlg_button = "CLOSE" then ui_modeless_dlg_close(dlg_title) end if %code%) ​
Comment