Yesterday I posted an error (in this thread) that I had not been able to
find a solution for, but later on I found out why this was happening and I
informed you that this was solved. However I feel that the cause to this
error may be common to many, especially ooRexx newcomers like myself. So I
just wish to illustrate 3 different coding techniques of which only one
gives the correct result even if they all look OK for an untrained eye. My
reported error was caused because I had used the technique shown in method
m2.
I hope this can be of use to some.
Staffan
c = .myclass~new
a = .array~new
a[1] = "a"
b = c~m1(a)
say a[1]
say b[1]
a[1] = "a"
b = c~m2(a)
say a[1]
say b[1]
a[1] = "a"
b = c~m3(a)
say a[1]
say b[1]
::class myclass
::method m1
use arg arg1
arg1[1] = "aa"
return arg1
::method m2
use arg arg1
myarg1 = arg1
myarg1[1] = "aa"
return myarg1
::method m3
use arg arg1
myarg1 = arg1~copy
myarg1[1] = "aa"
return myarg1
I have the following strange scenario in a listview dialog, where all items
> have user data associated with them via setItemData:
>
> - select an item (item 5 for example)
> - create a new item (for example item 9) based on the selected, with a
> modified version of item 5's item data
> - delete item 9
> - select item 5 again
> - create a new item - this fails because item 5 now seems to contain item
> 9's item data
>
> Having run several variations of this it looks like getItemData retrieves
> the data from the last setItemData and not the data associated with the
> item passed to getItemData (based on listview~selected).
>
> Could this be a possibility or do I have a bug in my code that I haven't
> been able to locate?
>
>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users