Alpha Video Training
Results 1 to 12 of 12

Thread: XDialog

  1. #1
    Member tom@astrolabcix.co.uk's Avatar
    Real Name
    Tom Chambers
    Join Date
    Apr 2005
    Location
    Nr Bishops Stortford in England
    Posts
    80

    Default XDialog

    Hi

    Is there a limit on the length of the string in a XDialog code?

    I want to show a list of info but I get a blank box - However removing the last two fields from the list and it displays perfectly. I know the code removed works, as I've permed the fields removed.

    Anyone know?

    I can post the code if necessary?

    Tom
    Last edited by AaronBBrown; 10-19-2006 at 12:00 PM.

  2. #2
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: XDialog

    length of the string
    What are you refering to?
    Text box? List box?............?

  3. #3
    Member tom@astrolabcix.co.uk's Avatar
    Real Name
    Tom Chambers
    Join Date
    Apr 2005
    Location
    Nr Bishops Stortford in England
    Posts
    80

    Default Re: XDialog

    Quote Originally Posted by G Gabriel View Post
    What are you refering to?
    Text box? List box?............?
    OK - here is the code snippet that's causing me problems

    Code:
    FUNCTION Quotes_get AS C (ftbl AS P, fadd_no AS C )
    	varC_result = ""
    'Create an XDialog dialog box to prompt for parameters.
    	ok_button_label = "&OK"
    	cancel_button_label = "&Cancel"
    	DIM vdlg_rl_def as C 
    '	vdlg_rl_def = "kl=quotes,{keylist_build(\"H=.025,1:18[Date],2:20[Total],3:8[No],4:30[For],5:15[At]\",''+Quote_key,left(''+Dateadded,18),left(''+str(Quote_price*quote_no,11,2,\"$\"),20),left(''+Quote_no,8),left(''+lookupc(\"F\",Quote_for,\"Detail\",\"products\",\"Prod_no\"),30),left(''+str(Quote_price,9,2,\"$\"),15))}{Add_No=\""+fadd_no +"\"}"
    'vdlg_rl_def = "kl=quotes,{keylist_build(\"H=.025,1:18[Date],2:20[Total],3:30[For],4:8[No],5:15[At]\",''+Quote_key,left(''+Dateadded,18),left(''+str(1.175*Quote_price*quote_no,11,2,\"$\"),20),left(''+lookupc(\"F\",Quote_for,\"Detail\",\"products\",\"Prod_no\"),30),left(''+Quote_no,8),left(''+Quote_Price,15))}{Add_No=\""+fadd_no +"\"}"
    'vdlg_rl_def = "kl=quotes,{keylist_build(\"H=.025,1:18[Date],2:20[Total],3:30[For],4:8[No],5:15[At]\",''+Quote_key,left(''+Dateadded,18),left(''+str(1.175*Quote_price*quote_no,11,2,\"$\"),20),left(''+lookupc(\"F\",Quote_for,\"Detail\",\"products\",\"Prod_no\"),30),left(''+Quote_no,8))}{Add_No=\""+fadd_no +"\"}"
    'vdlg_rl_def = "kl=quotes,{keylist_build(\"H=.025,1:15[Date],2:20[Total],3:30[For],4:10[No],5:15[At]\",' '+Quote_key,left(' '+Dateadded,15) ,left(' '+str(Quote_price*quote_no,11,2,\"$\"),20),left(' '+lookupc(\"F\",Quote_for,\"Detail\",\"products\",\"Prod_no\"),30),left(' '+Quote_no,10),left(' '+Quote_price,15))}{Add_No=\""+fadd_no +"\"}"
    vdlg_rl_def = "kl=quotes,{keylist_build(\"H=.025,1:0,2:18[Date],3:20[Total],4:30[For]\",Quote_key,Quote_Key,left(''+Dateadded,18),left(''+str(1.175*Quote_price*quote_no,11,2,\"$\"),20),left(''+lookupc(\"F\",Quote_for,\"Detail\",\"products\",\"Prod_no\"),30))}{Add_No=\""+fadd_no +"\"}"
    'vdlg_rl_def = "kl=quotes,{keylist_build(\"H=.025,1:0,2:18[Date],3:20[Total],4:30[For],5:8[No]\",Quote_key,Quote_Key,left(''+Dateadded,18),left(''+str(1.175*Quote_price*quote_no,11,2,\"$\"),20),left(''+lookupc(\"F\",Quote_for,\"Detail\",\"products\",\"Prod_no\"),30),left(''+Quote_no))}{Add_No=\""+fadd_no +"\"}"
    
    
    if A5_IS_TRACE_WINDOW_OPEN() then 
    	dim vtrace_module as P
    	dim vtrace_exe as P
    	dim vtrace_name as C
    	vtrace_module = type::xbasicmodule.get_current()
    	vtrace_exe = vtrace_module.executable()
    	vtrace_name = vtrace_exe.name()
    	trace.writeln(vtrace_name) 
    	trace.writeln(vdlg_rl_def)
    	xbasic_trace_start("Trace")
    end if
    	varC_result = ui_dlg_box("Quotes",<<%dlg%
    	Orders for Client;
    	{lf};
    	Select Order:[%@vdlg_rl_def%.100,6vdlg];
    	{region}
    
    	{endregion};
    	{line=1,0};
    	{region}
    	<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> <15Add New Order!Add> <15Delete!Delete>
    	{endregion};
    	%dlg%,<<%code%
    
    	if a_dlg_button="OK" .or. a_dlg_button="CANCEL" .or. a_dlg_button="Add"  .or. a_dlg_button="Delete" then
    
    if A5_IS_TRACE_WINDOW_OPEN() then 
    	dim vtrace_module as P
    	dim vtrace_exe as P
    	dim vtrace_name as C
    	vtrace_module = type::xbasicmodule.get_current()
    	vtrace_exe = vtrace_module.executable()
    	vtrace_name = vtrace_exe.name()
    	trace.writeln(vtrace_name) 
    	
    	trace.writeln(a_dlg_button)
        xbasic_trace_end()
    end if	 		
    	 	select 
    	 		case a_dlg_button="CANCEL"
    	 		case a_dlg_button="OK"
    				ftbl.fetch_loc_next(vdlg,"Quote_key")
    	 		
    	 	    case a_dlg_button="Add"
    			    ftbl.enter_begin()
    		    	    ftbl.add_no=fadd_no
    		    	    ftbl.dateadded=date()
    			    ftbl.enter_end(.t.)	    
    	 	    case a_dlg_button="Delete" 
    			ftbl.fetch_loc_next(vdlg,"Quote_key")
    			ftbl.change_begin()
    			ftbl.delete()
    			ftbl.change_end(.T.)
    			a_dlg_button=""
    		end select
    	else
    		a_dlg_button=""
    
    	end if	
    
    	%code%)
    	
    	
    	
    END FUNCTION
    vdlg_rl_def not commented out works but the others do not!!

    Any ideas

    Tom

  4. #4
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: XDialog

    Tom:
    It seems that you are using the same variable name for all keylists!

  5. #5
    Member tom@astrolabcix.co.uk's Avatar
    Real Name
    Tom Chambers
    Join Date
    Apr 2005
    Location
    Nr Bishops Stortford in England
    Posts
    80

    Default Re: XDialog

    Yep - They are all variations on a theme - Look at the no of fields in the list

    vdlg_rl_def="kl=quotes,{keylist_build(\"H=.025,1:0,2:18[Date],3:20[Total],4:30[For]\",Quote_key,Quote_Key,left(''+Dateadded,18),left(''+str(1.175*Quote_price*quote_no,11,2,\"$\"),20),left(''+lookupc(\"F\",Quote_for,\"Detail\",\"products\",\"Prod_no\"),30))}{Add_No=\""+fadd_no+"\"}"

    This definition line works - the one below (commented out in code snippet) does not.

    vdlg_rl_def="kl=quotes,{keylist_build(\"H=.025,1:0,2:18[Date],3:20[Total],4:30[For],5:8[No]\",Quote_key,Quote_Key,left(''+Dateadded,18),left(''+str(1.175*Quote_price*quote_no,11,2,\"$\"),20),left(''+lookupc(\"F\",Quote_for,\"Detail\",\"products\",\"Prod_no\"),30),left(''+Quote_no))}{Add_No=\""+fadd_no+"\"}"

    Basically they are identical except the second one has a fifth field (No) !

    If I remove the field definitiIt will work if I remove the
    Code:
    ,left(''+Quote_no)
    from it, which suggest that I've exceeded some limit but what??

    Tom
    Last edited by tom@astrolabcix.co.uk; 10-19-2006 at 05:13 PM.

  6. #6
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: XDialog

    That explains it..
    You dim'd a variable
    you assigned it a value
    and in the next line
    You assigned a new value
    In the end, you will only see the last value assigned, kin to:

    dim a as c
    a=A
    a=B
    a=C
    ?a
    ="C"

    If you wish to see all keylists, you need to assign a separate variable for each.

  7. #7
    Member tom@astrolabcix.co.uk's Avatar
    Real Name
    Tom Chambers
    Join Date
    Apr 2005
    Location
    Nr Bishops Stortford in England
    Posts
    80

    Default Re: XDialog

    Quote Originally Posted by G Gabriel View Post
    That explains it..
    You dim'd a variable
    you assigned it a value
    and in the next line
    You assigned a new value
    In the end, you will only see the last value assigned, kin to:

    dim a as c
    a=A
    a=B
    a=C
    ?a
    ="C"

    If you wish to see all keylists, you need to assign a separate variable for each.
    Yes I know that - all to do with stack pointers - but that's not the query. If you look at the right hand end of my previous message you'll see that the lower code line is slightly longer than the one above as it includes a 5th field. It does not work despite the syntax being correct (as far as I can see)

    Tom

  8. #8
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: XDialog

    Tom:
    It does not matter how different it is, what matters is the fact that you used the same variable:

    DIM vdlg_rl_def as C
    vdlg_rl_def=...something...
    vdlg_rl_def=....something else... 'now vdlg_rl_def =...something else..instead of the original value.
    vdlg_rl_def=....something else & bigger... 'now vdlg_rl_def =...something else& Bigger... instead of "...something else... "


    The sky is blue
    The sky is yellow
    The sky is red

    What color is the sky?
    answer: Red. The last assigned value.

  9. #9
    Member tom@astrolabcix.co.uk's Avatar
    Real Name
    Tom Chambers
    Join Date
    Apr 2005
    Location
    Nr Bishops Stortford in England
    Posts
    80

    Default Re: XDialog

    Quote Originally Posted by G Gabriel View Post
    Tom:
    It does not matter how different it is, what matters is the fact that you used the same variable:

    DIM vdlg_rl_def as C
    vdlg_rl_def=...something...
    vdlg_rl_def=....something else... 'now vdlg_rl_def =...something else..instead of the original value.
    vdlg_rl_def=....something else & bigger... 'now vdlg_rl_def =...something else& Bigger... instead of "...something else... "


    The sky is blue
    The sky is yellow
    The sky is red

    What color is the sky?
    answer: Red. The last assigned value.
    We're talking at cross purposes here. The dialogue uses the variable vdlg_rl_def in a list box (further down the original code snippet. The point I was making (badly obviously) is that when it is set up in
    Code:
    vdlg_rl_def="kl=quotes,{keylist_build(\"H=.025,1:0,2:18[Date],3:20[Total],4:30[For]\",Quote_key,Quote_Key,left(''+Dateadded,18),left(''+str(1.175*Quote_price*quote_no,11,2,\"$\"),20),left(''+lookupc(\"F\",Quote_for,\"Detail\",\"products\",\"Prod_no\"),30))}{Add_No=\""+fadd_no+"\"}"
    It works filling the list with the appropriate data. However if I add the fifth field by setting the variable as in

    Code:
    vdlg_rl_def="kl=quotes,{keylist_build(\"H=.025,1:0,2:18[Date],3:20[Total],4:30[For],5:8[No]\",Quote_key,Quote_Key,left(''+Dateadded,18),left(''+str(1.175*Quote_price*quote_no,11,2,\"$\"),20),left(''+lookupc(\"F\",Quote_for,\"Detail\",\"products\",\"Prod_no\"),30),left(''+Quote_no))}{Add_No=\""+fadd_no+"\"}"
    It doesn't work!!

    As the second line is longer I wondered if there is a character limit?

    Tom

  10. #10
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: XDialog

    Ok. I am just looking at the code you provided.
    So, the issue then with the filter/order used. It would be hard to parse this filter without seeing the table itself. You might want to send zip file.

  11. #11
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default Re: XDialog

    I think you missed his single quotes that comment out the lines in his original script.

    A="A"
    A="B"
    A="C"
    ?a
    = "C"

    A="A"
    'A="B"
    'A="C"
    ?A
    = "A"

    Other than that, I can't see what's wrong. However, I rarely use key lists due to other issues so I'm certainly not the expert in this area.
    Last edited by CALocklin; 10-22-2006 at 09:46 PM.

  12. #12
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: XDialog

    Cal:
    I did see the single quote, but when someone says:
    here is the code snippet that's causing me problems
    and:
    vdlg_rl_def not commented out works but the others do not!!
    With my inability to read minds, I took that to mean, this is the code and the part that does not work was commented it out!

    Miscomunication!

Similar Threads

  1. Calling a Modeless XDialog within a Modal XDialog
    By KeithW in forum Alpha Five Version 7
    Replies: 8
    Last Post: 07-16-2006, 11:18 PM
  2. Xdialog help
    By masteralone in forum Alpha Five Version 7
    Replies: 6
    Last Post: 07-11-2006, 10:37 PM
  3. Help with XDialog
    By brett s in forum Alpha Five Version 5
    Replies: 14
    Last Post: 12-21-2004, 01:30 PM
  4. Xdialog
    By Ray in forum Alpha Five Version 5
    Replies: 4
    Last Post: 02-21-2004, 02:50 PM
  5. xdialog
    By BRIAN GRAY in forum Alpha Five Version 5
    Replies: 2
    Last Post: 06-29-2003, 10:14 AM

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
  •