You have, at least, two solutions
Using local variable:
button_browse_files_select
-- Called by `select_actions' of `button_browse_files'.
local
l_selected_button: detachable STRING_32
dialog: EV_FILE_OPEN_DIALOG
const: EV_DIALOG_CONSTANTS
do
create dialog
dialog.enable_multiple_selection
dialog.show_modal_to_window (Current)
l_selected_button := dialog.selected_button
if
l_selected_button /= Void and then
l_selected_button.is_equal (create {EV_DIALOG_CONSTANTS}.ev_open)
then
file_names := dialog.file_names
set_text_field_files
end
end
Or using the object test local
button_browse_files_select
-- Called by `select_actions' of `button_browse_files'.
local
dialog: EV_FILE_OPEN_DIALOG
const: EV_DIALOG_CONSTANTS
do
create dialog
dialog.enable_multiple_selection
dialog.show_modal_to_window (Current)
if
attached dialog.selected_button as l_selected_button and then
l_selected_button.is_equal (create {EV_DIALOG_CONSTANTS}.ev_open)
then
file_names := dialog.file_names
set_text_field_files
end
end
Hope this helps,
-- Jocelyn
Chris Saunders wrote:
> I have this procedure in my code:
>
> button_browse_files_select
> -- Called by `select_actions' of `button_browse_files'.
> local
> dialog: EV_FILE_OPEN_DIALOG
> const: EV_DIALOG_CONSTANTS
> do
> create dialog
> dialog.enable_multiple_selection
> dialog.show_modal_to_window (Current)
> if dialog.selected_button.is_equal (create {EV_DIALOG_CONSTANTS}.ev_open) then
> file_names := dialog.file_names
> set_text_field_files
> end
> end
>
> Now dialog.selected_button returns a detachable STRING_32 so I get the error:
>
> 2 VUTA(2): Target of the Object_call is not attached. MAIN_WINDOW.button_browse_files_select (root_cluster) 399, 30
>
> I'm not sure how to repair this. I have tried a couple of things but, so far, have failed to fix this. Could someone assist? I'm not sure if an object test here is appropriate and if so I'm not sure what the current syntax is for one.
>
> Regards
> Chris Saunders
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
>