Hi,
How do you get the Array Index with formatted list?
How do you get the Array Index with formatted list?
Code:
dim vColorList as c ="" vColorList=<<%list% blue red green yellow pink %list% 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,10" 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 dim vColorListFmt as c ="" vColorListFmt = a5_owner_draw_list_fmt(vColorList,Format) 'showvar(vColorListFmt) '{F=Arial,10}{C=Black,White}{B=White,Dark Blue}blue '{F=Arial,10}{C=Black,White}{B=Blue White,Dark Blue}red '{F=Arial,10}{C=Black,White}{B=White,Dark Blue}green '{F=Arial,10}{C=Black,White}{B=Blue White,Dark Blue}yellow '{F=Arial,10}{C=Black,White}{B=White,Dark Blue}pink dim colors[5] as C colors.initialize(vColorListFmt) 'colors.initialize(vColorList) ok_button_label = "&OK" cancel_button_label = "&Cancel" varC_result = ui_dlg_box("Array list",<<%dlg% {region} List:| [%O={@@}%.80,15vSelected^#colors]; {endregion}; {line=1,0}; {region} <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {endregion}; %dlg%,<<%code% If a_dlg_button ="OK" then 'find the array_number [B][SIZE=3]vFindIndx = colors.find(vSelected) [/SIZE][/B] 'without format ok ui_msg_box("test",vfindIndx) a_dlg_button ="" end if %code%)
Comment