|
softballs Newbie
Joined: 15 Sep 2015 Posts: 9
|
Posted: Fri Sep 18, 2015 12:29 am
SOLVED - Hide return value of a function |
I am using the following code:
#show %additem("north", path)
I do not want the return value to be sent to the mud that is why i use #show, but my question is can i use something else to just ignore/hide the return value? |
|
Last edited by softballs on Wed Sep 23, 2015 10:41 pm; edited 1 time in total |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Fri Sep 18, 2015 9:04 am |
Typically you would use #call for that, but in this case, that would have no effect. The %additem function doesn't actually change the contents of the variable, so normally you would assign the return value from the function back to the variable. Something like this:
Code: |
path = %additem("north", @path) |
|
|
|
|
softballs Newbie
Joined: 15 Sep 2015 Posts: 9
|
Posted: Wed Sep 23, 2015 10:41 pm |
Yeah I didnt notice that at first, code updated to the following and now all is working:
Code: |
#var path %additem("north", @path) |
|
|
|
|
Tarn GURU
Joined: 10 Oct 2000 Posts: 873 Location: USA
|
Posted: Thu Sep 24, 2015 12:18 am |
%additem doesn't modify the list but does return a value.
#additem does modify the list but does not return a value (but note that #additem has the name of the list first and thing to add second, vs the function %additem which does the reverse)
#additem path "north"
is simpler and arguably more to the point of what you want to do. |
|
|
|
softballs Newbie
Joined: 15 Sep 2015 Posts: 9
|
Posted: Thu Sep 24, 2015 1:35 am |
My list contains duplicates though so I cant use #additem
|
|
|
|
|
|