S
Starke
Im trying to set up a method and pass a varible to it then out put the
new manipulated varible back out. Here is what I have
---------------------------------
var1 = 'test'
def change var_in
puts var_in
var_in = 'test1'
puts var_in
end
change var1
-----------------------------------
As you can see, I pass in var1 into the method and then I change the
value to 'test1'. I would like to method to go back and update var1,
so that if passed into another method it reflects the change that
method change var_in did. Does this make since? Im new to
programming.
new manipulated varible back out. Here is what I have
---------------------------------
var1 = 'test'
def change var_in
puts var_in
var_in = 'test1'
puts var_in
end
change var1
-----------------------------------
As you can see, I pass in var1 into the method and then I change the
value to 'test1'. I would like to method to go back and update var1,
so that if passed into another method it reflects the change that
method change var_in did. Does this make since? Im new to
programming.