Alpha Video Training
Results 1 to 5 of 5

Thread: Using variable in Xdialog %dlg%

  1. #1
    Member
    Real Name
    Tony Saladino
    Join Date
    Aug 2005
    Posts
    77

    Default Using variable in Xdialog %dlg%

    I'm trying to put a variable in an xdialog, and can't seem to figure out how. I have looked at the help documents, but I didn't find any topics covering it, or examples showing how to do it.

    I'm trying to get indpt_tbl.Desc to show up in the dialog. When I use ui_msg_box, it works fine.

    Here's what I've tried so far:

    Code:
    				update_stock_result =ui_dlg_box("Info", <<%dlg%
    				"Update inventory by pulling '"  + indpt_tbl.Desc + "' from stock?";
    				{lf};
    				<Yes!ind_yes>
    				<No!ind_no>
    				{initial_focus}
    				<*Yes To All!ind_yes_all>
    				<No To All!ind_no_all>
    				%dlg%,<<%code%
    				SELECT'Set up dialog info for updating stock.
    					CASE a_dlg_button = "ind_yes"
    						stock_YES_Button = .t.
    					CASE a_dlg_button = "ind_no"
    						stock_NO_Button = .t.
    					CASE a_dlg_button = "ind_yes_all"
    						stock_All_Button = .t.
    					CASE a_dlg_button = "ind_no_all"
    						stock_None_Button = .t.
    				END SELECT
    				%code%)
    This code results in the "+ indpt_tbl.Desc +" showing up in the message instead of the character string that should be there.

    Then I tried:

    Code:
                                   dlg_body = "Update inventory by pulling '" + indpt_tbl.Desc + "' from stock?"
    				update_stock_result =ui_dlg_box("Info", <<%dlg%
    				dlg_body;
    				{lf};
    				<Yes!ind_yes>
    				<No!ind_no>
    				{initial_focus}
    				<*Yes To All!ind_yes_all>
    				<No To All!ind_no_all>
    				%dlg%,<<%code%
    				SELECT'Set up dialog info for updating stock.
    					CASE a_dlg_button = "ind_yes"
    						stock_YES_Button = .t.
    					CASE a_dlg_button = "ind_no"
    						stock_NO_Button = .t.
    					CASE a_dlg_button = "ind_yes_all"
    						stock_All_Button = .t.
    					CASE a_dlg_button = "ind_no_all"
    						stock_None_Button = .t.
    				END SELECT
    				%code%)
    This results in "dlg_body" being shown instead of any portion of the string.

    I'd just do it with ui_msg_box, but I need the for buttons. I'm sure this is pretty simple, but it's just kicking my butt today.

    Thanks for the help.

    Tony

  2. #2
    "Certified" Alphaholic
    Real Name
    Charlie Crimmel
    Join Date
    Apr 2000
    Location
    West Virginia
    Posts
    1,695

    Default

    Tony
    do you have an extra ' after pulling??

    Charlie Crimmel


    "Update inventory by pulling '" + indpt_tbl.Des

  3. #3
    Member
    Real Name
    Tony Saladino
    Join Date
    Aug 2005
    Posts
    77

    Default

    Hi Charlie,

    There is one single quote between "pulling" and the double quote. There is one single quite between the next double quote and "from".

    Just like this:

    "Update inventory by pulling '" + indpt_tbl.Desc + "' from stock?"

    <double quote>Update inventory by pulling <single quote><double quote> + indpt_tbl.Desc + <double quote><single quote> from stock?<double quote>

    Tony

  4. #4
    "Certified" Alphaholic
    Real Name
    Peter Wayne
    Join Date
    Apr 2000
    Posts
    1,728

    Default

    Try this:

    Code:
    txt="Update inventory by pulling '"  + indpt_tbl.Desc + "' from stock?"
    update_stock_result =ui_dlg_box("Info", <<%dlg%
    	{text=80,1txt};
    	{lf};
    	<Yes!ind_yes>
    	<No!ind_no>
    	{initial_focus}
    	<*Yes To All!ind_yes_all>
    	<No To All!ind_no_all>
    	%dlg%,<<%code%
    		SELECT'Set up dialog info for updating stock.
    			CASE a_dlg_button = "ind_yes"
    			        stock_YES_Button = .t.
    			CASE a_dlg_button = "ind_no"
    				stock_NO_Button = .t.
    			CASE a_dlg_button = "ind_yes_all"
    				stock_All_Button = .t.
    			CASE a_dlg_button = "ind_no_all"
    				stock_None_Button = .t.
    		END SELECT
    	%code%)

  5. #5
    Member
    Real Name
    Tony Saladino
    Join Date
    Aug 2005
    Posts
    77

    Default

    Thank you Peter.

Similar Threads

  1. Use variable in Xdialog?
    By Bill Warner in forum Alpha Five Version 5
    Replies: 3
    Last Post: 11-04-2014, 07:17 PM
  2. Delete_record() confirm dlg
    By Scott Emerick in forum Alpha Five Version 6
    Replies: 5
    Last Post: 05-05-2005, 08:12 AM
  3. Use variable in Xdialog?
    By Bill Warner in forum Alpha Five Version 6
    Replies: 6
    Last Post: 12-04-2004, 02:08 PM
  4. What control has focus in dlg
    By Bill Parker in forum Alpha Five Version 5
    Replies: 5
    Last Post: 06-17-2004, 10:48 PM
  5. Xdialog results to a variable
    By crimmelcp in forum Alpha Five Version 5
    Replies: 1
    Last Post: 05-22-2004, 08:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •