Alpha Video Training
Results 1 to 12 of 12

Thread: Array Question -will a multi-dimension array solve my problem?

  1. #1
    Member
    Real Name
    Don Lavigne
    Join Date
    Jan 2007
    Location
    New Jersey
    Posts
    223

    Default Array Question -will a multi-dimension array solve my problem?

    Hello!

    I am including a sample database to show and describe my problem. I beleive what I need to use is a multi-dimension array in order for me to update fields in a table. I need to use an xdialog and NOT a browse on a form. With the sample database I included a form will open. The button on the left... called "run script" will run the xdialog in question -"Array_Example". My problem is described in that xdialog. Thanks for any help!

    Don

    Complex_Array.zip

  2. #2
    "Certified" Alphaholic Clunes's Avatar
    Real Name
    Mark Pearson
    Join Date
    Jan 2010
    Location
    Brisbane, Queensland, Australia
    Posts
    1,001

    Default Re: Array Question -will a multi-dimension array solve my problem?

    very complex request to process. Why do you need to keep the save process to the end? It may be simpler to have a save message based on the user click event based on field changes.
    -----------------------------------------------
    Regards
    Mark Pearson
    mark.pearson@onestopsolutions.com.au
    Youtube channel
    Website

  3. #3
    Member
    Real Name
    Don Lavigne
    Join Date
    Jan 2007
    Location
    New Jersey
    Posts
    223

    Default Re: Array Question -will a multi-dimension array solve my problem?

    save has to happen at the end because it's an all or none procedure... if the user cancels then no changes can be made to the entire process.

  4. #4
    "Certified" Alphaholic Clunes's Avatar
    Real Name
    Mark Pearson
    Join Date
    Jan 2010
    Location
    Brisbane, Queensland, Australia
    Posts
    1,001

    Default Re: Array Question -will a multi-dimension array solve my problem?

    Hi Don,

    I know this does not answer your question, but I looked at your use of arrays and thought I could supply an alternative to them for you to look at. cut and apste the below script. It should create an xdialog with two of your lists. To me it has a simpler look and feel.



    dim Patron as c
    dim myid as c
    dim charges3 as c = ""
    patron = TABLE.EXTERNAL_RECORD_CONTENT_GET("patrons","'{Data='+ alltrim(patron_id) + '}' + alltrim(patron_ID) + '|' + alltrim(Pa_Fu_Na) + '|' + alltrim(Pa_Addr_1) + '|' + alltrim(Pa_City) + '|' +alltrim(Pa_State) + '|' + alltrim(Pa_Zip) + '|'+ alltrim(Pa_H_Ph)")

    ui_dlg_box("Patrons",<<%dlg%
    {on_activate=init}
    {region}{font=arial,10}
    [%K%.134,15id1^"#:6|Patron_ID:14|Name:21|Addr:30|City:22|State:8|Zip:10|Phone:20"Patron!change_*];

    [%K%.66,18id2^"#:6|Patron_ID:14|Charge_ID3:0|Charge:15|Item:30|Details:30|Interest:12|Tax:12"Charges3];
    {endregion};
    %dlg%,<<%code%

    if left(a_dlg_button,7) = "change_" then
    myid = id1
    if a_dlg_button = "change_click" then

    charges3 = table.external_record_content_get("charges","'{Data='+ alltrim(Patron_Id) + '}' + alltrim(patron_ID) + '|' + Charge_Id + '|' + Charge + '|' + Item + '|' + Other_Details + '|' + Interest + '|' + Tax","","Patron_Id=var->myid")
    ui_dlg_commit("Patrons")
    elseif a_dlg_button = "change_setfocus" then

    charges3 = table.external_record_content_get("charges","'{Data='+ alltrim(Patron_Id) + '}' + alltrim(patron_ID) + '|' + Charge_Id + '|' + Charge + '|' + Item + '|' + Other_Details + '|' + Interest + '|' + Tax","","Patron_Id=var->myid")
    ui_dlg_commit("Patrons")
    end if

    a_dlg_button = ""
    end if




    %code%)
    -----------------------------------------------
    Regards
    Mark Pearson
    mark.pearson@onestopsolutions.com.au
    Youtube channel
    Website

  5. #5
    "Certified" Alphaholic Clunes's Avatar
    Real Name
    Mark Pearson
    Join Date
    Jan 2010
    Location
    Brisbane, Queensland, Australia
    Posts
    1,001

    Default Re: Array Question -will a multi-dimension array solve my problem?

    My appologies - the last example did not factor in the serial numbering. This one does

    dim Patron as c
    dim myid as c
    dim charges3 as c = ""
    patron = TABLE.EXTERNAL_RECORD_CONTENT_GET("patrons","'{Data='+ alltrim(patron_id) + '}' + alltrim(patron_ID) + '|' + alltrim(Pa_Fu_Na) + '|' + alltrim(Pa_Addr_1) + '|' + alltrim(Pa_City) + '|' +alltrim(Pa_State) + '|' + alltrim(Pa_Zip) + '|'+ alltrim(Pa_H_Ph)")

    patron = *for_each(x,left(x.value,at2("}",x.value,1)) + *counter() + "|" + right(x.value,len(x.value)-at2("}",x.value,1)),patron)
    ui_dlg_box("Patrons",<<%dlg%
    {on_activate=init}
    {region}{font=arial,10}
    [%K%.134,15id1^"#:6|Patron_ID:14|Name:21|Addr:30|City:22|State:8|Zip:10|Phone:20"Patron!change_*];

    [%K%.66,18id2^"#:6|Patron_ID:14|Charge_ID3:10|Charge:15|Item:30|Details:30|Interest:12|Tax:12"Charges3];
    {endregion};
    %dlg%,<<%code%

    if left(a_dlg_button,7) = "change_" then
    myid = id1
    if a_dlg_button = "change_click" then

    charges3 = table.external_record_content_get("charges","'{Data='+ alltrim(Patron_Id) + '}' + alltrim(patron_ID) + '|' + alltrim(Charge_Id) + '|' + transform(Charge,'$$$$.99') + '|' + Item + '|' + Other_Details + '|' + Interest + '|' + Tax","","Patron_Id=var->myid")
    charges3 = *for_each(x,left(x.value,at2("}",x.value,1)) + *counter() + "|" + right(x.value,len(x.value)-at2("}",x.value,1)),charges3)

    ui_dlg_commit("Patrons")
    elseif a_dlg_button = "change_setfocus" then

    charges3 = table.external_record_content_get("charges","'{Data='+ alltrim(Patron_Id) + '}' + alltrim(patron_ID) + '|' + Charge_Id + '|' + Charge + '|' + Item + '|' + Other_Details + '|' + Interest + '|' + Tax","","Patron_Id=var->myid")
    charges3 = *for_each(x,left(x.value,at2("}",x.value,1)) + *counter() + "|" + right(x.value,len(x.value)-at2("}",x.value,1)),charges3)

    ui_dlg_commit("Patrons")
    end if

    a_dlg_button = ""
    end if




    %code%)
    -----------------------------------------------
    Regards
    Mark Pearson
    mark.pearson@onestopsolutions.com.au
    Youtube channel
    Website

  6. #6
    Member
    Real Name
    Don Lavigne
    Join Date
    Jan 2007
    Location
    New Jersey
    Posts
    223

    Default Re: Array Question -will a multi-dimension array solve my problem?

    Hi Mark!
    Thanks for giving me another example of my problem. I always like seeing different ways of accomplishing the same thing. I will study it and hope it can give me new ideas. Have a great day!

    Don

  7. #7
    Member
    Real Name
    Don Lavigne
    Join Date
    Jan 2007
    Location
    New Jersey
    Posts
    223

    Default Re: Array Question -will a multi-dimension array solve my problem?

    .bump

  8. #8
    "Certified" Alphaholic Clunes's Avatar
    Real Name
    Mark Pearson
    Join Date
    Jan 2010
    Location
    Brisbane, Queensland, Australia
    Posts
    1,001

    Default Re: Array Question -will a multi-dimension array solve my problem?

    Can I ask what other and other2 relate to. Still not sure I fully understand, but what about a notional save to a list from a button. Instead of your field boxes on the right hand side, have a button/s. When clicked it brings up xdialog with the detail you had in the field boxes. Do your thing, then close to return to the screen. When it closes it adds data to a global list that when the OK button is clicked, it loops through the list and does the changes you wanted.

    Hope this makes sense
    -----------------------------------------------
    Regards
    Mark Pearson
    mark.pearson@onestopsolutions.com.au
    Youtube channel
    Website

  9. #9
    "Certified" Alphaholic Clunes's Avatar
    Real Name
    Mark Pearson
    Join Date
    Jan 2010
    Location
    Brisbane, Queensland, Australia
    Posts
    1,001

    Default Re: Array Question -will a multi-dimension array solve my problem?

    In relation to my last, I would also consider that when the OK button is pressed it opens a xdialog with a list based on the changes only. This would have an accept button. There would be the opprounty to remove rows, return to main view and fix
    -----------------------------------------------
    Regards
    Mark Pearson
    mark.pearson@onestopsolutions.com.au
    Youtube channel
    Website

  10. #10
    Member
    Real Name
    Don Lavigne
    Join Date
    Jan 2007
    Location
    New Jersey
    Posts
    223

    Default Re: Array Question -will a multi-dimension array solve my problem?

    Hi Mark,
    The example I provided is a generic app that I threw together to try and figure out my problem... which is an EMR/EHR program and the problem I am trying to solve is how to make a bulk payment by an insurance company.

    ie. Blue Cross sends a bulk payment and now I need to apply those payments accross many different patients (and the many services performed on those patients) that only have blue cross. So in my example, the "patron" is actually the patient (or patients that have blue cross) and the charges and item numbers would be equivalent to the services etc. that have been performed on those patients. "Other" and "Other2" are blank because those would be the fields that I would enter the amount of the payment.

    What I need to accomplish is to bring up the services for a single patient so I can apply a payment to those services. Then I need to bring up the next patient on the EOB (bulk payment) and apply the payments to those services.... the trouble I have is that when I navigate to a different patient the array initializes and blanks out the payments I just made to previous patient.

    I can't save each time because it's a bulk payment that needs to be entered all at once.

    I think I should be able to use an append_array function to add to the existing array (instead of overwriting each time I navigate to a different patient), but I haven't figured out how to NOT append if those items were already in the array (ie. if I go back to a previous item/service).

    I think I'm getting closer and closer, but it's taken a while so far and I don't yet see the light at the end of the tunnel.

    Don
    Last edited by djldc; 08-08-2011 at 03:02 PM. Reason: sp

  11. #11
    Member
    Real Name
    Don Lavigne
    Join Date
    Jan 2007
    Location
    New Jersey
    Posts
    223

    Default Re: Array Question -will a multi-dimension array solve my problem?

    I beleived I figured out a solution:

    using <ARRAY>.FIND()

    I will post the example later tonight after I get home and spend some time on it.

    Don

  12. #12
    Member
    Real Name
    Don Lavigne
    Join Date
    Jan 2007
    Location
    New Jersey
    Posts
    223

    Thumbs up Re: Array Question -will a multi-dimension array solve my problem?

    yup... that did the trick.
    Complex_Array_final.zip

Similar Threads

  1. multi-select web report (array)
    By eboughey1 in forum Application Server Version 9 - Web/Browser Applications
    Replies: 2
    Last Post: 12-13-2008, 12:15 AM
  2. Filter on Multi-dimensional Array
    By Graham Wickens in forum Alpha Five Version 7
    Replies: 1
    Last Post: 02-28-2007, 10:10 AM
  3. Array Question
    By jwolfe11 in forum Alpha Five Version 5
    Replies: 2
    Last Post: 09-18-2004, 08:06 PM
  4. array question
    By martinwcole in forum Alpha Five Version 5
    Replies: 2
    Last Post: 07-15-2003, 12:40 AM
  5. array question
    By David Montgomery in forum Alpha Five Version 5
    Replies: 1
    Last Post: 10-02-2002, 11:13 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
  •