Concatinating old value and new value for modified columns.

Posted on 2006-06-15
Last Modified: 2013-12-26
We have 10 detail rows in detail window. If the user double clicks one particular row then it opens the response window with all the 15 columns. So he can modify any values of 15 columns. Once he finished that then he press ok button. So the response window is automatically closed and the modified column/s value/s displayed on the detail window.
Right now the existing program is doing as
Suppose he double clicks on one row and does some modifications out of 15 columns and press ok button, it automatically closed and modified that particular row.
Let’s say he did modifications on two rows out of 10 rows. The existing program is passing 2 rows { ls_uc_row [1]  , ls_uc_row [2] } to update procedure, the remaining values {{ ls_uc_row [3]  , ls_uc_row [4]…ls_uc_row [10]  }are spaces.
Each row like ls_uc_row [1]  { ls_field[1] + ls_field[2] + …. + ls_field[15] }

I need to do find the old value and new value for modified values as well as description of that particular column out of 15 columns. So each modified row I need to add modified fields as [column_desc(char20)+old_value(char10)+new_value(char10)]. If he modified 4 columns out of 15, I need to add 4 more fields for the particular row like the above format.

Thanks for your advance help.
Question by:venkat4sv
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

tr1l0b1t earned 125 total points
ID: 16913320

Assuming you'd like to fill 'ls_uc_row' array with dw_1 changes ...

String ls_uc_row[]
Long ll_idx = 1

String ls_format, ls_old, ls_new, ls_colname
Long ll_col, ll_cols, ll_row, ll_rows

ll_rows = dw_1.RowCount()      // Nº of rows should be always 1
ll_cols = Long(dw_1.Describe("DataWindow.Column.Count"))

For ll_row = 1 To ll_rows
     For ll_col = 1 to ll_cols
          If dw_1.GetItemStatus(ll_row, ll_col, Primary!) = DataModified! Then
               ls_colname = dw_1.Describe("#" + String(ll_col) + ".name")
               // We'll get the data in same format as defined in dw
               ls_format = dw_1.GetFormat(ll_col)
               // Get old and new values
               ls_old = String(dw_1.Object.Data.Primary.Original[ll_row, ll_col], ls_format)
               ls_new = String(dw_1.Object.Data.Primary.Current[ll_row, ll_col], ls_format)
               // Fill in the array and right pad values with spaces
               ls_uc_row[ll_idx] = ls_colname + Fill(" ", 20 - Len(ls_colname)) + &
                                            ls_old + Fill(" ", 10 - Len(ls_old)) + &
                                            ls_new + Fill(" ", 10 - Len(ls_new))
               ll_idx ++
          End If

Hope it helps

Author Comment

ID: 16920397
But I’m not getting proper values.
We have One window(w_master) and two datawindows (dw_1 & dw_2) with in the window. The second dw has detail rows. The maximum detail rows are 10 and each one has 15 columns. If we click one particular row it will open one response window with previous values. Here we are changing the value/s and click ok then it closes automatically and goes to our first window(w_master) with modified value/s in detail row. When we hit save button on first window they are passing only changed rows (15columns) as an array type to update procedure. I need to add modified columns at the end of each modified row like desc+prev_value+new_value.
Thanks for your help.

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question