assignment problem solved
- To: mathgroup at smc.vnet.net
- Subject: [mg94122] assignment problem solved
- From: Ignacio Plazeta <Ignacio.Plazeta at speednet.es>
- Date: Fri, 5 Dec 2008 05:32:23 -0500 (EST)
The code in my previous post was trying to change
the function's argument. That's not allowed. Using
tmp = myData;
tmp[[myList[[k]], 16]] = myValue;
Return[tmp]
I get it right.
Thanks for your attention.
Ignacio
-------------------------------------------------------
Dear Friends
The following code won't work and returns the error
Set::setps: "{{1,<<9>>,<<22>>},<<9>>,<<111172>>} in the part \
assignment is not a symbol."
But
myData[[myList[[k]], 16]] = myValue;
outside the function does what is expected !
I'm incapable to understend the reason and fix the problem;
can someone give me an hint ?
Thanks a lot.
Warmest regards.
Ignacio
setBranca[myData_, myList_, myValue_] := Module[{tmp},
Table[
If[
myData[[myList[[k]], 16]] == "",
myData[[myList[[k]], 16]] = myValue;
];
,{k, 1, Length[myList]}
];
]
setBranca [myArchive, {1, 2, 3}, "myNewValue"]