Alpha Video Training
Page 1 of 2 12 LastLast
Results 1 to 30 of 42

Thread: How do you open Sub- UDF from parent UDF

  1. #1
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default How do you open Sub- UDF from parent UDF

    Hi All,

    I have the parent(Main) UDF which
    Code:
     
    Function Get_Quantity as n (prdctId as c, vQty as n)
           'Some of action for open tables and get the information.
           '
           ' I have the conditions to calculate here
           If vTypeofMaterial ="abc" then
                   variable_A = Calculate as 123.....
                   
           else  
                 variable_A = Open_sessame    'Call the 2nd UDF which get the Calculated Value
                 'I have the trouble here. it opens the 2nd UDF but does not stop.
      
                 'I inserted the Ui_msg_box() here for test, This Msg_box opens all the time. It did not stop until terminating A5.
                  
           end If
           'Write the Result
                  Get_Quantity =  variable_a+(variable_A * vWaste/100)
    End Function
    Why did the 2nd condition not work?

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,313

    Default Re: How do you open Sub- UDF from parent UDF

    Code not shown.

  3. #3
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: How do you open Sub- UDF from parent UDF

    Open_sessame() is the name of a udf as well?

    variable_A = Open_sessame()

  4. #4
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: How do you open Sub- UDF from parent UDF

    Tom and Stan

    When you read more than one tables in the scripts, do you recommend to close the table right after procedure which case A or Case B, closing the end of scripts.

    Case A
    Code:
     
            tPrd = table.open("prdcts",FILE_RO_SHARED)
    	query.order=""
    	query.filter="alltrim(prod_id) ="+quote(vPrdId)
    	qPrd = tPrd.query_create()
    	rPrd = qPrd.records_get()
    	if rPrd>0 then
    		vGrpId = alltrim(tPrd.Group_id)
                    vSeriesId = alltrim(tPrd.Series_id)
    	end if	
    	qPrd.drop()
    	tPrd.close()
    
            tSer = table.open("series",FILE_RO_SHARED)
    	query.order=""
    	query.filter="series_id="+quote(vSeriesId)
    	qSer = tSer.query_create()
    		vMtrType = alltrim(tSer.Mtr_type)
    	qSer.drop()
    	tSer.close()
    Case B
    Code:
     
            tPrd = table.open("prdcts",FILE_RO_SHARED)
    	query.order=""
    	query.filter="alltrim(prod_id) ="+quote(vPrdId)
    	qPrd = tPrd.query_create()
    	rPrd = qPrd.records_get()
    	if rPrd>0 then
    		vGrpId = alltrim(tPrd.Group_id)
                    vSeriesId = alltrim(tPrd.Series_id)
                       
                        'Read 2nd table
                       tSer = table.open("series",FILE_RO_SHARED)
    	           query.order=""
    	           query.filter="series_id="+quote(vSeriesId)
    	           qSer = tSer.query_create()
                       rSer = tSer.Records_get()
                       if rSer > 0 then
    		         vMtrType = alltrim(tSer.Mtr_type)
    	           else
                             'Shown the message by  UI_msg_box()
                       end if
                       qSer.drop()
    	           tSer.close()
    	end if	
    	qPrd.drop()
    	tPrd.close()

    My UDF Scripts and not shown the 2nd UDF.
    I used this UDF at Calculation Value, " xPoqty = Est_PoQty_calc (prdId, qty, uom) "

    Code:
     
    'void all of the DIMs and variable name
     
    FUNCTION Est_Poqty_calc AS N (vPrdId AS C,vEstQty as n,vEstUom as c)
            tPrd = table.open("prdcts",FILE_RO_SHARED)
    	query.order=""
    	query.filter="alltrim(prod_id) ="+quote(vPrdId)
    	qPrd = tPrd.query_create()
    	rPrd = qPrd.records_get()
    	if rPrd>0 then
    		vGrpId = alltrim(tPrd.Group_id)
                    vSeriesId = alltrim(tPrd.Series_id)
    	end if	
    	qPrd.drop()
    	tPrd.close()
    
            tSer = table.open("series",FILE_RO_SHARED)
    	query.order=""
    	query.filter="series_id="+quote(vSeriesId)
    	qSer = tSer.query_create()
    		vMtrType = alltrim(tSer.Mtr_type)
    	qSer.drop()
    	tSer.close()
       
            'Condition 
                   If vMtrType ="Dir" then
                        vConvQty = vEstQty
                        'Some other calcuation here
                   else
                        vConvQty = Est_Indirect_poqty (** Tried put the variable too here) 
                   end if
            
     'Result and want to shown of the Form
                 Est_Poqty_calc = vConvQty + (vConvQty * vWaste/100)
    
    End Function
    It runs fine without the " Else " case but I have the trouble whenever / whatever on " else " case.

  5. #5
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,216

    Default Re: How do you open Sub- UDF from parent UDF

    John,
    Your Case A and B both would work. Typically, if you are finished with a table after opening, close it.. ie - Case A. But since you are using values from the Prdcts table to access a record in the Series table, you could use the existing table pointer to get those values instead of writing the Products field values to variables and using the variables to access the Series table. To accomplish the latter, you would need the products table to remain open and point to it to get the field values to address the Series table, and close it at the end, as you have in Case B. I have begun using <prt2>=<ptr1>.order() to query tables. It is less coding, seems to be faster, and you don't have to drop() it at the end. To do what I am describing, the code, derived from your Case B would be this:
    Code:
       tPrd = table.open("prdcts",FILE_RO_SHARED)
        qPrd=tPrd.order("","prod_id ="+quote(vPrdId))          'another method to filter table
        rPrd = qPrd.records_get()
             if rPrd>0 then
                vGrpId = alltrim(tPrd.Group_id)
                'vSeriesId = alltrim(tPrd.Series_id)    ' not needed anymore here
             'Read 2nd table
                   tSer = table.open("series",FILE_RO_SHARE)
                   qSer=tSer.order("","series_id="+quote(tPrd.Series_id) 'pointer gets value
                   rSer = tSer.Records_get()
                       if rSer > 0 then
    		         	vMtrType = alltrim(tSer.Mtr_type)
    	           else
                             'Shown the message by  UI_msg_box()
                       end if
                       tSer.close()
    	end if	
    	tPrd.close()
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  6. #6
    "Certified" Alphaholic Ray in Capetown's Avatar
    Real Name
    Ray Hendler
    Join Date
    Jan 2009
    Location
    South Africa
    Posts
    2,036

    Default Re: How do you open Sub- UDF from parent UDF

    John
    Can you clarify your question.
    Are you asking about when to close files, or an else condition or what the post says?
    I cant see where there is a second UDF call, maybe I am stupido but I have read thru all the codes a few times.

  7. #7
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: How do you open Sub- UDF from parent UDF

    Hi

    Sorry, I was out of office all day.

    Thank you Mike, for "<tbl>.order()" info.

    Ray,
    Sorry for confusing. My question is still remain as why did the 2nd(on else) condition hold or ran forever?

    On the "else" condition, I deleted and inserted the Ui_msg_box(), the Message shows all the time.


    'Condition
    If vMtrType ="Dir" then
    vConvQty = vEstQty
    'Some other calcuation here
    else
    vConvQty = Est_Indirect_poqty (** Tried put the variable too here)
    end if

  8. #8
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,313

    Default Re: How do you open Sub- UDF from parent UDF

    John,

    In your function you run a query and then retrieve a field value from the "found" record. That "found" field value is then used in your IF.. ELSE..END IF code block.

    This will not work because the script in your function DOES NOT WAIT for the query to be completed before executing (or attempting to execute) the statements which follow. Instead, the query is run in a separate thread, and the script continues to run without stopping until the query has finished. In your script that means the variable vMbrType has no value... indeed it doesn't even exist... when the IF..ELSE..END IF code block begins.

    -- tom

  9. #9
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,313

    Default Re: How do you open Sub- UDF from parent UDF

    John,

    FWIW, I think you've chose a slow way to "find" a record. If you are looking for a single record resist the temptation to run a query against the whole table. Instead, set an index and do a find by key. No query is necessary if the desired record can be found using an indexed search.

  10. #10
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: How do you open Sub- UDF from parent UDF

    Tom,

    Thank you. I think this a solution
    run a query and then retrieve a field value from the "found" record
    I will try now and let you.

  11. #11
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: How do you open Sub- UDF from parent UDF

    Tom,

    I gave up to use the Index because my Index is not stabilize, some reason, after packing or update index, the index name was changed by A5.

  12. #12
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,657

    Default Re: How do you open Sub- UDF from parent UDF

    Quote Originally Posted by johnkoh View Post
    Tom,

    I gave up to use the Index because my Index is not stabilize, some reason, after packing or update index, the index name was changed by A5.
    Make the index name 10 characters or less...
    Start with a letter and only use letters, numbers, or underscore _
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  13. #13
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,313

    Default Re: How do you open Sub- UDF from parent UDF

    John, it's possible that using a "faster" technique to find the desired record will solve your problem. However, the most reliable way to overcome a "timing" issue like this is to use separate user defined functions. Your script will halt until a user defined function has completed its work. Then it will resume. So, if it were me I'd put the code that's retrieving the desired field value into its own function,

  14. #14
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: How do you open Sub- UDF from parent UDF

    Tom,

    I think it caused more than "Find" problem Because
    I tested this UDF and applied on Calculate Value as (Case 1) xPoQty = Est_poqty_calc2(EstQty) or (Case 2) xPoQty = if(EstQty> 0.01, Est_poqty_calc2(EstQty), 0).

    After added the xPoQty field into a browse
    a) the design mode is shown the Ui_get_text() box until end of record and stop
    b) If I change the mode, Ui_get_text() box is displayed and does not stop nor does not close
    c) If I click on a field, Ui_get_text() box is displayed and does not stop nor does not close


    Code:
     FUNCTION Est_poqty_calc2 AS N ( vEstQty as n )
    
    'Test Shown the Ui_get_text
    vMtrType = ui_get_text("Test","enter dir or Ind")
    	
    	if vMtrtype="dir" then
    		Est_poqty_calc2 = vEstQty
    	
    	elseif vMtrtype="Ind"
    		Est_poqty_calc2 = vEstQty * 2
    	else
    		ui_msg_box("Error","No records  "+crlf()+vMtrtype)
    		cancel() 'end 
    	end if
    END FUNCTION
    I am not sure that why this UDF works well and the other does not.

    On Calculated value, xDeduct = if(Estitem->out_Yn=.t.,Est_Deduct_qty(Estitem->Prod_Id,Estitem->Estqty,Estitem->Estuom),0)

    Code:
    FUNCTION Est_Deduct_qty AS N (vPrdctId AS C, vEstQty as n, vEstUom as c )
    'get the ShapeId from prdct table
    	dim tPrd as p
    	dim qPrd as p
    	dim vShapeId as c
    	tPrd = table.open("prdcts",FILE_RO_SHARED)
    	query.order=""
    	query.filter="prod_id ="+quote(vPrdctId)
    	qPrd = tPrd.query_create()
    		vShapeId = alltrim(tPrd.Shape_id)
    	qPrd.drop()
    	tPrd.close()	
    		'get the waste rate, size from Shape table
    		dim tShape as p
    		dim qShape as p
    		dim vShapeId as c
    		dim Shared vLength as n
    		dim shared vAreaUnit as n
    			Shape_info(vShapeId)
    		
    	'Calculate the est Qty, Convert to each pc Condition
    	dim vPieces as n
    	if vEstUom = "sqft" then
    		Est_Deduct_qty = vEstQty
    	elseif vEstUom ="lnft" 
    		Est_Deduct_qty = round(vEstQty*12/vLength*vAreaUnit,2)	
    	else if vEstUom = "each" 
    		Est_Deduct_qty = round(vEstQty*vAreaUnit,2)	    
    	end if
    END FUNCTION

  15. #15
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,313

    Default Re: How do you open Sub- UDF from parent UDF

    John,

    Me understand you not.

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

    Default Re: How do you open Sub- UDF from parent UDF

    John:
    I am at loss!
    There is about 4 different questions in this thread.
    I will answer the first, the last and skip all in between.
    The first question (in the first post): The second function does not work because you didn't pass the variables to it.
    The last question (in the last post): The second "Einstein" function doesn't work because, for a starter:
    vPrdctId: who is vPrdctId? Where did he come from? and where does he live?
    I stopped there..let's clear this up first and go from there.

  17. #17
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: How do you open Sub- UDF from parent UDF

    Hi,

    Well, Hmmm....

    I want to have a Calculated value which works with UDF so that I can add it as a field on the Browse.

    First --- I created an UDf which calculate an estimated value to Purchase Quantity.

    Function Est_poqty_calc as n (vPrdId as c, vEstQty as n, vEstUom as c )
    tPrd = table.open("prdcts",FILE_RO_SHARED)
    query.order=""
    query.filter="alltrim(prod_id) ="+quote(vPrdId)
    qPrd = tPrd.query_create()
    rPrd = qPrd.records_get()
    if rPrd>0 then
    vGrpId = alltrim(tPrd.Group_id)

    tGrp = table.open("Prdgrp",FILE_RO_SHARED)
    iGrp = tGrp.index_primary_put("Group_Id")
    rGrp = tGrp.fetch_find(vGrpId)
    if rGrp>0 then
    vSeriesId = alltrim(tGrp.Series_id)

    tSer = table.open("series",FILE_RO_SHARED)
    query.order=""
    query.filter="series_id="+quote(vSeriesId)
    qSer = tSer.query_create()
    rSer = tSer.Records_get()
    if rSer > 0 then
    vMtrType = alltrim(tSer.Mtr_type)
    'Conditions to calculate a vConvQty
    If vMtrType ="Dir" then
    vConvQty = vEstQty
    'Some other calcuation here
    else
    vConvQty = vEstQty * 2
    end if
    Est_poqty_calc = vConvQty +(vConvQty*.10)

    else
    'Shown the message by UI_msg_box()
    end if
    qSer.drop()
    tSer.close()
    end if
    qPrd.drop()
    tPrd.close()
    End Function
    Second -- I applied this UDf at Form's Calculated Values as like
    Code:
     
     xPoQty = Est_poqty_calc( Prdct_id,  EstQty, EstUom)
    Third --- Inserted the xPoQty from DragDrop List.
    Fourth -- Save it and changed the Enter View form Mode and It works fine so far.


    Now, I want to create an xdialog box at "Else" Conditions to calculate a vConvQty .

    Code:
     'Conditions to calculate a vConvQty 
                             If vMtrType ="Dir" then
                                   vConvQty = vEstQty
                                   'Some other calcuation here
                            else
                                  'vConvQty = Est_Indirect_poqty (vEstQty, VestUom)  ' Not shown the code on here, However
                                  'I used the Ui_msg_box() Instead of the UDF because I am not sure that the code makes a trouble or not.
                                   ui_msg_box("test","Indirect material ")  'I think this Msg_box must be stop on end of the records.
    
                            end if
                                   Est_poqty_calc = vConvQty +(vConvQty*.10) 
    Now, the problem is that an xDialog(from else condition) or ui_msg_box() did not stop at all. I cannot save a form or close it.

    My question is why did the xDialog or msg_Box open all the time?


    Do you understand my problem now?

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

    Default Re: How do you open Sub- UDF from parent UDF

    Yes, I do. The second function takes 2 parameters: vEstQty, VestUom
    Where and who fills in these parameters?
    Not you (not the user). Then who? and from where?

  19. #19
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: How do you open Sub- UDF from parent UDF

    G

    I think from here, "Function Est_poqty_calc as n (vPrdId as c, vEstQty as n, vEstUom as c )"

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

    Default Re: How do you open Sub- UDF from parent UDF

    No. It doesn't.
    Don't feel bad, it's a bit tricky, poorly documented and unnecessarily confusing. Here is one way to do it (of course, I ave no way of testing it):
    Code:
     Function Est_poqty_calc as n (vPrdId as c, vEstQty as n, vEstUom as c )
    tPrd = table.open("prdcts",FILE_RO_SHARED)
    query.order=""
    query.filter="alltrim(prod_id) ="+quote(vPrdId)
    qPrd = tPrd.query_create()
    rPrd = qPrd.records_get()
    if rPrd>0 then
    vGrpId = alltrim(tPrd.Group_id)
    
    tGrp = table.open("Prdgrp",FILE_RO_SHARED)
    iGrp = tGrp.index_primary_put("Group_Id")
    rGrp = tGrp.fetch_find(vGrpId)
    if rGrp>0 then
    vSeriesId = alltrim(tGrp.Series_id)
    
    tSer = table.open("series",FILE_RO_SHARED)
    query.order=""
    query.filter="series_id="+quote(vSeriesId)
    qSer = tSer.query_create()
    rSer = tSer.Records_get()
    if rSer > 0 then
    vMtrType = alltrim(tSer.Mtr_type)
    'Conditions to calculate a vConvQty
    
    If vMtrType ="Dir" then
    vConvQty = vEstQty
    'Some other calcuation here
    else
    x=local_variables()
    vConvQty=Est_Indirect_poqty(x)'I am guessing this second function will estimate vConvQty
    end if
    Est_poqty_calc = vConvQty*1.10)'I simplified this expression. It has nothing to do with your question
    else
    'Shown the message by UI_msg_box()
    end if
    qSer.drop()
    tSer.close()
    end if
    qPrd.drop()
    tPrd.close()
    End Function 
    
    Function Est_Indirect_poqty as v(vars as p)
    dim new_v1 as n=vars. vEstQty
    dim new_v2 as c=vars.vEstUom	
    	'whatevever this function does goes here
    end function

  21. #21
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,313

    Default Re: How do you open Sub- UDF from parent UDF

    John,

    I continue to think the message box is opening all the time because the variable rser is not greater than zero. Why? See my earlier post in this thread. Your script will not stop to wait for the query to be run so that the record count of matching records can be discovered.

    May I suggest you use the trace window to display the rSer count immediately before the IF ... ELSE ... END IF code block. Does it show the value you are expecting?

    -- tom

  22. #22
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: How do you open Sub- UDF from parent UDF

    G,

    Thank you for the POINT of problem.

    After applied your comment, I got an ERROR. A5 --- "Variable type Mismatch"

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

    Default Re: How do you open Sub- UDF from parent UDF

    This means your second function is now working but the variables are not dimmed properly or you are using them improperly.
    I am suspecting the error is right at this line:
    vConvQty=Est_Indirect_poqty(x)
    As I said, I was guessing what the second function is supposed to do since you didn't say.
    What is it supposed to do?
    What is the actual code in the second function?

  24. #24
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: How do you open Sub- UDF from parent UDF

    G,

    This is what I did and
    the 2nd UDf has an xDialog form and shows more detail (option) of the selections.
    User can changes the selection.

    Code:
                             dim shared vConvQty as n
                             If vMtrType ="Dir" then
                                   vConvQty = vEstQty                               
                             Else 
                                   dim x as p
    	                       x = Local_variables()
    	                          'Est_Ind_poQty(x)  'Tried this
    	                          'Est_PoQty_calc3 = Est_Ind_poQty(x) 'Tried this
    	                       vConvQty = Est_Ind_PoQty(x) 'Tried this
                             End If
    
    
    Function Est_Ind_poQty as N (vars as p ) 'I tried "v" type
    	dim vNew_EstQty as n = vars.vEstQty
    	dim vNew_EstUom as c = vars.vEstUom
    	vConvQty = vNew_EstQty * 2
    	ui_msg_box("test","indirect materiasl "+vConvQty)
    end function
    The A5 Error message is now gone. but still the Msg_box() is shown and not able to close it.

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

    Default Re: How do you open Sub- UDF from parent UDF

    What do you have to do to close the msg box?

    As an aside, the second function Est_Ind_poQty has 2 arguments:
    vEstQty N
    VestUom C
    What are you doing with VestUom in this function?
    As another aside, I am questioning that's all the second function does! You don't need an UDF for that.

  26. #26
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,313

    Default Re: How do you open Sub- UDF from parent UDF

    John and I were able to look at his code running in context. We are both a bit mystified.

    Here's what's happening:

    His UDF is being used in a calc display field in a set based form. That field is then displayed in the embedded browse that shows linked (1 to many) child records. The calculation uses column values from the same row, and "looks up" other values in external tables, to compute the desired figure.

    The UDF behaves correctly unless he inserts a message box into the UDF code. If a message box is inserted then the form recalculates the calc display values in an endless loop. Something about the display of the message box causes the form to recalc the calc field in each row of the browse. Since that calc displays another message box, the recalc continues.

    Wierd.

    -- tom

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

    Default Re: How do you open Sub- UDF from parent UDF

    Tom:
    What do you have to do to close the msg box?
    Did the last record in the browse calculate correctly but the msgbox remained open?

  28. #28
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: How do you open Sub- UDF from parent UDF

    G,

    Shut A5 down and Yes, It did Correctly

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

    Default Re: How do you open Sub- UDF from parent UDF

    And which msgbox that remains open?
    Code:
    else
    'Shown the message by UI_msg_box()
    or
    Code:
    ui_msg_box("test","indirect materiasl "+vConvQty)

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

    Default Re: How do you open Sub- UDF from parent UDF

    I don't think the usage of msgbox in a browse is appropriate as each row might have a different output for the UDF, meaning one row might have one msgbox, the next might have another and the third has none.
    This is multiple personality syndrome on steroids.
    The purpose of the msgbox is for user interaction, for "One Occurrence" at a time, for the user to interact with that occurrence, not for the masses.

Similar Threads

  1. UDF help sys
    By DaveM in forum Alpha Five Version 10 - Desktop Applications
    Replies: 4
    Last Post: 05-21-2010, 12:29 PM
  2. Help with UDF
    By draxx in forum Alpha Five Version 5
    Replies: 6
    Last Post: 01-31-2010, 05:40 PM
  3. UDF triggering twice
    By Dave Booth in forum Alpha Five Version 10 - Desktop Applications
    Replies: 7
    Last Post: 11-23-2009, 01:40 PM
  4. UDF for v7
    By DaveM in forum Code Archive
    Replies: 0
    Last Post: 09-17-2009, 11:38 AM
  5. UDF Variables
    By davej in forum Code Archive
    Replies: 5
    Last Post: 02-12-2005, 02:07 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
  •