How to copy a Listview, changing things in the copy, keeping the original
Posted: Thu Feb 15, 2018 10:23 am
I posted this on comp.lang, got several reactions (oClone which I never heard about, a seperate function) but all change the original listview. So in case someone missed this post and knows an alternative to copy a listview just like aClone works for arrays I post it here as well:
We show a listview in a window and use that LV variable to pass to a
method to export the contents to Excel.
Now 1 client wants to see a few of these columns omiitted in the Excel
export. It is not difficult ti remove the columns
(oLVl:DeleteColumn(2) etc) but thet should not be deleted in the
'master' listview showing in the screen.
Problem is that doing this:
oLVCopy:=oLVOriginal
and then delete the columns in oLVCopy also deletes these columns in
oLVOriginal, which is apparently copied by reference.
What would be the quickets way to copy the listview in such a way that
I can still pass it after deleting the required columns to my Excel
function without changing the original listview?
Dick
We show a listview in a window and use that LV variable to pass to a
method to export the contents to Excel.
Now 1 client wants to see a few of these columns omiitted in the Excel
export. It is not difficult ti remove the columns
(oLVl:DeleteColumn(2) etc) but thet should not be deleted in the
'master' listview showing in the screen.
Problem is that doing this:
oLVCopy:=oLVOriginal
and then delete the columns in oLVCopy also deletes these columns in
oLVOriginal, which is apparently copied by reference.
What would be the quickets way to copy the listview in such a way that
I can still pass it after deleting the required columns to my Excel
function without changing the original listview?
Dick