Variable changing when it shouldn't

Started by tony on 20-Jan-2012/16:04:59-8:00
Here is a simple script output. I can't understand why var1 is changing. I don't want it to change. I want to copy var1 into var2 and work with var2 only. var1: ["my" "name"] == ["my" "name"] >> >> f5: "tony" == "tony" >> >> var2: var1 == ["my" "name"] >> >> replace var2 "name" f5 == ["my" "tony"] >> >> probe var2 ["my" "tony"] == ["my" "tony"] >> >> probe var1 ["my" "tony"] == ["my" "tony"] Why has var1 changed, it should be "my" "name" shouldn't it??
You did var2: var1 which means var1 and var2 are two references to the same block. If you want an extra block, use COPY in that assignment.
Nice, thanks a lot Kaj!

Reply