MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

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"]



  • Prev by Date: Re: A plot of Sign[x]
  • Next by Date: Re: easier method for Flatten[Position[list2,x_x...??
  • Previous by thread: Re: vertical lines in plot
  • Next by thread: Re: Re: Re: easier method for