Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Function Fun' topicStudent Support Forum > General > "Function Fun"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Michael
11/12/12 9:02pm

Your function call is equivalent to

{a, b}[[1]] = "Help!!"

The head {a,b} is not a symbol. Try instead

funcTest[list_, str_String, count_Integer] := list[[count]] = str;
SetAttributes[funcTest, HoldFirst];
list = {a, b};
funcTest[list, "Hi", 1];
list

URL: ,

Subject (listing for 'Function Fun')
Author Date Posted
Function Fun CCOsborn 11/12/12 1:56pm
Re: Function Fun Michael 11/12/12 9:02pm
Re: Function Fun Nasser M. Ab... 11/13/12 00:03am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic