Compare table function to display in 2 columns with objective to make one of the tables equal to the second. "For exporting work"
First this is credited to Stan mathews, who primarily developed the code plus some others may have contribute.
Original Thread:
http://msgboard.alphasoftware.com/al...661#post599661
Herer is the latest code.
table1 = ui_get_table("Table One","Table")
table2 = ui_get_table("Table Two","Table")
Dim Tbl1 as p
Dim Tbl2 as p
if table1 = "" .or. table2 = "" .or. (table1 = table2)
ui_msg_box("Alert","Invalid table selection.")
end if
struct1 = table.external_field_name_get(table1,"N,T,W,D,R")
struct2 = table.external_field_name_get(table2,"N,T,W,D,R")
found_same = word_in_common(struct1,struct2,crlf())
found_same = f_WrapText(found_same, 25 )
ui_msg_box("Same fields",found_same)
Tbl1 = word_subtract(struct1,found_same,crlf())
unq_to_table1 = word_subtract(struct1,found_same,crlf())
unq_to_table1 = f_WrapText(found_same, 25 )
ui_msg_box("Only in "+table1+" (or different.)",unq_to_table1)
Tbl2 = word_subtract(struct1,found_same,crlf())
unq_to_table2 = word_subtract(struct2,found_same,crlf())
unq_to_table2 = f_WrapText(found_same, 25 )
ui_msg_box("Only in "+table2+" (or different.)",unq_to_table2)
-----------------------------
In small tables this work is simple.
In large tables with a lots of different fields, it takes more work.
How to use:
Select the first table you want to adjust to be equal to the second.
Second select the second table and when they display, not the first display with the equal fields but the second with different fields, for the table to adjust, I use printscreen, so I can have a temp visual to make the changes. proceed to see the second table.
I open the first table on the left and the second table on the right + position the print screen in the third view.
Do the adjustments.
Have fun.
First this is credited to Stan mathews, who primarily developed the code plus some others may have contribute.
Original Thread:
http://msgboard.alphasoftware.com/al...661#post599661
Herer is the latest code.
table1 = ui_get_table("Table One","Table")
table2 = ui_get_table("Table Two","Table")
Dim Tbl1 as p
Dim Tbl2 as p
if table1 = "" .or. table2 = "" .or. (table1 = table2)
ui_msg_box("Alert","Invalid table selection.")
end if
struct1 = table.external_field_name_get(table1,"N,T,W,D,R")
struct2 = table.external_field_name_get(table2,"N,T,W,D,R")
found_same = word_in_common(struct1,struct2,crlf())
found_same = f_WrapText(found_same, 25 )
ui_msg_box("Same fields",found_same)
Tbl1 = word_subtract(struct1,found_same,crlf())
unq_to_table1 = word_subtract(struct1,found_same,crlf())
unq_to_table1 = f_WrapText(found_same, 25 )
ui_msg_box("Only in "+table1+" (or different.)",unq_to_table1)
Tbl2 = word_subtract(struct1,found_same,crlf())
unq_to_table2 = word_subtract(struct2,found_same,crlf())
unq_to_table2 = f_WrapText(found_same, 25 )
ui_msg_box("Only in "+table2+" (or different.)",unq_to_table2)
-----------------------------
In small tables this work is simple.
In large tables with a lots of different fields, it takes more work.
How to use:
Select the first table you want to adjust to be equal to the second.
Second select the second table and when they display, not the first display with the equal fields but the second with different fields, for the table to adjust, I use printscreen, so I can have a temp visual to make the changes. proceed to see the second table.
I open the first table on the left and the second table on the right + position the print screen in the third view.
Do the adjustments.
Have fun.
Comment