The following code works for selecting Staff Name (fullname). I'd like to get the Staffid field to show in the final ui_msg_box, but select by Fullname.
Thanks ~ Tom
Thanks ~ Tom
Code:
'Create an XDialog dialog box to prompt for parameters. DIM GLOBAL v_staffid as C DIM GLOBAL varC_result as C auto_list_v_staffid = table.external_record_content_get("Staff","Fullname","","quitdate={}") Dim format as p Format.tab_stops="" Format.odd_row_color="White" Format.even_row_color="Blue White" Format.odd_selected_color="Dark Blue" Format.even_selected_color="Dark Blue" Format.font="Arial,8" Format.font_color_unselected="Black" Format.font_color_selected="White" Format.lastbutton="OK" Format.group_size=1 Format.number_rows=.f. Format.alternating_bands=.t. 'Apply 'owner draw' formatting information to the list auto_list_v_staffid = a5_owner_draw_list_fmt(auto_list_v_staffid,Format) temp_count = w_count(auto_list_v_staffid,crlf()) DELETE a_v_staffid DIM a_v_staffid[temp_count] as c a_v_staffid.initialize(auto_list_v_staffid) ok_button_label = "&OK" cancel_button_label = "&Cancel" varC_result = ui_dlg_box("Select Staff",<<%dlg% {region} Select Staff:| [%d;O={@@}%.40,20v_staffid^$$a_v_staffid]; {endregion}; {line=1,0}; {region} <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {endregion}; %dlg%) 'STRTRAN() replaces every occurrence of Find_String in Search_String with a Replace_String. 'Output_String as C = STRTRAN( Search_String as C, Find_String as C [[, Replace_String as C [[, Occurrence as N [[, Number as N [[, Interval as N ]]]] ) v_staffid = strtran(v_staffid,crlf()," ") 'v_Staffid = lookupc("F",strtran(v_staffid,crlf()," "),"Staffid","Staff","Fullname") ui_msg_box("Staffid",v_staffid) END
Comment